You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pandolf <ri...@gmail.com> on 2008/06/07 10:34:46 UTC

After Visiting URL with Queyr String, Query String Appears on Every Link


Hi everyone, 

I'm using Struts 2.0.11.1 with FreeMarker 2.3.8. I've created a hyperlink in
a .FTL as follows:

	<@s.url id="todayDashboardUrl" action="encounters">
            <@s.param name="minDaysAway" value="0"/>
            <@s.param name="maxDaysAway" value="1"/>
        </@>

        <@s.a href="%{todayDashboardUrl}">Today</...@s.a>
		
The link is rendered without a problem. I can click it and arrive at the
correct page. After clicking through this link, however, Struts 2 appears to
append the query string (i.e. "?minDaysAway=0&maxDaysAway=7") to every other
URL in my site! Including URLs that are not supposed to have it.

Why is this? How do I avoid this scenario?

Thanks for any help.
-- 
View this message in context: http://www.nabble.com/After-Visiting-URL-with-Queyr-String%2C-Query-String-Appears-on-Every-Link-tp17706571p17706571.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: After Visiting URL with Queyr String, Query String Appears on Every Link

Posted by Ralf Fischer <th...@googlemail.com>.
Hello,

please see the Tag Documentation of <s:url /> [1] for this, and take a
look at the attribute "includeParams". By default the url tag includes
all request parameters in the query string of the current page when
generating a new URL, thus all your parameters are transported
implicitly onto the next page. Just set includeParmas to "none" and
they won't.

Bye,
-Ralf

[1] http://struts.apache.org/2.0.11.1/docs/url.html

On Sat, Jun 7, 2008 at 10:34 AM, Pandolf <ri...@gmail.com> wrote:
>
>
> Hi everyone,
>
> I'm using Struts 2.0.11.1 with FreeMarker 2.3.8. I've created a hyperlink in
> a .FTL as follows:
>
>        <@s.url id="todayDashboardUrl" action="encounters">
>            <@s.param name="minDaysAway" value="0"/>
>            <@s.param name="maxDaysAway" value="1"/>
>        </@>
>
>        <@s.a href="%{todayDashboardUrl}">Today</...@s.a>
>
> The link is rendered without a problem. I can click it and arrive at the
> correct page. After clicking through this link, however, Struts 2 appears to
> append the query string (i.e. "?minDaysAway=0&maxDaysAway=7") to every other
> URL in my site! Including URLs that are not supposed to have it.
>
> Why is this? How do I avoid this scenario?
>
> Thanks for any help.
> --
> View this message in context: http://www.nabble.com/After-Visiting-URL-with-Queyr-String%2C-Query-String-Appears-on-Every-Link-tp17706571p17706571.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: After Visiting URL with Query String, Query String Appears on Every Link

Posted by Pandolf <ri...@gmail.com>.

Thanks Lukasz, all sorted now.

Cheers.



Lukasz Lenart wrote:
> 
> Hi
> 
> 2008/6/7 Pandolf <ri...@gmail.com>:
> 
>>        <@s.url id="todayDashboardUrl" action="encounters">
>>
> 
> 
> Add includeParams="none" to this tag or globally set
> struts.url.includeParams=none in struts.xml or struts.properties
> 
> 
> Regards
> -- 
> Lukasz
> http://www.lenart.org.pl/
> 
> 

-- 
View this message in context: http://www.nabble.com/After-Visiting-URL-with-Query-String%2C-Query-String-Appears-on-Every-Link-tp17706571p17708529.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: After Visiting URL with Query String, Query String Appears on Every Link

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi

2008/6/7 Pandolf <ri...@gmail.com>:

>        <@s.url id="todayDashboardUrl" action="encounters">
>


Add includeParams="none" to this tag or globally set
struts.url.includeParams=none in struts.xml or struts.properties


Regards
-- 
Lukasz
http://www.lenart.org.pl/