<pao:FilterSelect id="jobExp.disTime_origin" name="jobExp.disTime_t" source="DataCode_4" filter="0" locale="#session['test.locale']" headerKey="0" headerValue=" 請選擇 "/>
更新成綠色部分
<pao:FilterSelect id="jobExp.disTime_origin" name="jobExp.disTime_t" source="DataCode_4" filter="{0}" locale="#session['test.locale']" headerKey="0" headerValue=" 請選擇 "/>
7.
然后就是 json
com.googlecode.jsonplugin.JSONUtil 需要替換 org.apache.struts2.json.JSONUtil
其他可參考官網
https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-UpdateDependencies
轉自:http://accpchf.iteye.com/blog/1128492
<html>
<head>
<meta http-equiv="refresh" content="5;url=<@s.url includeParams="none"/>"/>
</head>
<body>
Please wait while we process your request...
<p/>
This page will reload automatically and display your request when it is completed.
</body>
</html>
其中的includeParams參數取值為
none,不把參數參加到url參數中
all,是把get和post中的參數參加到url參數中
get,是只把get中的參數參加到url參數中
if ((!executeAfterValidationPass || secondTime) && bp == null) {
bp = getNewBackgroundProcess(name, actionInvocation, threadPriority);
session.put(KEY + name, bp);//放入session
performInitialDelay(bp); // first time let some time pass before showing wait page
secondTime = false;
}
if ((!executeAfterValidationPass || !secondTime) && bp != null && !bp.isDone()) {//是否完畢
actionInvocation.getStack().push(bp.getAction());//將后臺action的相關信息push到statck,時候的頁面可是使用
if (TokenHelper.getToken() != null) {
session.put(TokenHelper.getTokenName(), TokenHelper.getToken());
}
Map results = proxy.getConfig().getResults();
if (!results.containsKey(WAIT)) {//如果沒有配置wait,struts將為你inject一個
LOG.warn("ExecuteAndWait interceptor has detected that no result named 'wait' is available. " +
"Defaulting to a plain built-in wait page. It is highly recommend you " +
"provide an action-specific or global result named '" + WAIT +
"'.");
// no wait result? hmm -- let's try to do dynamically put it in for you!
//we used to add a fake "wait" result here, since the configuration is unmodifiable, that is no longer
//an option, see WW-3068
FreemarkerResult waitResult = new FreemarkerResult();
container.inject(waitResult);
waitResult.setLocation("/org/apache/struts2/interceptor/wait.ftl");
waitResult.execute(actionInvocation);
return Action.NONE;
}
return WAIT;
} else if ((!executeAfterValidationPass || !secondTime) && bp != null && bp.isDone()) {//如果執行完畢return bp.getResult();
session.remove(KEY + name);
actionInvocation.getStack().push(bp.getAction());
// if an exception occured during action execution, throw it here
if (bp.getException() != null) {
throw bp.getException();
}
return bp.getResult();
} else {
// this is the first instance of the interceptor and there is no existing action
// already run in the background, so let's just let this pass through. We assume
// the action invocation will be run in the background on the subsequent pass through
// this interceptor
return actionInvocation.invoke();
}
#、%和$符號在OGNL表達式中經常出現,而這三種符號也是開發者不容易掌握和理解的部分。在這里筆者簡單介紹它們的相應用途。
1.#符號的用途一般有三種。
1)訪問非根對象屬性,例如示例中的#session.msg表達式,由于Struts 2中值棧被視為根對象,所以訪問其他非根對象時,需要加#前綴。實際上,#相當于ActionContext. getContext();#session.msg表達式相當于ActionContext.getContext().getSession(). getAttribute(”msg”) 。
2)用于過濾和投影(projecting)集合,如示例中的persons.{?#this.age>20}。
3)用來構造Map,例如示例中的#{'foo1':'bar1','foo2':'bar2'}。
2.%符號
%符號的用途是在標志的屬性為字符串類型時,計算OGNL表達式的值。如下面的代碼所示:
構造Map
<s:set name="foobar" value="#{'foo1':'bar','foo2':'bar2'}" />
<p>The value of key "foo1" is <s:property value="#foobar['foo1']" /></p>
<p>不使用%:<s:url value="#foobar['foo1']" /></p>
<p>使用%:<s:url value="%{#foobar['foo1']}" /></p>
3.$符號
$符號主要有兩個方面的用途。
在國際化資源文件中,引用OGNL表達式,例如國際化資源文件中的代碼:reg.agerange=國際化資源信息:年齡必須在${min}同${max}之間。
在Struts 2框架的配置文件中引用OGNL表達式,例如下面的代碼片斷所示:
<validators>
<field name=”intb”>
<field-validator type=”int”>
<param name=”min”>10</param>
<param name=”max”>100</param>
<message>BAction-test校驗:數字必須為${min}為${max}之間!</message>
</field-validator>
</field>
</validators>
本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/pengyouchuan/archive/2009/01/05/3712933.aspx
又是一個很不錯的插件,使用方法也很簡單.
在你下載的struts\lib目錄下應該可以找到該插件struts2-config-browser-plugin
然后把該jar復制到你的工程目錄下:WEB-INF/lib下
然后,啟動你的項目
輸入:http://localhost:8008/你的發布工程名/config-browser/index.action
然后你就可以看到如下的統計:
1,iterator
<s:iterator id="obj" value="list" status="index">
<!---輸出當前元素的屬性-->
<s:property value="property"/>
<!---輸出當前迭代元素的索引-->
<s:property value="#index.index"/>
<!---輸出當前迭代了幾個元素-->
<s:property value="#index.count"/>
<!---返回當前迭代元素的索引是否為奇數-->
<s:property value="#index.odd"/>
<!---返回當前迭代元素的索引是否為偶數-->
<s:property value="#index.event"/>
<!---返回當前元素是否為第一個-->
<s:property value="#index.first"/>
<!---返回當前元素是否為最后一個-->
<s:property value="#index.last"/>
<!---返回當前元素下標-->
<s:property value="#index.getCount()" />
</s:iterator>