¤³¤Î¥Ú¡¼¥¸¤òdel.icio.us¤ËÄɲà ¤³¤Î¥Ú¡¼¥¸¤ò¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲ䳤Υڡ¼¥¸¤ò´Þ¤à¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯ ¤³¤Î¥Ú¡¼¥¸¤òlivedoor ¥¯¥ê¥Ã¥×¤ËÄɲà ¤³¤Î¥Ú¡¼¥¸¤òYahoo!¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲ䳤Υڡ¼¥¸¤ò´Þ¤àYahoo!¥Ö¥Ã¥¯¥Þ¡¼¥¯
Top / Struts / ¥ê¥ó¥¯¤Îºî¤êÊý

Struts¤Ç¥ê¥ó¥¯¤ÎºîÀ®ÊýË¡¤Ï¤¤¤í¤¤¤í¤Ê¤ä¤êÊý¤¬¤¢¤ê¤Þ¤¹¡£

<html:form>¥¿¥°¤Ç

form¤Îaction¤Ç

<html:form action="/execute">
 <html:select property="hoge">
  <html:options name="menu.pulldown"/>
 </html:select><html:errors property="hoge"/>
 <br/>
 <bean:define id="title" name="executeForm" 
                    property="hoge" type="java.lang.String"/>
 <%-- ÊÑ¿ô̾¤¬executeForm¤Îhoge¤È¤¤¤¦property¤ò
            title¤È¤¤¤¦ÊÑ¿ô̾¤Ç»²¾È¡£(·¿¤ÏString) --%>
 <html:submit/><html:cancel/>
</html:form>

¤È¤¹¤ë¤Èform¤¬ºîÀ®¤Ç¤­¤ë

<html:link>¥¿¥°¤Ç

html:link¤Îaction

<html:link action="/execute">¼Â¹Ô</html:link>

html:link¤ÎlinkName¤Ç¥¢¥ó¥«¡¼

<html:link linkName="Anchor" />

html:link¤Îpage

<html:link page="hoge" >aaaa</html:link>

¤È¤¹¤ë¤È

<a href="[contextpath]hoge">aaaa</a>

¤È¤Ê¤ë¡£¤Ä¤Þ¤ê¤½¤Î¤Þ¤Þ(do¤ÎÊä´°¤ä¡¢/¤È¤«¤ÎÊä´°¤¹¤é¤·¤Ê¤¤)¡£

<html:rewrite />¤À¤È

<html:rewrite page="hoge" />

¤È¤¹¤ë¤Èhtml¾å¤Ë

[contextpath]hoge

¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£

global-forwards¤òÄêµÁ¤·¤Æ¡¢html:link¤Îforward¤Ç

struts-config.xml¤Ç

<!-- ========== Global Forward Definitions =============================== -->
<global-forwards type="org.apache.struts.action.ActionForward">
	<forward name="hoge" path="/execute.do" />
</global-forwards>

¤ÈÄêµÁ¤·¡¢

<html:link forward="hoge" >aaaa</html:link> ¤Èµ­½Ò¤¹¤ë¤È
<a href="[contextpath]/execute.do">aaaa</a>

¤È¤Ê¤ë¡£*1

<html:rewrite />¤À¤È

¤Á¤Ê¤ß¤Ë¤³¤Î¥°¥í¡¼¥Ð¥ë¥Õ¥©¥ï¡¼¥É¤È¤¤¤¦µ¡Ç½¤Ï

<html:rewrite forward="hoge" />

¤Èµ­½Ò¤·¤Æ¡¢html¤Ë

[contextpath]/execute.do

¤È½ÐÎϤ¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¥ê¥ó¥¯¤Ç¤Ê¤¯¤Æ¥¹¥¿¥¤¥ë¥·¡¼¥È¥Õ¥¡¥¤¥ë¤Î»ØÄê¤È¤«¤Ë»ÈÍѤ·¤Þ¤¹¤Í¡£

html:link¤Îhref

¤½¤Î¤Þ¤Þ

<html:link href="hoge" >aaaa</html:link>

¤¬

<a href="hoge">aaaa</a>

¤È¤Ê¤ë¡£

<html:link>¥¿¥°¤Ç¤Î¡¢¥Ñ¥é¥á¡¼¥¿»ØÄêÊýË¡

¥³¥ì¥¯¥·¥ç¥ó¤«¤éÅϤ¹¾ì¹ç¡£

<%
	Map map=new HashMap();
	map.put("data1","value1");
	map.put("data2","value2");
	map.put("data3","value3");
	map.put("data4","value4");
	request.setAttribute("map",map);
%>
<html:link page="/execute.do" name="map">aaaa</html:link>

¤ß¤¿¤¯¡¢map¤ò»ØÄꤹ¤ë¤È¡¢¥Ñ¥é¥á¡¼¥¿¤È¤Ê¤ë¡£(name¤ÇBean¤ò»ØÄê¡¢property¤Çmap¤ò»ØÄꤷ¤Æ¤â¤è¤¤¡£)

¥¹¥³¡¼¥×Æâ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Î¾ðÊó¤ò¼¡¤Î²èÌ̤ËÅϤ¹¥ê¥ó¥¯¡£

Request¤äSession,PageContext?,Application¤Ê¤É¤¢¤ë¥¹¥³¡¼¥×Æâ¤Ë¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬ÊÝ»ý¤¹¤ë¥Õ¥£¡¼¥ë¥É¤ÎÃͤò¥ê¥ó¥¯¤Î¥Ñ¥é¥á¡¼¥¿¤Ë¤·¤¿¤¤¤È¤­¤¬¤¢¤ê¤Þ¤¹*2¤¬¡¢¤³¤¦¤ä¤ì¤Ð½ÐÍè¤Þ¤¹¡£°Ê²¼¤ÎÎã¤Ç¤Ïinstance¤È¤¤¤¦¥­¡¼¤Ç¤¢¤ë¥¹¥³¡¼¥×¤Ë¥¤¥ó¥¹¥¿¥ó¥¹¤¬¤¢¤ë¤È¤­¤Ç¤¹¤¬¡¢

<html:link paramName="instance" 
           paramId="fieldParam" 
           paramProperty="field" 
           page="/execute.do?action=edit">ÊÔ½¸</html:link>

¤È¤¹¤ë¤È

/execute.do?action=edit&fieldParam=[instance¥¤¥ó¥¹¥¿¥ó¥¹¤Îfield¤È¤¤¤¦¥Õ¥£¡¼¥ë¥É¤ÎÃÍ]

¤È¤Ê¤ê¤Þ¤¹¡£

¥¹¥³¡¼¥×Æâ¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Î¾ðÊó¤ò¼¡¤Î²èÌ̤ËÅϤ¹¥ê¥ó¥¯2¡£

¤Þ¤ºBean¤Î¥×¥í¥Ñ¥Æ¥£¤ËÊÑ¿ô̾¤òÉÕ¤±¤Æ
<bean:define id="userid" name="record" property="userId" type="java.lang.String"/>
¥ê¥ó¥¯¥¿¥°¤ËÅϤ¹
<html:link action="/hoge" paramId="userid" paramName="userid">
(¤¦¤¨¤Ï/hoge.do?[userid<-paramId¤Îʸ»úÎó]=bean¤Î¥×¥í¥Ñ¥Æ¥£ÃͤȤʤë)
  <bean:write name="record" property="userId" />
</html:link>

¤³¤ì¤Ç£Ï£Ë¡ª¤³¤ì¤è¤ê¾å¤Î¤ä¤êÊý¤ÎÊý¤¬¥¹¥Þ¡¼¥È¤Ç¤¹¤Í¡£


¤³¤Îµ­»ö¤Ï

ÁªÂò»è Åêɼ
¤ª¤â¤·¤í¤«¤Ã¤¿ 134  
¤½¤¦¤Ç¤â¤Ê¤¤ 42  
¤³¤Î¥Ú¡¼¥¸¤òdel.icio.us¤ËÄɲà ¤³¤Î¥Ú¡¼¥¸¤ò¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲ䳤Υڡ¼¥¸¤ò´Þ¤à¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯ ¤³¤Î¥Ú¡¼¥¸¤òlivedoor ¥¯¥ê¥Ã¥×¤ËÄɲà ¤³¤Î¥Ú¡¼¥¸¤òYahoo!¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲ䳤Υڡ¼¥¸¤ò´Þ¤àYahoo!¥Ö¥Ã¥¯¥Þ¡¼¥¯
Top / Struts / ¥ê¥ó¥¯¤Îºî¤êÊý

¸½ºß¤Î¥¢¥¯¥»¥¹:43402


*1 ¤â¤Á¤í¤ó*.do¤¸¤ã¤Ê¤¯¤Æjsp¤È¤«¤Ç¤â¤¤¤¤
*2 ¥ì¥³¡¼¥É¤ÎID¤ò¼¡¤Î²èÌ̤ËÅϤ·¤¿¤¤¡¢¤È¤«

¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS
Last-modified: 2012-05-19 (ÅÚ) 17:52:26 (1h)