Quantcast

accessing url parameters in jsp.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

accessing url parameters in jsp.

strutstwouser
Hi,

I need to access certain url parameters and pass them on as the query string
to an iframe within the jsp

So, if the incoming url is :

http://localhost:9080/myapp/searchForm.action?mainObj.childObj=xyz&abc=123

i need to pass to iframe as :

<iframe src="searchResults.action?mainObj.childObj=xyz&abc=123" ... />

I can access the abc param as <s:property value="%{#parameters.abc}" /> ,
but the same doesn't work for <s:property value="%{#parameters.
mainObj.childObj}" />

Ideally, i would want the entire incoming query string be passed on to the
iframe- but didn't find anything handy.

Note  : i can't use the s:action tag in this case, since the result is a
jasperreport page, and it flushes the response within the result itself ; so
had to go with iframe.

Any help is appreciated.

Thanks,
Joseph
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accessing url parameters in jsp.

Maxx-10
On Dec 19, 2007 6:45 AM, j alex <[hidden email]> wrote:
> Ideally, i would want the entire incoming query string be passed on to the
> iframe- but didn't find anything handy.
>
> Note  : i can't use the s:action tag in this case, since the result is a
> jasperreport page, and it flushes the response within the result itself ; so
> had to go with iframe.

Yes, you can't use the s:action tag, but instead you can use the s:url tag, like
  <s:url action="yourActionName" includeParams="get" />
and all your "GET" parameters will be copied in the new forged url.

Oh... and please read the doc!!! ;)
http://struts.apache.org/2.x/docs/url.html

Greets,
Maxx

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accessing url parameters in jsp.

Zarar Siddiqi
In reply to this post by strutstwouser
Well, you could just use the pageContext variable to get the query string like so:

${pageContext.request.queryString}

Zarar


strutstwouser wrote
Hi,

I need to access certain url parameters and pass them on as the query string
to an iframe within the jsp

So, if the incoming url is :

http://localhost:9080/myapp/searchForm.action?mainObj.childObj=xyz&abc=123

i need to pass to iframe as :

<iframe src="searchResults.action?mainObj.childObj=xyz&abc=123" ... />

I can access the abc param as <s:property value="%{#parameters.abc}" /> ,
but the same doesn't work for <s:property value="%{#parameters.
mainObj.childObj}" />

Ideally, i would want the entire incoming query string be passed on to the
iframe- but didn't find anything handy.

Note  : i can't use the s:action tag in this case, since the result is a
jasperreport page, and it flushes the response within the result itself ; so
had to go with iframe.

Any help is appreciated.

Thanks,
Joseph
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: accessing url parameters in jsp.

strutstwouser
In reply to this post by Maxx-10
Thanks guys..yeah, i hit upon s:url few hrs after i had posted this :-)

On Dec 19, 2007 1:59 PM, Maxx <[hidden email]> wrote:

> On Dec 19, 2007 6:45 AM, j alex <[hidden email]> wrote:
> > Ideally, i would want the entire incoming query string be passed on to
> the
> > iframe- but didn't find anything handy.
> >
> > Note  : i can't use the s:action tag in this case, since the result is a
> > jasperreport page, and it flushes the response within the result itself
> ; so
> > had to go with iframe.
>
> Yes, you can't use the s:action tag, but instead you can use the s:url
> tag, like
>  <s:url action="yourActionName" includeParams="get" />
> and all your "GET" parameters will be copied in the new forged url.
>
> Oh... and please read the doc!!! ;)
> http://struts.apache.org/2.x/docs/url.html
>
> Greets,
> Maxx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Loading...