Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚJSPÒ³ÃæÖÐÓÃselectÏÂÀ­ÁбíÀ´ÏÔʾListÁбíµÄ·½Ê½

Ò» ¡¢ ÓÃstruts2±êÇ©µÄ<s:selectÀ´ÏÔʾ
<s:select cssStyle="width: 84%" list="#application.officeList" headerKey="" headerValue="--ÇëÑ¡Ôñ--" listKey="#this.value" listValue="#this.key+'.'+#this.value" name="entity.officeName" value="entity.officeName"/>
ÆäÖÐ
1¡¢listÊǽÓÊÕjavaÀà»òÕßÔÚÆô¶¯Ê±¾ÍÒѾ­¼ÓÔصÄapplicationÖеÄlistÁбíÖµ £»
2¡¢listKeyµÄÖµÊÇselectµÄÖµ£»
3¡¢listValueµÄÖµÊÇÏ൱ÓÚ<selectÖÐÏÔʾ³öÀ´µÄtext£»
4¡¢valueÊÇjavaÀàÖд«À´µÄÖµ£¬ÓÃÀ´ÓëselectÁбíÖеÄoptionµÄidÖµ×ö¶Ô±È
¶þ ¡¢ÓÃ<select  À´ÏÔʾ´ÓjavaÀà¶Ë´«¹ýÀ´µÄListÁбíÖеÄÑ¡Ïî
<select name="entity.officeName">
<option value="">--ÇëÑ¡Ôñ--</option>
<s:iterator value="#application.officeList" id="bean">
<option value="${bean.value}" <s:if test='#bean.key==entity.officeName'>selected</s:if> >${bean.key}.${bean.value}</option>
</s:iterator>
</select>


Ïà¹ØÎĵµ£º

JSPÄÚÖöÔÏó

JSP½Å±¾Öаüº¬9¸öÄÚÖöÔÏó£¬Õâ9¸öÄÚÖöÔÏó¶¼ÊÇServlet API½Ó¿ÚµÄʵÀý£¬Ö»ÊÇJSP¹æ·¶½«ËüÃÇÍê³ÉÁËĬÈϳõʼ»¯£¨ÓÉJSPÒ³Ãæ¶ÔÓ¦ServletµÄ_jspService()·½·¨À´´´½¨ÕâЩʵÀý£©¡£Ò²¾ÍÊÇ˵£¬ËüÃÇÒѾ­ÊǶÔÏ󣬿ÉÒÔÖ±½ÓʹÓá£9¸öÄÚÖöÔÏóÒÀ´ÎÈçÏ£º
application£ºjavax.servlet.ServletContextµÄʵÀý£¬¸ÃʵÀý´ú±íJSPËùÊôµÄWebÓ ......

×éÆ´jsp·½·¨3

<table width=100% border="0" align="center" cellpadding="0"
 cellspacing="0">
 <tr>
  <td height="1" class="gray1"></td>
 </tr>
</table>
<tiles:insert attribute="footer" />
</body>
</html:html> ......

0415:JSPµÄÔËÐÐÔ­Àíͼ


1              web·þÎñÆ÷{TOMCAT(JSP)¡¢WEBLOGIC(JSP) }
                Ó¦Ó÷þÎñÆ÷
            We ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ