views:

588

answers:

1

I'm working on a webapp that uses struts 2, spring, URL Rewrite Filter and a couple of other dependencies that I'm not sure are relevant to this. One of the url's we construct is constructed as follows:

<s:url id="blah" includeParams="get">

This works fine when deploying in jboss as a normal webapp dropped in deploy/. So then all urls are of the form http://localhost:8080/mywebapp/... and when using this tag all the get parameters get included as expected.

However we wish to deploy this code in the root context (so everything ends up under http://localhost:8080/...), so we deployed it as ROOT.war. Suddenly, all the get parameters no longer show up in the URL. I've been looking for a while and can't seem to figure out what might cause this. First I thought it was to do with the URL rewriting but it seems to be working fine. Any tips, pointers, further questions for clarification are welcome. To add to the confusion, this all also works fine when deployed in jetty (where root context is the default).

edit: I've also tried removing ROOT.war and using jboss-web.xml to deploy to root context, this exhibits the exact same problem though.

+1  A: 

I tracked this partly down to the url rewriting being misconfigured, the get parameters weren't being added to the urls to be rewritten because 'include-query-string' wasn't set to true on urlrewrite. this meant that 'blah?querystring' wasn't being redirected to 'blah.action?querystring'. It still doesn't seem to work right now because of interrelated problems, but I will separate those out to another question.

wds
Thanks - this hint helped me with including the parameters in the redirect url. However, it would have been nice if you had mentioned that the use-query-string attribute has to be added in the urlrewrite element of the configuration file. :)
Roland Schneider
@RolandSchneider my mistake. Guess you fixed that now.:-)
wds