1. 開啟ide(如eclipse),新建乙個web project(在eclipse裡是dynamic web project)。
2. 把下面的jar包放到webcontent/web-inf/lib目錄中。因為安全原因,tomcat缺省會從該目錄載入專案的jar資源:
antlr.jar
commons-beanutils.jar
commons-digester.jar
commons-fileupload.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jstl.jar
standard.jar
struts.jar
3. 因為struts1是通過servlet啟動的,所以在web.xml加入下面的內容:
struts
org.apache.struts.action.actionservlet
config
/web-inf/struts-config.xml
debug
2detail22
在webcontent目錄下建立index.jsp,以方便後面的測試。
4. 在webcontent/web-inf目錄下建立struts-config.xml:
5. 在web server上執行,檢視控制台是否顯示正常啟動,並開啟瀏覽器訪問http://localhost:8080/encryption (埠號在web server裡面配置)。
6. 新建乙個action:
7. 在struts-config.xml加入action的配置:
在/web-inf/pages/cipher下新建list.jsp。
8. 瀏覽器輸入http://localhost:8080/encryption/list.do,看是否正確跳轉到list.jsp頁面。
struts1中配置應用
列表收集id集合時,在formbean中放乙個string selectflag 陣列,這時提交時formbean會自動收集 function deleteuser if flag if window.confirm 確認刪除嗎?直接將值放到request中,前台用el或標籤顯示出來 beanuti...
struts1中配置應用
列表收集id集合時,在formbean中放乙個string selectflag 陣列,這時提交時formbean會自動收集 function deleteuser if flag if window.confirm 確認刪除嗎?直接將值放到request中,前台用el或標籤顯示出來 beanuti...
學習struts1(配置檔案)
最近在用struts1與oracle資料庫一起做東西,在工作中發現自己原來還是乙個菜鳥,有許多東西還要去學,邊學邊用,一步一步往前走呀,不多說了,今天總結了struts1的核心配置檔案 struts config.xml。我也是在學習總結,有什麼說的不對的地方,還希望大家給我指出來呀。action類...