struts codenips
1.
ActionMessage errors=new ActionMessage();
errors.add(“username“,new ActionMessage (“hello.no.username.errpr“));
return errors;
2.
每一個actionBean執(zhí)行execute方法最后調(diào)用return (mapping.findForward("SayHello"));
如果局部的mapping找不到就到全局global forward里面去找.
3.
????? <html:link forward="BeanServlet">
??????? BeanServlet
????? </html:link>
??? <forward?? name="BeanServlet"?????????? path="/BeanServlet.jsp"/>
4.
???? <bean:cookie id="cookie" name="/tags/cookiedemo" value="firsttime"/>
???? <%
?????? if (cookie.getValue().equals("firsttime")) {
???????? Cookie c = new Cookie("/tags/cookiedemo", "Hi Linda!");
???????? c.setComment("A test cookie");
???????? c.setMaxAge(3600); //60 seconds times 60 minutes
???????? response.addCookie(c);
?????? }
?????? %>
???? The cookie value is: <bean:write name="cookie" property="value"/>
轉(zhuǎn)載于:https://www.cnblogs.com/sunsonbaby/archive/2004/09/16/43853.html
總結(jié)
以上是生活随笔為你收集整理的struts codenips的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        