$B$O$8$a$^$7$F!"(B<div>$B$^$@%W%m%0%i%`$r;O$a$F(B4$B%v7n$N<T$G$9!#(B</div><div>$B<RFb;n83$G7G<(HD%7%9%F%`$r$D$/$k$3$H$K$J$j(B</div><div><br></div><div><a href="http://www.youtube.com/watch?v=tkk3GyTwb8w">http://www.youtube.com/watch?v=tkk3GyTwb8w</a></div><div><br></div><div>$B$NF02h$r;29M$K7G<(HD$r:n$C$F$$$?$N$G$9$,(B</div>
<div>$B:G8e$N(Bpublic String sendMessage()$B$N$H$3$m$K(B@Execute(input=&quot;index.jsp&quot;)$B$r$D$1$k$H#4#0#4%(%i!<$,I=<($5$l$F$7$^$$$^$9!#(B</div><div>$B$=$NItJ,$r%3%a%s%H$G$O$:$9$H2hLL$OI=<($5$l$^$9!#(B</div><div>$B$$$m$$$mD4$Y$F$_$?$N$G$9$,!"860x$,$o$+$i$::$$C$F$$$^$9!#(B</div><div><br></div><div><br></div><div>$B%U%!%$%kL>$O(Bindex.jsp$B"*(Bindex2.jsp$B!"(BIndexAction.java$B"*(BIndex2Action.java$B$H$J$C$F$*$j$^$9(B</div>
<div><br></div><div>$B:n6H4D6-$O(B</div><div>windows 7</div><div>Eclipse Java EE IDE for Web Developers</div><div>dolteng$B%W%m%8%'%/%H(B</div><div>MySQL$B$G$9(B</div><div><br></div><div>Index2Action.java$B"-(B</div><div><br></div><div><br></div><div>
<div>package net.bbs.action;</div><div><br></div><div>import java.util.List;</div><div><br></div><div>import net.bbs.entity.Message;</div><div>import net.bbs.service.MessageService;</div><div><br></div><div>import org.seasar.struts.annotation.Execute;</div>
<div><br></div><div>public class Index2Action {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String userName;</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>public String text;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>public List&lt;Message&gt; messages;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@Execute(validator=false)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>public String index2(){</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>messages = MessageService.loadMessages();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>return &quot;index2.jsp&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@Execute(validator=true, input=&quot;index2.jsp&quot;)$B!!"+$3$3$G#4#0#4%(%i!<$,$G$^$9(B</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>public String sendMessage(){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>MessageService.registMessage(userName, text);</div><div>
<span class="Apple-tab-span" style="white-space:pre">                </span>return &quot;?redirect=true&quot;;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div>}</div></div><div><br></div>
<div><br></div><div>index2.jsp$B"-(B</div><div><div>&lt;%@page pageEncoding=&quot;UTF-8&quot;%&gt;</div><div>&lt;html&gt;</div><div>&lt;head&gt;</div><div>&lt;title&gt;$B4JC1$J7G<(HD(B&lt;/title&gt;</div><div>&lt;/head&gt;</div><div>&lt;body&gt;</div>
<div>&lt;div&gt;$B4JC1$J7G<(HD(B&lt;/div&gt;</div><div>&lt;div&gt;</div><div>&lt;form action=&quot;${/sendMessage}&quot; method=&quot;POST&quot;&gt;</div><div>&lt;input type=&quot;text&quot; name=&quot;userName&quot; placeholder=&quot;$BL>A0(B&quot; /&gt;</div>
<div>&lt;br /&gt;</div><div>&lt;textarea name=&quot;userName&quot; placeholder=&quot;$BK\J8(B&quot;&gt;&lt;/textarea&gt;</div><div>&lt;input type=&quot;submit&quot; /&gt;</div><div>&lt;/form&gt;</div><div><br></div><div>&lt;/div&gt;</div>
<div>&lt;c:forEach var=&quot;message&quot; items=&quot;${messages }&quot;&gt;</div><div>&lt;div style=&quot;border:solid 1px #333&quot;&gt;</div><div>&lt;div style=&quot;floot:left;width:100px&quot;&gt;${f:h(message.userName) }&lt;/div&gt;</div>
<div>&lt;div style=&quot;floot:left;margin-left:10px&quot;&gt;${f:br(f:h(message.text)) }&lt;/div&gt;</div><div>&lt;br style=&quot;clear:both&quot;/&gt;</div><div>&lt;/div&gt;</div><div>&lt;/c:forEach&gt;</div><div>&lt;/body&gt;</div>
<div>&lt;/html&gt;</div></div><div><br></div><div>$B$h$m$7$/$*4j$$$$$?$7$^$9!#(B</div>