Filter控制器
jsp页面代码
<form action="page_login.action" method="post">
user:<input type="text" name="user">
pass:<input type="password" name="pass">
<input type="submit" value="sure">
</form>
<a href="page_reg.action">注册</a>
解决乱码的问题:POST 请求方法
<% request.setCharacterEncoding("UTF-8"); %>
Filter
HttpServletRequest req= (HttpServletRequest) request;
String Serverpath=req.getServletPath();
if(Serverpath.equals("/page_input.action"))
{
request.getRequestDispatcher("input.jsp").forward(request, response);
时间: 2024-11-02 00:12:25