锘??xml version="1.0" encoding="utf-8" standalone="yes"?> Weblogic 10涓婮SP el涓巓gnl鐨勯棶棰樹笌瑙e喅鏂規(guī)硶 admin鍙戝竷浜?010-05-06 10:17 | 142嬈¢槄璇?/font> English Title:Weblogic 10 leaves the problem of JSP El and Ognl and means of settlement
2. 鍑忓皯浣跨敤Ognl琛ㄨ揪寮忥紝鏈濂戒嬌鐢‵reeMaker浠f浛JSP
3. 鍏抽棴logging鍜宒evMode
4. Struts.xml涓垹闄や笉闇瑕佺殑鎷︽埅鍣?
]]>
http://www.pjprimer.com/view-24083-1.html
鍦ㄤ嬌鐢╓ebwork鎴朣truts2鏍囩鍐橨SP鏃訛紝緇忓父浼?xì)鐢ㄥ埌濡備笅鍐欐硶锛?xì) <ww:radio name="gender" list='#{"1":"Male", "2":"FeMale"}' /> <ww:select name="yes" list='#{"1":"YES","2":"NO"}' /> 榪欐槸ognl鐨勫啓娉曪紝list閲岀殑琛ㄨ揪寮忓皢瑙i噴鎴愭垚涓涓狹ap錛屽疄闄呬笂鏄竴涓狶inkedHashMap銆?? 榪欑鍐欐硶鍦═omat涓嬮儴緗叉槸娌℃湁浠諱綍闂鐨勶紝浣嗛儴緗插埌Weblogic 10涓嬮棶棰樺氨鏉ヤ簡錛岃繖閲寃eb.xml鐨剉ersion澹版槑涓?.4錛岀紪璇慗SP鏃舵姤琛ㄨ揪寮忛敊璇傚鏋滃0鏄庝負(fù)2.3鏄笉浼?xì)鎶ラ敊鐨勫Q屽洜涓簊ervlet 2.3(鍗砵sp 1.2)鏄笉鏀寔EL鐨勶紝浣跨敤Weblogic 9鍚屾牱涔熶笉浼?xì)鎶ラ敊銆傛嵁姝ゅ彲浠ユ帹嫻嬪師鍥犱負(fù)緙栬瘧JSP鏃禬eblogic? JSP緙栬瘧鍣ㄥ皢OGNL鐨勮〃杈懼紡璇涓烘槸EL琛ㄨ揪寮忋?? ?瑙e喅鍔炴硶錛?1銆佺鐢‥L銆傚湪web.xml涓婂姞涓?<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <el-ignored>true</el-ignored> </jsp-property-group> </jsp-config> ?2銆佹洿鏀箇eb.xml鐨剉ersion涓?.3銆??3銆佸洜涓哄ぇ閲忛〉闈㈢敤鍒癊L錛屽${someValue}錛屾墍浠?鍜?鍩烘湰琛屼笉閫氱殑錛屾墍浠ヤ粠OGNL鐨勮〃杈懼紡鍏ユ墜錛屾渶緇堝啓鎴?list='#@java.util.LinkedHashMap@{"1":"Male","2":"FeMale"}'?, 鏄懼紡鎸囧畾浣跨敤LinkedHashMap鏉ユ瀯寤篗ap銆傞棶棰樿В鍐熾?br />
==========English==========
When use Webwork or Struts2 label write JSP, classics regular meeting uses a method: <ww:rAdio Name="gender" List='#{"1" :" Male" , "2" :" FeMale"}' /><ww:sElect Name="yes" List='#{"1" :" YES" , "2" :" NO"}' />This is Ognl write a law, the expression in List becomes the explanation a Map, it is a LinkedHashMap actually. ? This kind writes a law to issue deploy in Tomat do not have any problems, but deploy came to the problem below Weblogic 10, the Version statement of Web.xml is here 2.4, compile mistake of JSP times expression. If statement is 2.3 be to won't sign up for a fault, because of Servlet 2.3(namely Jsp 1.2) does not support EL, use Weblogic 9 also won't sign up for a fault likewise. Can you figure the reason is the Weblogic when compiling JSP accordingly? JSP is compiled implement consider as the expression of OGNL EL expression by accident. ? ? Settle way: 1, ban with EL. <jsp-config is added on Web.xml><jsp-property-group><url-pattern>*.jsp</url-pattern><el-ignored>true</el-ignored></jsp-property-group></jsp-config>? 2, the Version that changes Web.xml is 2.3. ? 3, use EL because of a large number of pages, be like ${someValue} , so 1 and 2 won't do basically, so the expression proceed with from OGNL, write finally into List='#@java.util.LinkedHashMap@{"1" :" Male" , "2" :" FeMale"}' ? , explicit appoint use LinkedHashMap to come compose builds Map. Ask the problem is solved.
]]>
]]>
1.涓涓獀alue stack鏈川涓婃槸涓涓狶ist;
2.鍦ㄦ爤涓皟鐢╗n]灝嗚繑鍥炰竴涓粠浣嶇疆n寮濮嬬殑瀛愭爤;
瀵逛簬2涓句釜渚嬪瓙璇存槑銆傚亣瀹歏alue Stack鍖呭惈浜哰model,action,others]錛岄偅涔?/p>
[0] --- 榪斿洖 [model,action,others]錛?
[1] --- 榪斿洖 [action,others]錛?
[2] --- 榪斿洖 [others];
鐜板湪灝嗗紑濮嬩粙緇峴:iterator鐨勪竴浜涗嬌鐢ㄣ備互涓嬩唬鐮佺墖孌靛潎鍦ㄥ紑鍙戠幆澧僥clipse3.4 wtp銆乼omcat5.5銆乯dk5涓婁嬌鐢╯truts2.1.6嫻嬭瘯閫氳繃銆?/p>
1) 銆佽闂?days
defined List<String> days ["Monday","Thursday","Friday","Sunday"]
view plaincopy to clipboardprint?
<s:iterator value="days"><s:property /></s:iterator>
<s:iterator value="days"><s:property /></s:iterator>
2) 銆佷嬌鐢?top 鍏抽敭瀛椾嬌鐢?榪囨護(hù)鎺塎onday)
defined List<String> days ["Monday","Thursday","Friday","Sunday"]
view plaincopy to clipboardprint?
<s:iterator value="days">
<s:if test="top!='Monday'">
<s:property />
</s:if>
</s:iterator>
<s:iterator value="days">
<s:if test="top!='Monday'">
<s:property />
</s:if>
</s:iterator>
top 鎸囦唬褰撳墠榪唬鍏冪礌錛屽彲浠ヤ負(fù)瀵硅薄錛?
榪欓噷鐨則op鍙敤[0].top鏇夸唬錛屼絾涓嶈兘浣跨敤[0]銆俒0]浠h〃鏁翠釜鏍堝璞°傚鏋滃崟綰皟鐢╗0]灝嗕細(xì)璋冪敤鍏秚oString()鏂規(guī)硶杈撳嚭瀵硅薄淇℃伅錛?/p>
3)銆佷嬌鐢?last / first 鍏抽敭瀛椾嬌鐢?/strong>
defined String[][] aTs = { { "涓", "浜?, "涓?, "鍥? },{ "涓涓", "浜屼簩", "涓変笁", "鍥涘洓"} };
view plaincopy to clipboardprint?
<!--閬嶅巻浜岀淮鏁扮粍錛孴he trick here is to use 'top' as the value for the inner iterator-->
<s:iterator value="aTs" status="of">
<s:if test="#of.last"><br/></s:if>
<s:iterator value="top">
<!--浜﹀彲鐢╗0].top鏇夸唬銆傚鏋滃崟綰敤[0],鍒欎細(xì)鍚屾椂鎵撳嵃璇ュ鏍堝璞′俊鎭?->
<s:property />
</s:iterator>
</s:iterator>
<!--閬嶅巻浜岀淮鏁扮粍錛孴he trick here is to use 'top' as the value for the inner iterator-->
<s:iterator value="aTs" status="of">
<s:if test="#of.last"><br/></s:if>
<s:iterator value="top">
<!--浜﹀彲鐢╗0].top鏇夸唬銆傚鏋滃崟綰敤[0],鍒欎細(xì)鍚屾椂鎵撳嵃璇ュ鏍堝璞′俊鎭?->
<s:property />
</s:iterator>
</s:iterator>
iterator 鏍囩涓殑status灞炴т唬琛ㄥ綋鍓嶈凱浠g殑浣嶇疆錛?
#of.last鐢ㄤ簬鍒ゆ柇褰撳墠鏄惁璺屽埌鐨勬渶鍚庝竴涓厓绱狅紱
last榪斿洖涓涓猙oolean綾誨瀷;
first 榪斿洖涓涓猙oolean綾誨瀷;
4)銆佷嬌鐢?odd / even 鍏抽敭瀛?/strong>
涓嬮潰鐨勪緥瀛愯瀹炵幇姣忚杈撳嚭棰滆壊涓嶅悓鐨勬晥鏋溿?/p>
defined List<String> days ["Monday","Thursday","Friday","Sunday"]
view plaincopy to clipboardprint?
<!--濂囨暟琛屾樉紺轟負(fù)綰㈣壊,鍋舵暟琛屾樉紺轟負(fù)緇胯壊-->
<s:iterator value="days" status="offset">
<s:else>
<s:if test="#offset.odd==true">
<li style="color: red" mce_style="color: red"><s:property /></li>
</s:if>
<s:else>
<li><s:property /></li>
</s:else>
</s:else>
</s:iterator>
<!--濂囨暟琛屾樉紺轟負(fù)綰㈣壊,鍋舵暟琛屾樉紺轟負(fù)緇胯壊-->
<s:iterator value="days" status="offset">
<s:else>
<s:if test="#offset.odd==true">
<li style="color: red" mce_style="color: red"><s:property /></li>
</s:if>
<s:else>
<li><s:property /></li>
</s:else>
</s:else>
</s:iterator>
odd鍏抽敭瀛楃敤鏉ュ垽鏂綋鍓嶈凱浠d綅緗槸鍚︿負(fù)濂囨暟琛屻俹dd榪斿洖boolean綾誨瀷;
evne鍏抽敭瀛楃敤鏉ュ垽鏂綋鍓嶈凱浠d綅緗槸鍚︿負(fù)鍋舵暟琛屻俥ven榪斿洖boolean綾誨瀷
5)銆佹葷粨涓嬶紝褰撳0鏄巌terator鐨剆tatus灞炴ф椂錛岄氳繃#statusName.method 鍙互浣跨敤浠ヤ笅鏂規(guī)硶:
even : boolean - 濡傛灉褰撳墠榪唬浣嶇疆鏄伓鏁拌繑鍥瀟rue
odd : boolean - 濡傛灉褰撳墠榪唬浣嶇疆鏄鏁拌繑鍥瀟rue
count : int - 榪斿洖褰撳墠榪唬浣嶇疆鐨勮鏁?浠?寮濮?
index : int - 榪斿洖褰撳墠榪唬浣嶇疆鐨勭紪鍙?浠?寮濮?
first : boolean - 濡傛灉褰撳墠榪唬浣嶇疆鏄涓浣嶆椂榪斿洖true
last : boolean - 濡傛灉褰撳墠榪唬浣嶇疆鏄渶鍚庝竴浣嶆椂榪斿洖true
modulus(operand : int) : int - 榪斿洖褰撳墠璁℃暟(浠?寮濮?涓庢寚瀹氭搷浣滄暟鐨勬ā鏁?
6)銆佹渶鍚庡啀鏉ョ湅涓嬪湪iterator涓皟鐢╲alue stack鐨勭敤娉曘?/strong>
鍋囧畾countries鏄竴涓狶ist瀵硅薄錛屾瘡涓涓猚ountry鏈変竴涓猲ame灞炴у拰涓涓猚itys List瀵硅薄錛屽茍涓旀瘡涓涓猚ity涔熸湁涓涓猲ame灞炴?銆傞偅涔堟垜浠兂瑕佸湪榪唬cities鏄闂甤ountries鐨刵ame灞炴у氨鐨勭敤濡備笅鏂瑰紡錛?/p>
view plaincopy to clipboardprint?
<s:iterator value="countries">
<s:iterator value="cities">
<s:property value="name"/>, <s:property value="[1].name"/><br>
</s:iterator>
</s:iterator>
<s:iterator value="countries">
<s:iterator value="cities">
<s:property value="name"/>, <s:property value="[1].name"/><br>
</s:iterator>
</s:iterator>
榪欓噷鐨?<ww:property value="name"/>鍙栫殑鏄痗tiy.name;<ww:property value="[1].name"/>鍙栧緱鏄痗ountry.name
<ww:property value="[1].name"/> 絳変環(huán)浜?<ww:property value="[1].top.name"/>
we refer to a specific position on the stack: '[1]'. The top of the stack, position 0, contains the current city, pushed on by the inner iterator; position 1 contains the current country, pushed there by the outer iterator.(city澶勪簬褰撳墠鏍堬紝鍗硉op鎴栬匸0],鑰孾1]鎸囨槑浜嗗灞俰terator瀵硅薄錛屽嵆country)
'[n]'鏍囪寮曠敤寮濮嬩綅緗負(fù)n鐨勫瓙鏍堬紙sub-stack錛夛紝鑰屼笉浠呬粎鏄綅緗畁澶勭殑瀵硅薄銆傚洜姝?[0]'浠h〃鏁翠釜鏍堬紝鑰?[1]'鏄櫎top瀵硅薄澶栨墍鏈夌殑鏍堝厓绱犮?
杞澆鍑哄錛歨ttp://blog.csdn.net/oxcow/archive/2009/09/03/4516283.aspx
鎴戜滑鍦╦avascript涓彲浠ラ氳繃浠ヤ笅鏂瑰紡璇誨彇鍜岃祴鍊?/p>
浠ヤ笂浠g爜錛屽彇鍑簍ime1涓殑鍊鹼紝璧嬬粰time2
Getting and getting the datetimepicker value, from JavaScript:
Publish topic when value changes: