天天看點

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