You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by PC Leung <pc...@gmail.com> on 2004/08/26 14:38:39 UTC

How to embed a method in a link inside a jsp file?

My JSP file contains a link like this.

    <td>
    <html:link page="/AddUserProfile.do?method=setup">
    <bean:message  key="userMaint.addUserProfile"/>
    </html:link>
    </td>  

This link points to AddUserProfile.jsp.

When I click on the link, it gives invalid path error message.
How can I embed "?method=setup" inside a html:link?

Thnx

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to embed a method in a link inside a jsp file?

Posted by PC Leung <pc...@gmail.com>.
What needs to be done?

the entry in struts-config.xml like this.

   <action    path="/addUserProfile"
              type="com.erp.quotation.AddUserProfileAction"
              name="addUserProfileForm"
                scope="request"
                validate="true"
                parameter="method"
              input="/AddUserProfile.jsp">
     <forward name="success" path="/AddUserProfile.jsp"/>
     <forward name="failure" path="/AddUserProfile.jsp"/>
     <forward name="cancel" path="/UserMaint.jsp"/>
   </action>

where AddUserProfileAction is a DispatchAction

public final class AddUserProfileAction extends DispatchAction {
    public ActionForward setup (ActionMapping mapping,
	ActionForm form,
	HttpServletRequest request,
	HttpServletResponse response) 
	  throws Exception {
  	  HttpSession session = request.getSession();
  	  saveToken(request);
  	  return (mapping.getInputForward());
	} 


On Thu, 26 Aug 2004 14:49:29 +0200, Nicolas De Loof
<ni...@capgemini.com> wrote:
> 
> This should work !
> 
> Have you checked your /AddUserProfile.do is well configured ?
> 
> Are you using modules ?
> 
> Nico.
> 
> 
> > My JSP file contains a link like this.
> >
> >     <td>
> >     <html:link page="/AddUserProfile.do?method=setup">
> >     <bean:message  key="userMaint.addUserProfile"/>
> >     </html:link>
> >     </td>
> >
> > This link points to AddUserProfile.jsp.
> >
> > When I click on the link, it gives invalid path error message.
> > How can I embed "?method=setup" inside a html:link?
> >
> > Thnx
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> Our name has changed.  Please update your address book to the following format: "recipient@capgemini.com".
> 
> This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to embed a method in a link inside a jsp file?

Posted by Nicolas De Loof <ni...@capgemini.com>.
This should work !

Have you checked your /AddUserProfile.do is well configured ?

Are you using modules ?

Nico.


> My JSP file contains a link like this.
> 
>     <td>
>     <html:link page="/AddUserProfile.do?method=setup">
>     <bean:message  key="userMaint.addUserProfile"/>
>     </html:link>
>     </td>  
> 
> This link points to AddUserProfile.jsp.
> 
> When I click on the link, it gives invalid path error message.
> How can I embed "?method=setup" inside a html:link?
> 
> Thnx
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


Our name has changed.  Please update your address book to the following format: "recipient@capgemini.com".

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org