天天看点

myeclipse配置struts1

1.创建web新项目;

myeclipse配置struts1

下载struts1包,放到webroot/web-in/lib目录下,这些jar文件是:

myeclipse配置struts1

2:在web.xml文件中添加配置,配置主要内容为:

myeclipse配置struts1

3:把struts-blank-1.3.10应用下的struts-config.xml文件拷贝到自己工程WEB-INF目录下,编辑内容:

myeclipse配置struts1

4:分别新建包;com.struts1.app.action.login,   com.struts1.app.form.login 以及对应的.java :LoginAction.java,  LoginForm.java:

myeclipse配置struts1

5:编写LoginForm.java:

myeclipse配置struts1

6::编写LoginAction.java:

myeclipse配置struts1

7:编写login.jsp页面:

myeclipse配置struts1

8:success.jsp:

myeclipse配置struts1

 9:输入地址:http://127.0.0.1:8080/Struts1/login.jsp:

myeclipse配置struts1

整个工程架构:

myeclipse配置struts1

转载于:https://www.cnblogs.com/wyongqi/p/7708362.html