You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by cool dude <co...@yahoo.com> on 2002/02/11 06:48:17 UTC

URL handling problem with struts ...

Hi,
    First lemme thank all of you guyz for the quick
responses that I've got for most of my problems.
Few of your suggestions have really helped me. But my
problem with relative URL still remains. Maybe I
didn't explain the problem in the right manner. Lemme
tell you what the exact scenario is. I have a URL
which looks like
http://www.mysite.com/US/en/brandname/actionname.

This would be the URL even for the starting page, with
actionname being say "home". I need such a lengthy URL
because the site supports multiple countries &
languages & brands. I get this information from the
URL. I know we could have send this information even
as a querystring but unfortunately this is the
standard URL now and I can't change it. Now the
problem is this: If I give the action name as just
"login" & in the <html:form I mention "login" it does
not find the action mapping. It gives me a error when
I submit to this form saying that there is no mapping
for action name "/login". Why does it convert "login"
to "/login" I have no idea about ... its being done
internally in the struts FormTag. (This I validated by
putting SOPs
in the FOrmTag class. It adds a "/" before the action
name) To solve this problem I changed the action name
to "/login" in my
struts-config.xml & it worked but then the URL changed
to http://www.mysite.com/main/login

You would notice that I lost the country, language &
brand information. I need all these information in the
all the pages to cater for bookmarking, ie, when a
user bookmarks a page I should be able to recreate the
page with his preferences, which I can do only if I
have this information in the URL.

How can I solve this problem? As I'm a newbee I might
be ignoring something really obvious ... hope you guyz
can help me out with this one too ...:-)

Thanx in advance,
VD.


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: URL handling problem with struts ...

Posted by Mark Rines <mr...@inforise.com>.
Phew,
I vote that we split up this mail list into several topics such as
installation, configuration, add-ons (such as strutsTests) and extending the
various ActionXXX classes. I am really having trouble keeping up with all
(over 110 just today) the email.
Mark

> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: URL handling problem with struts ...

Posted by Keith Bacon <ke...@yahoo.com>.
You can use your servers mapping rules to send everything
to a special (non-struts) servlet (or maybe your own sub-class of ActionServlet). 
which from an incoming URL like your:-
www.mysite.com/US/en/brandname/actionname.

forwards to
www.mysite.com/actionname.do?country=US&language=en&brand=brandname
and then you are happy in struts territory.
I assume you want to support these old URL's because users may have existing book marks?
I'd write my system with struts style URL's & provide support for the old URL's like I say here.
hope that helps - Keith.

--- cool dude <co...@yahoo.com> wrote:
> Hi,
>     First lemme thank all of you guyz for the quick
> responses that I've got for most of my problems.
> Few of your suggestions have really helped me. But my
> problem with relative URL still remains. Maybe I
> didn't explain the problem in the right manner. Lemme
> tell you what the exact scenario is. I have a URL
> which looks like
> http://www.mysite.com/US/en/brandname/actionname.
> 
> This would be the URL even for the starting page, with
> actionname being say "home". I need such a lengthy URL
> because the site supports multiple countries &
> languages & brands. I get this information from the
> URL. I know we could have send this information even
> as a querystring but unfortunately this is the
> standard URL now and I can't change it. Now the
> problem is this: If I give the action name as just
> "login" & in the <html:form I mention "login" it does
> not find the action mapping. It gives me a error when
> I submit to this form saying that there is no mapping
> for action name "/login". Why does it convert "login"
> to "/login" I have no idea about ... its being done
> internally in the struts FormTag. (This I validated by
> putting SOPs
> in the FOrmTag class. It adds a "/" before the action
> name) To solve this problem I changed the action name
> to "/login" in my
> struts-config.xml & it worked but then the URL changed
> to http://www.mysite.com/main/login
> 
> You would notice that I lost the country, language &
> brand information. I need all these information in the
> all the pages to cater for bookmarking, ie, when a
> user bookmarks a page I should be able to recreate the
> page with his preferences, which I can do only if I
> have this information in the URL.
> 
> How can I solve this problem? As I'm a newbee I might
> be ignoring something really obvious ... hope you guyz
> can help me out with this one too ...:-)
> 
> Thanx in advance,
> VD.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>