struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john lee <>
Subject struts2 s:url call action method
Date Fri, 27 Jun 2014 20:34:33 GMT

I try to use s:url to call action's method, but not works, please advise

from the executed link, it shows!additem?partid=1508,
but logfile no method shows executed.

i executed/tested manually by  http://localhost/CartAction.action!add?partid=1508, shows
no resource is available

so, what is the correct way/syntax to use s:url tag to call action's method ?

thanks in advnce



3 files  (, Cart.jsp, Struts.xml )

           <action name="CartAction" class="CartAction"  method="add">
                    <result name="success">Success.jsp</result>
      public class CartAction extends ActionSupport {
                     public String add() throws Exception {

       <s:url action="CartAction" var="cartTag" method="add" escapeAmp="false">
              <s:param name="partid"> <s:property value="partid"/>
       <s:a href="%{cartTag}">Add to Cart</s:a>
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message