学习Servlet的重要应用 在什么地方用写路径

一:转发!转发中用写路径自动跳转:

request.getRequestDisPatcher("路径")。forward(request,response);

 二:请求重定向

response.sendRedirect("路径");

 三:hTML页面的超链接href

response.getWeiter().weite("<html><body><a href="路径">超链接</a></body></html>");

 最后一种在html页面中form提交地址!

response.getWriter().write("<html><body><form action="路径“><input type='submit'/></form></body></html>

原文地址:https://www.cnblogs.com/w888/p/5223194.html