You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pa...@merge-solutions.com on 2007/08/27 21:28:55 UTC

[S2] issues w/ url tags

Hi all,
 
Been awhile since I've posted. Been running into an issue today and I know this is going to make me look like a fool  but better to seek quick advice here rather than bang my head for hours. J
 
When I hit a page my action returns a JSP. The JSP page renders fine but within the JSP page I have a declaration such as the following:
 
<input type="button" onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'" value="Back"/>
 
The purpose here is just to take you one step backwards and it simply has one parameter passed.
 
My problem is when I view the source of the page with the button now it reads as follows:
 
Onclick="location.href='/myapp/WorkspaceAction.do?ownerObj=1&amp;prevObj=1'" ..etc
 
Why is it attaching the prevObj parameter at the end? This parameter was active when I came to the page and was used to render the page but as I've declared above, the parameter should not exist on this input button.
 
In fact I'm seeing this parameter get attached to all my input button urls on the page?
 
How can I avoid this please? Thanks in advance for making me feel like an idiot. Heh
 
Regards,
Paul

Re: [S2] issues w/ url tags

Posted by Musachy Barroso <mu...@gmail.com>.
Even if you pass parameters, it will append the request
parameters(unless you change your default), try setting

includeParams = "none"

musachy

On 8/27/07, paul.saumets@merge-solutions.com
<pa...@merge-solutions.com> wrote:
> Musachy,
>
> Thanks, but I am using the param tags.
>
> onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'"
>
> Or should I declare my url actions and assign an id and then use something like:
>
> Onclick="location.href='%{WorkActionUrl}'" ? Would that make a difference?
>
> Thanks,
> Paul
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@gmail.com]
> Sent: Monday, August 27, 2007 4:17 PM
> To: Struts Users Mailing List
> Subject: Re: [S2] <s:param> issues w/ url tags
>
> http://struts.apache.org/2.x/docs/why-are-request-parameters-appended-to-our-hyperlinks.html
>
> musachy
>
> On 8/27/07, paul.saumets@merge-solutions.com
> <pa...@merge-solutions.com> wrote:
> > Hi all,
> >
> > Been awhile since I've posted. Been running into an issue today and I know this is going to make me look like a fool  but better to seek quick advice here rather than bang my head for hours. J
> >
> > When I hit a page my action returns a JSP. The JSP page renders fine but within the JSP page I have a declaration such as the following:
> >
> > <input type="button" onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'" value="Back"/>
> >
> > The purpose here is just to take you one step backwards and it simply has one parameter passed.
> >
> > My problem is when I view the source of the page with the button now it reads as follows:
> >
> > Onclick="location.href='/myapp/WorkspaceAction.do?ownerObj=1&amp;prevObj=1'" ..etc
> >
> > Why is it attaching the prevObj parameter at the end? This parameter was active when I came to the page and was used to render the page but as I've declared above, the parameter should not exist on this input button.
> >
> > In fact I'm seeing this parameter get attached to all my input button urls on the page?
> >
> > How can I avoid this please? Thanks in advance for making me feel like an idiot. Heh
> >
> > Regards,
> > Paul
>
>
> --
> "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: [S2] issues w/ url tags

Posted by pa...@merge-solutions.com.
Musachy,

Thanks, but I am using the param tags.

onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'"

Or should I declare my url actions and assign an id and then use something like:

Onclick="location.href='%{WorkActionUrl}'" ? Would that make a difference?

Thanks,
Paul

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: Monday, August 27, 2007 4:17 PM
To: Struts Users Mailing List
Subject: Re: [S2] <s:param> issues w/ url tags

http://struts.apache.org/2.x/docs/why-are-request-parameters-appended-to-our-hyperlinks.html

musachy

On 8/27/07, paul.saumets@merge-solutions.com
<pa...@merge-solutions.com> wrote:
> Hi all,
>
> Been awhile since I've posted. Been running into an issue today and I know this is going to make me look like a fool  but better to seek quick advice here rather than bang my head for hours. J
>
> When I hit a page my action returns a JSP. The JSP page renders fine but within the JSP page I have a declaration such as the following:
>
> <input type="button" onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'" value="Back"/>
>
> The purpose here is just to take you one step backwards and it simply has one parameter passed.
>
> My problem is when I view the source of the page with the button now it reads as follows:
>
> Onclick="location.href='/myapp/WorkspaceAction.do?ownerObj=1&amp;prevObj=1'" ..etc
>
> Why is it attaching the prevObj parameter at the end? This parameter was active when I came to the page and was used to render the page but as I've declared above, the parameter should not exist on this input button.
>
> In fact I'm seeing this parameter get attached to all my input button urls on the page?
>
> How can I avoid this please? Thanks in advance for making me feel like an idiot. Heh
>
> Regards,
> Paul


-- 
"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: [S2] issues w/ url tags

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

musachy

On 8/27/07, paul.saumets@merge-solutions.com
<pa...@merge-solutions.com> wrote:
> Hi all,
>
> Been awhile since I've posted. Been running into an issue today and I know this is going to make me look like a fool  but better to seek quick advice here rather than bang my head for hours. J
>
> When I hit a page my action returns a JSP. The JSP page renders fine but within the JSP page I have a declaration such as the following:
>
> <input type="button" onclick="location.href='<s:url action="WorkspaceAction"><s:param name="ownerObj" value="%{prevObj}"/></s:url>'" value="Back"/>
>
> The purpose here is just to take you one step backwards and it simply has one parameter passed.
>
> My problem is when I view the source of the page with the button now it reads as follows:
>
> Onclick="location.href='/myapp/WorkspaceAction.do?ownerObj=1&amp;prevObj=1'" ..etc
>
> Why is it attaching the prevObj parameter at the end? This parameter was active when I came to the page and was used to render the page but as I've declared above, the parameter should not exist on this input button.
>
> In fact I'm seeing this parameter get attached to all my input button urls on the page?
>
> How can I avoid this please? Thanks in advance for making me feel like an idiot. Heh
>
> Regards,
> Paul


-- 
"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