struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: Struts Forward and URL prefix problem
Date Wed, 05 Apr 2006 09:40:30 GMT
Jeff Thorne on 03/04/06 21:25, wrote:
> I am trying out struts action mappings and wildcards so that I can provide
> my dynamic content static URLs that are not based on query strings.
> 
> When my action class forwards to success or failure all the URLs in the
> receiving .jsp page are prefix with the initial URL.
> 
> For example if I submit the following URL to my action class
> 
> http://www.example.com/getCompanyDetails/companyName/postalCode/CEO all the
> urls in the receiving .jsp file look like
> 
> /getCompanyDetails/companyName/postalCode/CEO/contactUs.jsp - a contact us
> link in my footer 
> 
> Here is my action definition:
> 
> <action path="/getCompanyDetails/*/*/*/*"
> type="com.example.struts.GetCompanyDetailsAction" parameter="{4}"
> name="getCompanyDetailsForm" scope="request" input="/displayCompanies.jsp"
> validate="false">
>       <forward name="failure" path="/displayCompanies.jsp" />
>       <forward name="success" path="/displayCompanyDetails.jsp"  />
> </action>
> 
> Any advice you have on how to solve this would be appreciated.

Jeff,
it's appending the context onto the URLs. This is a function of the 
taglib that you are using to output the URL. Presumably html:link? If 
so, which attribute are you using for it?

I suspect you are using 'page'. If you use href then it should just 
output the URL 'as is'. Or you could use 'action', and make the link an 
action mapping forward, e.g. action="contactus.do".


Adam

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


Mime
View raw message