-
Struts是什么? Struts是流行和成熟的基于MVC設(shè)計模式的Web應(yīng)用程序框架。 Struts的目的: 為了幫助我們減少在運用MVC設(shè)計模型來開發(fā)Web應(yīng)用的時間。查看全部
-
Struts是什么查看全部
-
struts查看全部
-
MVC模式查看全部
-
全局結(jié)果: 將<result/>作為<global-result/>元素的子元素配置。 局部結(jié)果: 將<result/>作為<action/>元素的子元素配置。查看全部
-
1,使用Action的屬性接收參數(shù), 在Action類中定義需要接收的屬性,并寫它的setter/getter方法。查看全部
-
(2)使用Domain Model接收參數(shù) <form action="LoginAction.action" method="post"> 用戶名:<input type="text" name="user.username" /> 密碼:<input type="password" name="user.password" /> <input type="" value="提交" /> </form> =================================== 在action類中定義屬性 private User user; 并編寫setter/getter方法。查看全部
-
三種訪問servlet api查看全部
-
(2)使用Domain Model接收參數(shù)查看全部
-
Struts2的后綴, 設(shè)置url中action后綴:struts.xml中配置 <constant name="strust.action.extension" value="html"></constant> 還可以在struts.properties和web.xml中進(jìn)行配置。查看全部
-
Struts2自動提示錯誤: 在action中,if(){this.addFieldError("username","用戶名不能為空"),return INPUT} 在jsp中引用標(biāo)簽,<%@ taglib prefix="s" uri="/struts-tags"%> <s:fielderror name="username"></s:fielderror> 也可以重寫validate方法寫入if(){this.addFieldError("username","用戶名不能為空")}自動input查看全部
-
Struts2的后綴 有3處可以設(shè)置 struts.xml(constant標(biāo)簽 name="strust.action.extension" value="**") 、struts.properties (strust.action.extension=**) 、web.xml(struts過濾器初始參數(shù)strust.action.extension 參數(shù)值**) **表示后綴值多個可以用英文逗號分開。查看全部
-
struts2動態(tài)調(diào)用方法 1、在action中指定method 2、使用感嘆號,需開啟識別,不推薦 3、通配符*號使用查看全部
-
struts.properties struts2框架的全局屬性文件,自動加載 該文件包含很多key-value對 該文件完全可以配置在struts.xml文件中,使用constant元素查看全部
-
4-8 接受參數(shù) 經(jīng)常使用以下3種方式: (1)使用Action的屬性接收參數(shù) (2)使用Domain Model接收參數(shù) (3)使用ModelDriven接收參數(shù)。如果需要實現(xiàn)ModelDriven接口的話,去掉get、set方法,同時實例化user對象查看全部
舉報
0/150
提交
取消