首页 > 代码库 > Struct初学的,页面跳转

Struct初学的,页面跳转

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="http://www.mamicode.com/sure">
         </form>
    <a href="http://www.mamicode.com/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);

Struct初学的,页面跳转