-
stusts2 處理結(jié)果類型
查看全部 -
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
為什么我寫(xiě)了ng,Ctrl點(diǎn)擊不跳轉(zhuǎn)
查看全部 -
Action搜索順序
查看全部 -
struts訪問(wèn)Servlet API
查看全部 -
struts.xml
查看全部 -
web.xml
查看全部 -
Struts2工作原理
查看全部 -
Struts2的環(huán)境需求
查看全部 -
MVC模式
查看全部 -
struts是流行和成熟的基于MVC設(shè)計(jì)模式的WEB應(yīng)用程序框架
查看全部 -
@Struts2---定義與用途
Struts是什么?
????Struts是流行和成熟的基于MVC設(shè)計(jì)模式的Web應(yīng)用程序框架。
2.使用Struts的目的
????為了幫助我們減少在運(yùn)用MVC設(shè)計(jì)模型來(lái)開(kāi)發(fā)Web應(yīng)用時(shí)間。
查看全部 -
在add方法中添加
request.setAttribute("path","update");
在helloworld.xml中配置add對(duì)應(yīng)的action結(jié)果路徑
${request.path}
查看全部 -
動(dòng)態(tài)方法調(diào)用:動(dòng)態(tài)方法調(diào)用是為了解決一個(gè)Action對(duì)應(yīng)多個(gè)請(qǐng)求的處理,以免Action太多。 三種方式:指定method屬性、感嘆號(hào)方式、通配符 1:繁雜不建議用(struts2.xml指明那個(gè)action執(zhí)行那個(gè)method=add) <action?name="add"?method="add"?class="com.Action.hellowAction"> <action?name="update"?method="update"?class="com.Action.hellowAction"> 2:不建議用(!后接執(zhí)行方法) <constant?name="struts.enable.DynamicMethodInvocation"?value="true">????????????????????????????????????????????????</constant> <action?name="hellowword"?class="com.Action.hellowAction"> ??????<result?>/result.jsp</result> ??????<result?name="add">/add.jsp</result> ??????<result?name="update">/update.jsp</result> ??????</action> http://localhost:8080/struts_hellowworld/aaa/hellowworld!xxx.action http://localhost:8080/struts_hellowworld/aaa/hellowworld!add.action http://localhost:8080/struts_hellowworld/aaa/hellowworld!update.action 3:常用的動(dòng)態(tài)方法調(diào)用?(第一個(gè)*代表{1}第二個(gè)*={2}....) <constant?name="struts.enable.DynamicMethodInvocation"?value="false">????????????????????????????????????????????????</constant> <action?name="*_*"?method="{2}"?class="com.Action.{1}Action"> ??????<result?>/{2}.jsp</result> ??????<result?name="add">/{2}.jsp</result> ??????<result?name="update">/{2}.jsp</result> ??????</action> http://localhost:8080/struts_hellowworld/aaa/hellow_add.action http://localhost:8080/struts_hellowworld/aaa/hellow_update.action
查看全部 -
<!-- 訪問(wèn)的后綴發(fā)生變化
value="html"時(shí),訪問(wèn)的后綴就是hello_add.html
??value的值為空時(shí),訪問(wèn)就可以不加后綴 (不寫(xiě)這句話時(shí)也可以不加后綴名的訪問(wèn))-->
方式一:寫(xiě)在struts.xml?<constant ame="struts.action.extension" value="html"></constant>方式二:寫(xiě)在properties定義屬性里
struts.action.extension=action,do
方式三:在web.xml中的struts2過(guò)濾器中初始化參數(shù)
<
init-param
>
?
<
param-name
>struts.action.extension</
param-name
>
?
<
param-value
>do</
param-value
>
</
init-param
>
查看全部
舉報(bào)