原创 動態結果集
動態結果集:一定不要忘了爲動態結果的保存值設置set get方法<result>${r}</result><!-- $表示用來從值棧中取值,${r}從
原创 struts2簡述
1、 struts2運行機制:client交給tomcat參考配置文件web.xml,找到對應的struts2filter,struts2filter
原创 時間處理
1、 what is UTC/UT/GMT? 世界標準時間2、 how to get the current time ? Date、Calend
原创 參數接收
//JSP文件1、用action屬性接收參數:使用action屬性接收參數<a href="user/user!add?name=a&age=8">添加用戶</a>//struts.xml配置<package name="user" ex
原创 動態方法調用
//JSP文件1、ActionMethod_DMI_動態方法調用:Action執行的時候並不一定要執行execute方法,1)可以在配置文件中配置Action的時候用method=來指定執行哪個方法——<a href="<%=contex
原创 模塊包含、默認action
1、 模塊包含:<include file="login.xml" />,可以分多個模塊獨立完成,避免衝突//struts.xml<constant
原创 通配符
//JSP文件通配符(Wildcard):使用通配符,將配置量降到最低<br /><a href="<%=context %>/actions/Studentadd">添加學生</a><a href="<%=context %>/acti
原创 簡單數據校驗
簡單數據校驗:使用addFieldError方法和s:fieldError標籤簡單處理數據校驗<a href="user/user!add?name=
原创 struts標籤
//index.jsp訪問屬性<a href="tags?username=u&password=p">tags</a>//tags.jsp<ol><!-- 通用標籤property,set,bean,include, --> <li
原创 訪問web元素(?)
訪問web元素:取得Map類型request,session,application,真實類型 HttpServletRequest, HttpSes
原创 結果類型(result_type)
結果類型(result_type):默認爲dispatcher,運用服務器跳轉,跳轉到結果頁面, redirect 跳轉到視圖(JSP) 、chain
原创 主題(theme)
//index.jsptheme測試<a href="theme.action">go</a>//theme.jsp在struts.xml中控制theme,默認爲xhtml,可以設置爲:simple/css_html/ajax <br/
原创 向結果傳參數
向結果傳參數:只有redirect跳轉方式才需要從action向JSP傳參數,<result type="redirect">/user_add_su
原创 自定義攔截器
//struts.xml<constant name="struts.i18n.encoding" value="GBK" /> <!-- internationalization --> <package name="test" nam
原创 控制重複提交
//index.jsp<form action="user" method="post"> name: <input name="name"> age: <input name="age"> <input type="