struts2框架(整体写的比较乱之后有时间了在补)

Struts2框架

struts2核心就是拦截器

  1. 第一个sturts2练习
  2. 继承ActionSupport类
  3. 写方法UseLogin

Public class UserAction extends Actionsupport{

     Public String UserLogin(){

          Return SUCCESS;

}

}

4.在classpath(src)路径下面写出一个struts.xml文件

 <struts>

      <package>

         <action name=”userLogin”class=”web_action.Userlogin”></action>

        <result name=”success”>/login.jsp</result>

      </package>

</struts>

5.写一个jsp页面

……….

6.将项目部署到tomcat上面就可以运行了

原文地址:https://www.cnblogs.com/whr-blogs/p/12260256.html