锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产主播福利在线,日韩高清av一区二区三区,美女国产精品久久久 http://www.aygfsteel.com/jikey/category/45068.htmlJAVA浜ゆ祦錛?8611691 zh-cn Sun, 25 Jul 2010 06:05:58 GMT Sun, 25 Jul 2010 06:05:58 GMT 60 鍏充簬s2sh婧愪唬鐮佷笅杞?/title> http://www.aygfsteel.com/jikey/archive/2010/07/24/327023.html璞儏 璞儏 Sat, 24 Jul 2010 10:05:00 GMT http://www.aygfsteel.com/jikey/archive/2010/07/24/327023.html http://www.aygfsteel.com/jikey/comments/327023.html http://www.aygfsteel.com/jikey/archive/2010/07/24/327023.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/327023.html http://www.aygfsteel.com/jikey/services/trackbacks/327023.html
http://release.opensymphony.com/xwork/2.1.6/
struts 2.1.8
http://struts.apache.org/download.cgi#struts2181
spring 3.0.3
http://www.springsource.org/download
hibernate
http://sourceforge.net/projects/hibernate/files/
itatis 3v
http://ibatis.apache.org/java.cgi
]]> struts 2.1.6 瓚呯駭澶т貢鐮?StrutsPrepareAndExecuteFilter瀛︿範絎旇 http://www.aygfsteel.com/jikey/archive/2010/07/22/326885.html璞儏 璞儏 Thu, 22 Jul 2010 15:45:00 GMT http://www.aygfsteel.com/jikey/archive/2010/07/22/326885.html http://www.aygfsteel.com/jikey/comments/326885.html http://www.aygfsteel.com/jikey/archive/2010/07/22/326885.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/326885.html http://www.aygfsteel.com/jikey/services/trackbacks/326885.html package org.apache.struts2.dispatcher.ng.filter;
import
org.apache.struts2.StrutsStatics;
import
org.apache.struts2.dispatcher.Dispatcher;
import
org.apache.struts2.dispatcher.ng.PrepareOperations;
import
org.apache.struts2.dispatcher.ng.ExecuteOperations;
import
org.apache.struts2.dispatcher.ng.InitOperations;
import
org.apache.struts2.dispatcher.mapper.ActionMapping;
import
javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Handles both the preparation and execution phases of the
Struts dispatching process. This filter is better to use
* when you don't
have another filter that needs access to action context information, such as
Sitemesh.
*/
public class StrutsPrepareAndExecuteFilter implements
StrutsStatics, Filter {
private PrepareOperations prepare;
private ExecuteOperations execute;
//鍒濆鍖栬繃婊ゅ櫒
public void init(FilterConfig
filterConfig) throws ServletException {
InitOperations init = new
InitOperations(); //鍒濆鍖栬緟鍔╁璞★紝灝佽浜嗗垵濮嬪寲鐨勪竴浜涙搷浣?br />
try {
FilterHostConfig config = new
FilterHostConfig(filterConfig); //瀵筬ilterConfig榪涜灝佽
init.initLogging(config); //閫氳繃config,鍒濆鍖栧唴閮⊿truts鐨勮褰?/span>
Dispatcher dispatcher = init.initDispatcher(config); //閫氳繃config,鍒涘緩騫跺垵濮嬪寲dispatcher
init.initStaticContentLoader(config,
dispatcher); //閫氳繃config鍜宒ispatcher錛屽垵濮嬪寲涓庤繃婊ゅ櫒鐩稿叧鐨勯潤鎬佸唴瀹瑰姞杞藉櫒
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
//閫氳繃config鍜宒ispatcher,鍒涘緩request琚鐞嗗墠鐨勭郴鍒楁搷浣滃璞?/span>
execute = new ExecuteOperations(filterConfig.getServletContext(),
dispatcher);//閫氳繃config鍜宒ispatcher,鍒涘緩澶勭悊request鐨勭郴鍒楁搷浣滃璞?/span>
} finally {
init.cleanup(); //娓呯┖ActionContext
}
}
public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
prepare.createActionContext(request, response); //鍒涘緩ACTIONCONTEXT,騫跺垵濮嬪寲Theadlocal
prepare.assignDispatcherToThread();
//鎸囨淳dispatcher緇橳headlocal
prepare.setEncodingAndLocale(request, response); //璁劇疆request鐨勭紪鐮佸拰LOCAL
request =
prepare.wrapRequest(request); //灝佽request
ActionMapping mapping =
prepare.findActionMapping(request, response); //鏌ユ壘騫墮夋嫨鍒涘緩ActionMapping
if (mapping
== null) { //濡傛灉鏄犲皠涓嶅瓨鍦?/span>
boolean handled = execute.executeStaticResourceRequest(request, response); // 璇曞浘鎵ц涓涓潤鎬佽祫婧愮殑璇鋒眰
if (!handled) {
chain.doFilter(request, response);
}
} else { //濡傛灉瀛樺湪鏄犲皠
execute.executeAction(request, response, mapping); //鎵цaction
}
} finally
{
prepare.cleanupRequest(request); //娓呴櫎request鐨凾hreadlocal
}
}
public void destroy() {
prepare.cleanupDispatcher();
}
}
鏉ヨ嚜浜庯細http://qianjian21.javaeye.com/blog/480206
鏈鍚庝笉寰椾笉涓嬭澆鏂扮増鐨剆truts 瑙e喅榪欎釜闂
]]>String 2.0 request seesion application http://www.aygfsteel.com/jikey/archive/2010/05/24/321774.html璞儏 璞儏 Mon, 24 May 2010 15:33:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/24/321774.html http://www.aygfsteel.com/jikey/comments/321774.html http://www.aygfsteel.com/jikey/archive/2010/05/24/321774.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321774.html http://www.aygfsteel.com/jikey/services/trackbacks/321774.html ActionContext context = ActionContext.getContext();
Map request = (Map)context.get( " request " );
Map session = context.getSession();
Map application = context.getApplication();
request.put( " s " , str);
request.put( " map " , map);
request.put( " greeting " , " 嬈㈣繋璁塊棶jikey鐨凚log " );
]]>struts2.0 el涓嶈搗浣滅敤 http://www.aygfsteel.com/jikey/archive/2010/05/24/321734.html璞儏 璞儏 Mon, 24 May 2010 07:31:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/24/321734.html http://www.aygfsteel.com/jikey/comments/321734.html http://www.aygfsteel.com/jikey/archive/2010/05/24/321734.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321734.html http://www.aygfsteel.com/jikey/services/trackbacks/321734.html 1 .璁劇疆鏁翠釜欏圭洰浣跨敤el琛ㄨ揪寮忥紝闇瑕佸湪web.xml涓姞涓?nbsp;錛堟帶鍒朵竴涓」鐩級
< jsp - config >
< jsp - property - group >
< el - ignored > false < / el - ignored >
< / jsp - property - group >
< / jsp - config >
2 .璁劇疆鏌愪釜jsp欏甸潰浣跨敤el琛ㄨ揪寮忥紝闇瑕佸湪jsp欏甸潰鍔犱笂錛堟帶鍒跺崟涓〉闈級
<% @ page isELIgnored = " false " %>
3 .鐪嬩綘鐨剋eb.xml鏂囦歡涓ご鐨勫紩鐢ㄥ簲璇ユ槸 2.4 .xsd
${requestScope.hello}
sdf
灝咼SP欏甸潰涓殑 <% @ taglib uri = " http://java.sun.com/jstl/core " prefix = " c " %> 鏀逛負 <% @ taglib uri = http: // java.sun.com/jstl/core_rt prefix="c"%>鍗沖彲銆?/span>
鍙戠幇涓涓猠l琛ㄨ揪寮忓湪JSP2.0涓笉璧蜂綔鐢ㄧ殑闂銆傚弽澶嶈皟璇曞嬈★紝鍙戠幇鏄痺eb.xml涓嚭浜嗛棶棰樸傜寽嫻嬫槸鐗堟湰鐨勯棶棰橈紝浣嗗彧鐭ラ亾浜嗗浣曚慨鏀癸紝涓嶇煡閬撲負浠涔堥偅鏍蜂慨鏀廣?br />
web.xml
<? xml version="1.0" encoding="ISO-8859-1" ?>
< web-app xmlns ="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4" >
2.4鐗堟湰榛樿鍚敤el琛ㄨ揪寮忥紝濡傛灉浣跨敤2.5鐗堟湰錛岄粯璁l琛ㄨ揪寮忔槸鍏抽棴鐨?br />
<? xml version="1.0" encoding="UTF-8" ?>
< web-app xmlns ="http://java.sun.com/xml/ns/javaee"
xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" version ="2.5"
xsi:schemaLocation ="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
閭d箞瀵瑰簲2.5鐨剋eb.xml --> jsp欏甸潰閲屽簲璇ュ鍔?/span><% @ page isELIgnored = " false " %>
鍙戠幇鍘熷洜錛氫竴鍙ヨ瘽錛屽嚒鏄儴緗叉弿榪版枃浠墮伒寰猄ervlet2.4瑙勮寖鐨刉EB搴旂敤錛孍L琛ㄨ揪寮忕殑璁$畻榛樿鏄惎鐢ㄧ殑錛岃屾湭閬靛驚鐨勶紝鍒橢L琛ㄨ揪寮忕殑璁$畻榛樿鏄鐢ㄧ殑銆?br />
鎵浠ヨВ鍐蟲柟妗堣繕鍙互鏄細灝唚eb.xml涓殑DTD(鏂囨。綾誨瀷瀹氫箟)鏀歸棶2.4鐨勭増鏈?
]]>Struts2 瀛︿範絎旇9--Struts-Tags--i18n http://www.aygfsteel.com/jikey/archive/2010/05/21/321587.html璞儏 璞儏 Fri, 21 May 2010 15:51:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321587.html http://www.aygfsteel.com/jikey/comments/321587.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321587.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321587.html http://www.aygfsteel.com/jikey/services/trackbacks/321587.html
< span style ="color: rgb(0, 128, 0);" >< li > property: < s:property value ="username" /> </ li >
< li > property 鍙栧間負瀛楃涓? < s:property value ="'username'" /> </ li >
< li > property 璁懼畾榛樿鍊? < s:property value ="admin" default ="綆$悊鍛? /> </ li >
< li > property 璁懼畾HTML: < s:property value ="'<hr/>'" escape ="false" /> </ li >
< hr />
< li > set 璁懼畾adminName鍊鹼紙榛樿涓?nbsp;request 鍜?nbsp;ActionContext錛? < s:set var ="adminName" value ="username"
/></ li >
< li > set 浠巖equest鍙栧? < s:property value ="#request.adminName" /></ li >
< li > set 浠嶢ctionContext鍙栧? < s:property value ="#adminName" /></ li >
<% --< li > set 璁懼畾鑼冨洿: < s: set name = " adminPassword " value = " password " scope = " page " /></ li >
< li > set 浠庣浉搴旇寖鍥村彇鍊? < % = pageContext.getAttribute( " adminPassword " ) %> </ li >
--%>
< li > set 璁懼畾var錛岃寖鍥翠負ActionContext: < s:set var ="adminPassword" value ="password"
scope="session" /></ li >
< li > set 浣跨敤#鍙栧? < s:property value ="#adminPassword" /> </ li >
< li > set 浠庣浉搴旇寖鍥村彇鍊? < s:property value ="#session.adminPassword" /> </ li >
< hr />
<% --< li > push: < s: set name = " myDog " value = " new com.bjsxt.struts2.ognl.Dog('oudy') " ></ s: set ></ li >
< li >
push:< s:push value = " #myDog " >
< s: property value = " name " />
</ s:push >
</ li >
< li > push: < s: property value = " name " /></ li >
-- %>
< hr />
< li > bean 瀹氫箟bean,騫朵嬌鐢?nbsp;param鏉ヨ瀹氭柊鐨勫睘鎬у?
< s:bean name ="com.bjsxt.struts2.tags.Dog" >
< s:param name ="name" value ="'pp'" ></ s:param >
< s:property value ="name" />
</ s:bean >
</ li >
< li > bean 鏌ョ湅debug鎯呭喌:
< s:bean name ="com.bjsxt.struts2.tags.Dog" var ="myDog" >
< s:param name ="name" value ="'oudy'" ></ s:param >
</ s:bean >
鎷垮嚭鍊鹼細
< s:property value ="#myDog.name" />
</ li >
< hr />
< li > include _include1.html 鍖呭惈闈欐佽嫳鏂囨枃浠?br />
< s:include value ="/_include1.html" ></ s:include >
</ li >
< li > include _include2.html 鍖呭惈闈欐佷腑鏂囨枃浠?br />
< s:include value ="/_include2.html" ></ s:include >
</ li >
< li > include _include1.html 鍖呭惈闈欐佽嫳鏂囨枃浠訛紝璇存槑%鐢ㄦ硶
< s:set var ="incPage" value ="%{'/_include1.html'}" />
< s:include value ="%{#incPage}" ></ s:include >
</ li >
< hr />
< li > if elseif else:
age = < s:property value ="#parameters.age[0]" /> < br />
< s:set var ="age" value ="#parameters.age[0]" />
< s:if test ="#age < 0" > wrong age! </ s:if >
< s:elseif test ="#parameters.age[0] < 20" > too young! </ s:elseif >
< s:else > yeah! </ s:else >< br />
< s:if test ="#parameters.aaa == null" > null </ s:if >
</ li >
< hr />
< li > 閬嶅巻闆嗗悎錛?/span>< br />
< s:iterator value ="{1, 2, 3}" >
< s:property /> |
</ s:iterator >
</ li >
< li > 鑷畾涔夊彉閲忥細 < br />
< s:iterator value ="{'aaa', 'bbb', 'ccc'}" var ="x" >
< s:property value ="#x.toUpperCase()" /> |
</ s:iterator >
</ li >
< li > 浣跨敤status: < br />
< s:iterator value ="{'aaa', 'bbb', 'ccc'}" status ="status" >
< s:property /> |
閬嶅巻榪囩殑鍏冪礌鎬繪暟錛?/span>< s:property value ="#status.count" /> |
閬嶅巻榪囩殑鍏冪礌绱㈠紩錛?/span>< s:property value ="#status.index" /> |
褰撳墠鏄伓鏁幫紵錛?/span>< s:property value ="#status.even" /> |
褰撳墠鏄鏁幫紵錛?/span>< s:property value ="#status.odd" /> |
鏄涓涓厓绱犲悧錛燂細 < s:property value ="#status.first" /> |
鏄渶鍚庝竴涓厓绱犲悧錛燂細 < s:property value ="#status.last" />
< br />
</ s:iterator >
</ li >
< li >
< s:iterator value ="#{1:'a', 2:'b', 3:'c'}" >
< s:property value ="key" /> | < s:property value ="value" /> < br />
</ s:iterator >
</ li >
< li >
< s:iterator value ="#{1:'a', 2:'b', 3:'c'}" var ="x" >
< s:property value ="#x.key" /> | < s:property value ="#x.value" /> < br />
</ s:iterator >
</ li >
< li >
< s:fielderror fieldName ="fielderror.test" theme ="simple" ></ s:fielderror >
</ li ></ span >
]]> struts2 鏍囩鐨勪嬌鐢ㄤ箣浜?s:iterator(淇) http://www.aygfsteel.com/jikey/archive/2010/05/21/321586.html璞儏 璞儏 Fri, 21 May 2010 15:49:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321586.html http://www.aygfsteel.com/jikey/comments/321586.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321586.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321586.html http://www.aygfsteel.com/jikey/services/trackbacks/321586.html
struts2鐨剆錛歩terator 鍙互閬嶅巻 鏁版嵁鏍堥噷闈㈢殑浠諱綍鏁扮粍錛岄泦鍚堢瓑絳?nbsp;浠ヤ笅鍑犱釜綆鍗曠殑demo錛?br />
s:iterator 鏍囩鏈?涓睘鎬э細
value錛氳榪唬鐨勯泦鍚?br />
id 錛氭寚瀹氶泦鍚堥噷闈㈢殑鍏冪礌鐨刬d
status 榪唬鍏冪礌鐨勭儲寮?br />
1:jsp欏甸潰瀹氫箟鍏冪礌鍐欐硶 鏁扮粍鎴杔ist
1. < s:iterator value ="{'1','2','3','4','5'}" id ='number' >
2. < s:property value ='number' /> A
3. </ s:iterator >
鎵撳嵃緇撴灉涓? 1A2A3A4A5A
涓婇潰鐨勬柟娉曟垜鍦╦sp鏂囦歡閲屾墽琛屾病鏈夋垚鍔?榪欐槸鍙︿竴縐嶅啓娉曪細
<%
List list = new ArrayList();
list.add( " Max " );
list.add( " Michael " );
list.add( " Scott " );
list.add( " Jeffry " );
list.add( " Joe " );
request.setAttribute( " names " , list);
%>
< h3 > Names: </ h3 >
<!--
1銆佹澶勭殑絀簆roperty 鍏冪礌鐢ㄤ簬鑾峰緱褰撳墠iterator鐨勫?br />
2銆乻tatus琚鎴恠tuts錛屽湪 iterator鐨勯噷闈㈠氨鍙互閫氳繃#stuts鍙栧緱 IteratorStatus鐨勫璞°侷teratorStatus綾誨寘鍚綋鍓嶅簭鍙蜂俊鎭紝
濡傛槸鍚︾涓涓垨鏈鍚庝竴涓紝鏄惁涓哄鏁板簭鍙楓傝繖浜涗俊鎭湪鎴戜滑鍋氭牸寮忓寲鐨勬椂鍊欙紝鏄懼緱闈炲父鏈夌敤銆?br />
-->
< ol >
< s:iterator value ="#request.names" status ="stuts" >
< s:if test ="#stuts.odd == true" >
< li > White < s:property /></ li >
</ s:if >
< s:else >
< li style ="background-color:blue" >< s:property /></ li >
</ s:else >
</ s:iterator >
</ ol >
2: 绱㈠紩鐨勭敤娉?br />
濡傛灉鎸囧畾浜唖tatus錛屾瘡嬈$殑榪唬鏁版嵁閮芥湁IteratorStatus鐨勫疄渚嬶紝瀹冩湁浠ヤ笅鍑犱釜鏂規硶
int getCount()榪斿洖褰撳墠榪唬浜嗗嚑涓厓绱?br />
int getIndex()榪斿洖褰撳墠鍏冪礌绱㈠紩
boolean isEven()褰撶劧鐨勭儲寮曟槸鍚﹀伓鏁?br />
boolean isFirst()褰撳墠鏄惁絎竴涓厓绱?br />
boolean isLast()
boolean isOdd() 褰撳墠鍏冪礌绱㈠紩鏄惁濂囨暟
1. < s:iterator value ="{'a','b','c'}" id ='char' status ='st' >
2. < s:if test ="#st.Even" >
3. 鐜板湪鐨勭儲寮曟槸濂囨暟涓?< s:property value ='#st.index' />
4. </ s:if >
5. 褰撳墠鍏冪礌鍊鹼細< s:property value ='char' />
6. </ s:iterator >
3錛氶亶鍘唌ap
value鍙互鐩存帴瀹氫箟涓猴細
1. value="#{"1":"a","2":"b"}"
姣忎釜鍏冪礌浠ラ兘濂介殧寮銆傚厓绱犱箣闂寸殑key鍜寁alue 鍐掑彿闅斿紑
value 涔熷彲浠ユ槸鏁版嵁鏍堥噷闈㈢殑java.util.Map瀵硅薄
閬嶅巻鍐欐硶濡備笅錛?br />
1. < s:iterator value ="map" id ="id" status ="st" >
2. key : < s:property value ='key' />
3. value:< s:property vlaue ='value' />
4. </ s:iterator >
褰撶劧key 鍜寁alue 閮藉彲浠ヤ嬌java 鐨?nbsp;Object
3錛氶亶鍘嗘暟鎹爤.綆鍗曠殑List綾伙紝
List< Attr >
class Attr{String attrName;String getAttrName(){return "123";}}
1. < s:iterator value ="label" id ="id" >
2. < s:property value ="#id.attrName" />
3. </ s:iterator >
褰撶劧 value 榪樺彲浠ュ啓鎴?nbsp;value="%{label}" label 鍙互鏈?鎿嶄綔
label鐨勫睘鎬ist 鍙互鍐欐垚value="%{label.list}" 鐩稿綋浜庯細getLabel().getList();
4錛氶亶鍘?涓猯ist錛?br />
List< AttrName > attrN {color,size,style}
List < AttrValue > attrV {red,20,gay}
榪?涓?nbsp;list鐨勫厓绱犳槸涓涓瀵瑰簲鐨勶紝涓涓猘ttrN瀵瑰簲涓涓猘ttrV
1. < s:iterator value ="%{attrN }" id ="id" status ="status" >
2. index is : < s:property value ='status.index' />
3. attrName is : < s:property value ='id' /> or < s:property value ='%{id}' />
4. attrName is : < s:property value ='%{attrV[#status.index]}' />
5. </ s:iterator >
]]> struts2 涓璗he Struts dispatcher cannot be found鎶ラ敊瑙e喅鍔炴硶 http://www.aygfsteel.com/jikey/archive/2010/05/21/321585.html璞儏 璞儏 Fri, 21 May 2010 15:47:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321585.html http://www.aygfsteel.com/jikey/comments/321585.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321585.html#Feedback 1 http://www.aygfsteel.com/jikey/comments/commentRss/321585.html http://www.aygfsteel.com/jikey/services/trackbacks/321585.html < filter-mapping >
< filter-name > struts2 </ filter-name >
< url-pattern > *.jsp </ url-pattern >
</ filter-mapping >
]]>Struts 閰嶇疆鏂囦歡涓璸ackage瑙i噴 http://www.aygfsteel.com/jikey/archive/2010/05/21/321584.html璞儏 璞儏 Fri, 21 May 2010 15:43:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321584.html http://www.aygfsteel.com/jikey/comments/321584.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321584.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321584.html http://www.aygfsteel.com/jikey/services/trackbacks/321584.html < package name ="tutorial" extends ="struts-default" >
< action name ="HelloWorld" class ="tutorial.HelloWorld" >
< result > HelloWorld.jsp </ result >
</ action >
</ package >
1銆佸寘鍚嶏細tutorial錛?br />
2銆佽鍖呯戶鎵夸簡鐖跺寘“struts- default”錛?br />
3銆佽鍖呮湁涓涓狝ction綾伙細tutorial.HelloWorld錛屽叾鍚嶇О涓?#8220;HelloWorld”錛屽叾杞悜鐨勮鍥句負錛欻elloWorld.jsp
]]>struts2 涓殑constant http://www.aygfsteel.com/jikey/archive/2010/05/21/321583.html璞儏 璞儏 Fri, 21 May 2010 15:35:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321583.html http://www.aygfsteel.com/jikey/comments/321583.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321583.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321583.html http://www.aygfsteel.com/jikey/services/trackbacks/321583.html <!-- 鎸囧畾Web搴旂敤鐨勯粯璁ょ紪鐮侀泦錛岀浉褰撲簬璋冪敤 HttpServletRequest鐨?nbsp;setCharacterEncoding鏂規硶 -->
< constant name ="struts.i18n.encoding" value ="UTF-8" />
<!--
璇ュ睘鎬ф寚瀹氶渶瑕丼truts 2澶勭悊鐨勮姹傚悗緙錛岃灞炴х殑榛樿鍊兼槸action錛屽嵆鎵鏈夊尮閰?.action鐨勮姹傞兘鐢盨truts 2澶勭悊銆?nbsp;
濡傛灉鐢ㄦ埛闇瑕佹寚瀹氬涓姹傚悗緙錛屽垯澶氫釜鍚庣紑涔嬮棿浠ヨ嫳鏂囬楀彿錛堬紝錛夐殧寮銆?nbsp;
-->
< constant name ="struts.action.extension" value ="do" />
<!-- 璁劇疆嫻忚鍣ㄦ槸鍚︾紦瀛橀潤鎬佸唴瀹癸紝榛樿鍊間負true錛堢敓浜х幆澧冧笅浣跨敤錛夛紝寮鍙戦樁孌墊渶濂藉叧闂?nbsp; -->
< constant name ="struts.serve.static.browserCache " value ="false" />
<!-- 褰?nbsp;struts鐨勯厤緗枃浠朵慨鏀瑰悗錛岀郴緇熸槸鍚﹁嚜鍔ㄩ噸鏂板姞杞借鏂囦歡錛岄粯璁ゅ間負false錛堢敓浜х幆澧冧笅浣跨敤錛夛紝寮鍙戦樁孌墊渶濂芥墦寮 -->
< constant name ="struts.configuration.xml.reload" value ="true" />
<!-- 寮鍙戞ā寮忎笅浣跨敤錛岃繖鏍峰彲浠ユ墦鍗板嚭鏇磋緇嗙殑閿欒淇℃伅 -->
< constant name ="struts.devMode" value ="true" />
<!-- 榛樿鐨勮鍥句富棰?nbsp; -->
< constant name ="struts.ui.theme" value ="simple" />
<!-- 璇ュ睘鎬ф寚瀹歋truts 2涓殑action鐢盨pring瀹瑰櫒鍒涘緩 -->
< constant name ="struts.objectFactory" value ="spring" />
鏉ヨ嚜浜庯細http://wing123.javaeye.com/blog/352596
]]>Struts2 瀛︿範絎旇9--Struts-Tags--i18n http://www.aygfsteel.com/jikey/archive/2010/05/21/321579.html璞儏 璞儏 Fri, 21 May 2010 14:56:00 GMT http://www.aygfsteel.com/jikey/archive/2010/05/21/321579.html http://www.aygfsteel.com/jikey/comments/321579.html http://www.aygfsteel.com/jikey/archive/2010/05/21/321579.html#Feedback 0 http://www.aygfsteel.com/jikey/comments/commentRss/321579.html http://www.aygfsteel.com/jikey/services/trackbacks/321579.html 鏉ヨ嚜浜庯細http://shaxianwei.javaeye.com/blog/650902
< span style = " color: rgb(0, 128, 0); " >< li > property: < s:property value = " username " /> </ li >
< li > property 鍙栧間負瀛楃涓? < s:property value = " 'username' " /> </ li >
< li > property 璁懼畾榛樿鍊? < s:property value = " admin " default = " 綆$悊鍛?/span>" /> </ li >
< li > property 璁懼畾HTML: < s:property value = " '<hr/>' " escape = " false " /> </ li >
< hr />
< li > set 璁懼畾adminName鍊鹼紙榛樿涓簉equest 鍜?nbsp;ActionContext錛? < s:set var = " adminName " value = " username "
/></ li >
< li > set 浠巖equest鍙栧? < s:property value = " #request.adminName " /></ li >
< li > set 浠嶢ctionContext鍙栧? < s:property value = " #adminName " /></ li >
<%--< li > set 璁懼畾鑼冨洿: < s:set name = " adminPassword " value = " password " scope = " page " /></ li >
< li > set 浠庣浉搴旇寖鍥村彇鍊? <%= pageContext.getAttribute( " adminPassword " ) %></ li >
--%>
< li > set 璁懼畾var錛岃寖鍥翠負ActionContext: < s:set var = " adminPassword " value = " password "
scope= " session " /></ li >
< li > set 浣跨敤#鍙栧? < s:property value = " #adminPassword " /> </ li >
< li > set 浠庣浉搴旇寖鍥村彇鍊? < s:property value = " #session.adminPassword " /> </ li >
< hr />
<%--< li > push: < s:set name = " myDog " value = " new com.bjsxt.struts2.ognl.Dog('oudy') " ></ s:set ></ li >
< li >
push:< s:push value = " #myDog " >
< s:property value = " name " />
</ s:push >
</ li >
< li > push: < s:property value = " name " /></ li >
--%>
< hr />
< li > bean 瀹氫箟bean,騫朵嬌鐢╬aram鏉ヨ瀹氭柊鐨勫睘鎬у?
< s:bean name = " com.bjsxt.struts2.tags.Dog " >
< s:param name = " name " value = " 'pp' " ></ s:param >
< s:property value = " name " />
</ s:bean >
</ li >
< li > bean 鏌ョ湅debug鎯呭喌:
< s:bean name = " com.bjsxt.struts2.tags.Dog " var = " myDog " >
< s:param name = " name " value = " 'oudy' " ></ s:param >
</ s:bean >
鎷垮嚭鍊鹼細
< s:property value = " #myDog.name " />
</ li >
< hr />
< li > include _include1.html 鍖呭惈闈欐佽嫳鏂囨枃浠?br />
< s:include value = " /_include1.html " ></ s:include >
</ li >
< li > include _include2.html 鍖呭惈闈欐佷腑鏂囨枃浠?br />
< s:include value = " /_include2.html " ></ s:include >
</ li >
< li > include _include1.html 鍖呭惈闈欐佽嫳鏂囨枃浠訛紝璇存槑 % 鐢ㄦ硶
< s:set var = " incPage " value = " %{'/_include1.html'} " />
< s:include value = " %{#incPage} " ></ s:include >
</ li >
< hr />
< li > if elseif else :
age = < s:property value = " #parameters.age[0] " /> < br />
< s:set var = " age " value = " #parameters.age[0] " />
< s: if test = " #age < 0 " > wrong age !</ s: if >
< s:elseif test = " #parameters.age[0] < 20 " > too young !</ s:elseif >
< s: else > yeah !</ s: else >< br />
< s: if test = " #parameters.aaa == null " > null </ s: if >
</ li >
< hr />
< li > 閬嶅巻闆嗗悎錛?/span>< br />
< s:iterator value = " {1, 2, 3} " >
< s:property /> |
</ s:iterator >
</ li >
< li > 鑷畾涔夊彉閲忥細 < br />
< s:iterator value = " {'aaa', 'bbb', 'ccc'} " var = " x " >
< s:property value = " #x.toUpperCase() " /> |
</ s:iterator >
</ li >
< li > 浣跨敤status: < br />
< s:iterator value = " {'aaa', 'bbb', 'ccc'} " status = " status " >
< s:property /> |
閬嶅巻榪囩殑鍏冪礌鎬繪暟錛?/span>< s:property value = " #status.count " /> |
閬嶅巻榪囩殑鍏冪礌绱㈠紩錛?/span>< s:property value = " #status.index " /> |
褰撳墠鏄伓鏁幫紵錛?/span>< s:property value = " #status.even " /> |
褰撳墠鏄鏁幫紵錛?/span>< s:property value = " #status.odd " /> |
鏄涓涓厓绱犲悧錛燂細< s:property value = " #status.first " /> |
鏄渶鍚庝竴涓厓绱犲悧錛燂細< s:property value = " #status.last " />
< br />
</ s:iterator >
</ li >
< li >
< s:iterator value = " #{1:'a', 2:'b', 3:'c'} " >
< s:property value = " key " /> | < s:property value = " value " /> < br />
</ s:iterator >
</ li >
< li >
< s:iterator value = " #{1:'a', 2:'b', 3:'c'} " var = " x " >
< s:property value = " #x.key " /> | < s:property value = " #x.value " /> < br />
</ s:iterator >
</ li >
< li >
< s:fielderror fieldName = " fielderror.test " theme = " simple " ></ s:fielderror >
</ li ></ span >
]]>
主站蜘蛛池模板:
岳西县 |
东海县 |
海阳市 |
伽师县 |
云阳县 |
美姑县 |
敖汉旗 |
安溪县 |
宝山区 |
阳谷县 |
理塘县 |
弥勒县 |
镇巴县 |
阆中市 |
台中县 |
科技 |
囊谦县 |
册亨县 |
武汉市 |
漳平市 |
偏关县 |
隆子县 |
清丰县 |
海伦市 |
陆良县 |
德化县 |
油尖旺区 |
平塘县 |
安阳县 |
积石山 |
仙桃市 |
肃北 |
葫芦岛市 |
高平市 |
社旗县 |
内乡县 |
冷水江市 |
元谋县 |
乳源 |
阜平县 |
新竹市 |