You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paranoid_Fabio <pa...@yahoo.it> on 2008/02/14 19:33:43 UTC

Parameters in URL

Hi, i'm new to struts. I'm developing a web application and I can't
understand why parameters still in the url beetwen actions calls. I try to
explain it better (sorry for my poor english):

I call "myAction?paramx=valuex" and the url becomes
".../myAction?paramx=valuex" correctly.

Then, my new displayed JSP call "myAction2" but the shown url is
".../myAction?paramx=valuex" even if i invoked myAction2 without any
parameter.
So I've two questions:

1)It's only a display thing or paramx=valuex is actually passed also to
myAction2?
2)How I can avoid this behaviour?I read about includeparams=false in
struts.xml, but I'm not sure if it's the   right solution... 

Thank you in advance!!

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p15485039.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: Parameters in URL

Posted by cheeran <sa...@omgeo.com>.
My company virus scanner prevents me from putting xml here. When I use s:url
and add parameters using s:param and set the URL as href to sx:a , an ajax
anchor tag, I get the following error. I get two sets of values for each
action parameters comma separated. One the value I sent via s:param. 2 - the
default form value for those action parameter.

I was answering in the context following post. I am using this board for
first time.

http://www.nabble.com/Parameters-in-URL-td15485039.html#a22604454

Thanks,
Santhosh


Jim Kiley wrote:
> 
> I'm having an extremely hard time understanding what you are asking here. 
> I
> think you may have been trying to paste something into your message but
> failed to paste it in, or something.  Can you be clearer about what you
> are
> asking for?
> jk
> 
> On Thu, Mar 19, 2009 at 12:34 PM, cheeran <sa...@omgeo.com>
> wrote:
> 
>>
>> I use struts 2.1.6, follow both struts.properties and
>> includeParams="none".
>> The paramter in action class comes as
>>
>> valuea, valueb where valueb is the default form value. I use sx:a to
>> assign
>> a target to the link. Any other reason ? I use this in a  tab panel tab
>> page.
>>
>> Thanks,
>> Santhosh
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Parameters-in-URL-tp15485039p22603523.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
>>
>>
> 
> 
> -- 
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p22604702.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: Parameters in URL

Posted by Jim Kiley <jh...@summa-tech.com>.
I'm having an extremely hard time understanding what you are asking here.  I
think you may have been trying to paste something into your message but
failed to paste it in, or something.  Can you be clearer about what you are
asking for?
jk

On Thu, Mar 19, 2009 at 12:34 PM, cheeran <sa...@omgeo.com> wrote:

>
> I use struts 2.1.6, follow both struts.properties and includeParams="none".
> The paramter in action class comes as
>
> valuea, valueb where valueb is the default form value. I use sx:a to assign
> a target to the link. Any other reason ? I use this in a  tab panel tab
> page.
>
> Thanks,
> Santhosh
>
> --
> View this message in context:
> http://www.nabble.com/Parameters-in-URL-tp15485039p22603523.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
>
>


-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com

Re: Parameters in URL

Posted by cheeran <sa...@omgeo.com>.
I use struts 2.1.6, follow both struts.properties and includeParams="none".
The paramter in action class comes as

valuea, valueb where valueb is the default form value. I use sx:a to assign
a target to the link. Any other reason ? I use this in a  tab panel tab
page.

Thanks,
Santhosh

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p22603523.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: Parameters in URL

Posted by Musachy Barroso <mu...@gmail.com>.
:)

On Thu, Feb 14, 2008 at 3:42 PM, Dave Newton <ne...@yahoo.com> wrote:
> Teach a man to fish...
>
>
>
>  --- Musachy Barroso <mu...@gmail.com> wrote:
>  > set includeParams = "'none'"
>  >
>  > On Thu, Feb 14, 2008 at 3:31 PM, Dave Newton <ne...@yahoo.com> wrote:
>  > > --- Paranoid_Fabio <pa...@yahoo.it> wrote:
>  > >  > <s:url id="en" action="showAdminPage" includeParams="false">
>  > >  >               <s:param name="request_locale">en_US</s:param>
>  > >  >          </s:url>
>  > >  >          <s:a href="%{en}">
>  > >  >
>  > >
>  > > > I'm using the "url" tag correctly.Am I?
>  > >
>  > >  No.
>  > >
>  > >
>  > >  > What i'm doing wrong?
>  > >
>  > >  You're using an unknown value for the "includeParams" attribute.
>  > >
>  > >  http://struts.apache.org/2.0.11/docs/url.html
>  > >
>  > >  Dave
>  > >
>  > >
>  > >
>  > >
>  > >  ---------------------------------------------------------------------
>  > >  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>  > >  For additional commands, e-mail: user-help@struts.apache.org
>  > >
>  > >
>  >
>  >
>  >
>  > --
>  > "Hey you! Would you help me to carry the stone?" Pink Floyd
>  >
>  > ---------------------------------------------------------------------
>  > 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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Parameters in URL

Posted by Dave Newton <ne...@yahoo.com>.
Teach a man to fish...

--- Musachy Barroso <mu...@gmail.com> wrote:
> set includeParams = "'none'"
> 
> On Thu, Feb 14, 2008 at 3:31 PM, Dave Newton <ne...@yahoo.com> wrote:
> > --- Paranoid_Fabio <pa...@yahoo.it> wrote:
> >  > <s:url id="en" action="showAdminPage" includeParams="false">
> >  >               <s:param name="request_locale">en_US</s:param>
> >  >          </s:url>
> >  >          <s:a href="%{en}">
> >  >
> >
> > > I'm using the "url" tag correctly.Am I?
> >
> >  No.
> >
> >
> >  > What i'm doing wrong?
> >
> >  You're using an unknown value for the "includeParams" attribute.
> >
> >  http://struts.apache.org/2.0.11/docs/url.html
> >
> >  Dave
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >  For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> 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: Parameters in URL

Posted by Musachy Barroso <mu...@gmail.com>.
set includeParams = "'none'"

On Thu, Feb 14, 2008 at 3:31 PM, Dave Newton <ne...@yahoo.com> wrote:
> --- Paranoid_Fabio <pa...@yahoo.it> wrote:
>  > <s:url id="en" action="showAdminPage" includeParams="false">
>  >               <s:param name="request_locale">en_US</s:param>
>  >          </s:url>
>  >          <s:a href="%{en}">
>  >
>
> > I'm using the "url" tag correctly.Am I?
>
>  No.
>
>
>  > What i'm doing wrong?
>
>  You're using an unknown value for the "includeParams" attribute.
>
>  http://struts.apache.org/2.0.11/docs/url.html
>
>  Dave
>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>  For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Parameters in URL

Posted by Dave Newton <ne...@yahoo.com>.
--- Paranoid_Fabio <pa...@yahoo.it> wrote:
> <s:url id="en" action="showAdminPage" includeParams="false">
>          	<s:param name="request_locale">en_US</s:param>
>          </s:url>
>          <s:a href="%{en}">
> 
> I'm using the "url" tag correctly.Am I? 

No.

> What i'm doing wrong?

You're using an unknown value for the "includeParams" attribute.

http://struts.apache.org/2.0.11/docs/url.html

Dave


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


Re: Parameters in URL

Posted by Paranoid_Fabio <pa...@yahoo.it>.
Ok.I've read that but even using includeParams="none" params are shown in the
URL. My code is like this:

....
<s:url id="en" action="showAdminPage" includeParams="false">
         	<s:param name="request_locale">en_US</s:param>
         </s:url>
         <s:a href="%{en}">
....

When the user clicks on the English flag, the "showAdminPage" is called
switching the Locale. I'm using the "url" tag correctly.Am I? 
Clicking on the link, the browser shows
"../showAdminPage.action?request_locale=en_US e the parameter remains
displayed when i call other actions from the new jsp.
What i'm doing wrong?




Paranoid_Fabio wrote:
> 
> Hi, i'm new to struts. I'm developing a web application and I can't
> understand why parameters still in the url beetwen actions calls. I try to
> explain it better (sorry for my poor english):
> 
> I call "myAction?paramx=valuex" and the url becomes
> ".../myAction?paramx=valuex" correctly.
> 
> Then, my new displayed JSP call "myAction2" but the shown url is
> ".../myAction?paramx=valuex" even if i invoked myAction2 without any
> parameter.
> So I've two questions:
> 
> 1)It's only a display thing or paramx=valuex is actually passed also to
> myAction2?
> 2)How I can avoid this behaviour?I read about includeparams=false in
> struts.xml, but I'm not sure if it's the   right solution... 
> 
> Thank you in advance!!
> 
> 

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p15488658.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: Parameters in URL

Posted by Musachy Barroso <mu...@gmail.com>.
http://struts.apache.org/2.0.11/docs/why-are-request-parameters-appended-to-our-hyperlinks.html

regards
musachy

On Thu, Feb 14, 2008 at 1:33 PM, Paranoid_Fabio <pa...@yahoo.it> wrote:
>
>  Hi, i'm new to struts. I'm developing a web application and I can't
>  understand why parameters still in the url beetwen actions calls. I try to
>  explain it better (sorry for my poor english):
>
>  I call "myAction?paramx=valuex" and the url becomes
>  ".../myAction?paramx=valuex" correctly.
>
>  Then, my new displayed JSP call "myAction2" but the shown url is
>  ".../myAction?paramx=valuex" even if i invoked myAction2 without any
>  parameter.
>  So I've two questions:
>
>  1)It's only a display thing or paramx=valuex is actually passed also to
>  myAction2?
>  2)How I can avoid this behaviour?I read about includeparams=false in
>  struts.xml, but I'm not sure if it's the   right solution...
>
>  Thank you in advance!!
>
>  --
>  View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p15485039.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
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Parameters in URL

Posted by Maxx <ma...@gmail.com>.
On Fri, Feb 15, 2008 at 9:46 AM, Paranoid_Fabio <pa...@yahoo.it> wrote:
>
>  I'm sorry but I meant "includeParams=none". I wrote it correctly in the code
>  but I posted it wrong.
>  The result is the same, params are included in the url.

Which url(s) are talking about now ?

If, as said above, it's within the other urls generated in your JSP,
it's the same schema : generate them with the <s:url> tag and
"includeParams=none" parameter.

If you want to change this globally (it really helps!), set in your
struts.properties the following line:
struts.url.includeParams=none

Maxx

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


Re: Parameters in URL

Posted by Paranoid_Fabio <pa...@yahoo.it>.
I'm sorry but I meant "includeParams=none". I wrote it correctly in the code
but I posted it wrong.
The result is the same, params are included in the url.
The code is:

         <s:url id="en" action="showAdminPage" includeParams="none">
         	<s:param name="request_locale">en_US</s:param>
         </s:url>
         <s:a href="%{en}">




Paranoid_Fabio wrote:
> 
> Hi, i'm new to struts. I'm developing a web application and I can't
> understand why parameters still in the url beetwen actions calls. I try to
> explain it better (sorry for my poor english):
> 
> I call "myAction?paramx=valuex" and the url becomes
> ".../myAction?paramx=valuex" correctly.
> 
> Then, my new displayed JSP call "myAction2" but the shown url is
> ".../myAction?paramx=valuex" even if i invoked myAction2 without any
> parameter.
> So I've two questions:
> 
> 1)It's only a display thing or paramx=valuex is actually passed also to
> myAction2?
> 2)How I can avoid this behaviour?I read about includeparams=false in
> struts.xml, but I'm not sure if it's the   right solution... 
> 
> Thank you in advance!!
> 
> 

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p15496167.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: Parameters in URL

Posted by Maxx <ma...@gmail.com>.
OK, understood. Did you try what I advised you?

To make it clear, what is the JSP code of the other links/actions..?

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


Re: Parameters in URL

Posted by Paranoid_Fabio <pa...@yahoo.it>.
I'm talking about the current url and the other urls next to the switch
locale call.
 
1) i call myAction and the url=.../myAction.action
2)I click the english flag. The code executed here is the one i posted:

<s:url id="en" action="showAdminPage" includeParams="none">
          <s:param name="request_locale">en_US</s:param>
         </s:url>
         <s:a href="%{en}">



3)The main admin page is shown and the url become
.../showAdminPage.action?request_locale=en_US
4)If I call another action, let's say Action2 the url become:

.../Action2.action?request_locale=en_US 

The parameters remains appended even if I used includeParams="none"



Paranoid_Fabio wrote:
> 
> Hi, i'm new to struts. I'm developing a web application and I can't
> understand why parameters still in the url beetwen actions calls. I try to
> explain it better (sorry for my poor english):
> 
> I call "myAction?paramx=valuex" and the url becomes
> ".../myAction?paramx=valuex" correctly.
> 
> Then, my new displayed JSP call "myAction2" but the shown url is
> ".../myAction?paramx=valuex" even if i invoked myAction2 without any
> parameter.
> So I've two questions:
> 
> 1)It's only a display thing or paramx=valuex is actually passed also to
> myAction2?
> 2)How I can avoid this behaviour?I read about includeparams=false in
> struts.xml, but I'm not sure if it's the   right solution... 
> 
> Thank you in advance!!
> 
> 

-- 
View this message in context: http://www.nabble.com/Parameters-in-URL-tp15485039p15502126.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