You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jj endenburg <en...@yahoo.com> on 2005/03/08 11:43:20 UTC
Hidden parameter passing: RE: parameter passing from one jsp-screen to another
Thank you Erik!
Actually, the information in my question was not
complete. I am sorry for this...
The parameter to pass from jsp-screen A to jsp-screen
B should stay hidden from the end-user.
This is why displaying this parameter in the URL is
not possible, unfortunately.
Instead of this, how can I pass this parameter within
Struts, without the end-user being able to see it?
Thank you,
Jan-Jaap
--- "erikweber@mindspring.com"
<er...@mindspring.com> wrote:
> Well, how about using a query string parameter in
> your links?
>
> http://foo.com/myapp/bar.jsp?itemId=1
> http://foo.com/myapp/bar.jsp?itemId=2
>
> And so on?
>
> The Struts html:link tag (or the JSTL c:url tag) can
> be used to dynamically
> create your links.
>
>
http://struts.apache.org/userGuide/struts-html.html#link
>
> Hope that helps,
>
> Erik
>
>
> Original Message:
> -----------------
> From: jj endenburg endenburgjj@yahoo.com
> Date: Tue, 8 Mar 2005 00:29:46 -0800 (PST)
> To: user@struts.apache.org
> Subject: parameter passing from one jsp-screen to
> another
>
>
> Hi everyone,
>
> I have the following problem: how can I pass a
> parameter from a jsp-screen A to a jsp-screen B
> within
> the struts-framework?
>
> More concrete:
> Screen A has several clickable link instances to
> screen B. Each link instance has its own
> (dynamically
> calculated) parameter value to pass to screen B.
> This parameter is hidden from the sreen.
> Can someone give me a hint on how this parameter
> passing can be done in a handy way within struts?
>
> Thanks,
> Jan-Jaap
>
> Met vriendelijke groeten,
> Jan-Jaap Endenburg
>
>
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
>
--------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Hidden parameter passing: RE: parameter passing from one jsp-screen
to another
Posted by "jwwoger@chello.at" <jw...@chello.at>.
jj endenburg wrote:
>Thank you Erik!
>
>Actually, the information in my question was not
>complete. I am sorry for this...
>The parameter to pass from jsp-screen A to jsp-screen
>B should stay hidden from the end-user.
>This is why displaying this parameter in the URL is
>not possible, unfortunately.
>Instead of this, how can I pass this parameter within
>Struts, without the end-user being able to see it?
>
>Thank you,
>Jan-Jaap
>
>
Try
A.jsp:
<html:form action="B.jsp"...>
<html:hidden property="a1" value="val1"/>
.
.
</html:form>
B.jsp:
<c:out value="${param.a1}"/>
the prefix param is needed.
Wolfgang
>--- "erikweber@mindspring.com"
><er...@mindspring.com> wrote:
>
>
>>Well, how about using a query string parameter in
>>your links?
>>
>>http://foo.com/myapp/bar.jsp?itemId=1
>>http://foo.com/myapp/bar.jsp?itemId=2
>>
>>And so on?
>>
>>The Struts html:link tag (or the JSTL c:url tag) can
>>be used to dynamically
>>create your links.
>>
>>
>>
>>
>http://struts.apache.org/userGuide/struts-html.html#link
>
>
>>Hope that helps,
>>
>>Erik
>>
>>
>>Original Message:
>>-----------------
>>From: jj endenburg endenburgjj@yahoo.com
>>Date: Tue, 8 Mar 2005 00:29:46 -0800 (PST)
>>To: user@struts.apache.org
>>Subject: parameter passing from one jsp-screen to
>>another
>>
>>
>>Hi everyone,
>>
>>I have the following problem: how can I pass a
>>parameter from a jsp-screen A to a jsp-screen B
>>within
>>the struts-framework?
>>
>>More concrete:
>>Screen A has several clickable link instances to
>>screen B. Each link instance has its own
>>(dynamically
>>calculated) parameter value to pass to screen B.
>>This parameter is hidden from the sreen.
>>Can someone give me a hint on how this parameter
>>passing can be done in a handy way within struts?
>>
>>Thanks,
>>Jan-Jaap
>>
>>Met vriendelijke groeten,
>>Jan-Jaap Endenburg
>>
>>
>>
>>
>>__________________________________
>>Celebrate Yahoo!'s 10th Birthday!
>>Yahoo! Netrospective: 100 Moments of the Web
>>http://birthday.yahoo.com/netrospective/
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
>>
>>
>>
>--------------------------------------------------------------------
>
>
>>mail2web - Check your email from the web at
>>http://mail2web.com/ .
>>
>>
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
>>
>>
>
>
>
>
>__________________________________
>Celebrate Yahoo!'s 10th Birthday!
>Yahoo! Netrospective: 100 Moments of the Web
>http://birthday.yahoo.com/netrospective/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
Re: Hidden parameter passing: RE: parameter passing from one jsp-screen
to another
Posted by Jan-Jaap Endenburg - Vera <jj...@vera.be>.
Erik,
I implemented it in this way: thank you for your help!
Jan-Jaap
Erik Weber wrote:
> Well, this is not great nice solution in my opinion, but it does seem
> to be popular. This requires you to have a form on screen A and to use
> POST instead of GET to request screen B. Also, it requires JavaScript.
>
> You could make all your links have the same URL, but put an "onclick"
> JavaScript handler with a different parameter on each one (most of the
> Struts HTML tags support the onclick, onsubmit, etc., attributes). The
> onclick handler does two things when you click the link:
>
> 1) sets the value of a hidden variable in the form
> 2) submits the form
>
> So basically, you are turning your hyperlink into a submit button.
>
> On the server, you now have the request parameter just as before, only
> now it comes from a form field instead of a query string variable.
>
> You have to realize, though, that the value isn't truly hidden from
> the user (or from a network snooper) -- the user can view the HTML
> source to see what value gets sent with each click, and the parameter
> is still delivered in a request packet (though it won't show up in a
> URL request log). But, you won't see this parameter in a typical
> browser status bar when you hover your mouse pointer over the link, or
> in the address bar after your browser starts receiving the response.
>
> Perhaps someone else might have another solution. This is the one that
> came to mind.
>
> Erik
>
>
>
>
> jj endenburg wrote:
>
>> Thank you Erik!
>>
>> Actually, the information in my question was not
>> complete. I am sorry for this...
>> The parameter to pass from jsp-screen A to jsp-screen
>> B should stay hidden from the end-user.
>> This is why displaying this parameter in the URL is
>> not possible, unfortunately.
>> Instead of this, how can I pass this parameter within
>> Struts, without the end-user being able to see it?
>>
>> Thank you,
>> Jan-Jaap
>>
>> --- "erikweber@mindspring.com"
>> <er...@mindspring.com> wrote:
>>
>>
>>> Well, how about using a query string parameter in
>>> your links?
>>>
>>> http://foo.com/myapp/bar.jsp?itemId=1
>>> http://foo.com/myapp/bar.jsp?itemId=2
>>>
>>> And so on?
>>>
>>> The Struts html:link tag (or the JSTL c:url tag) can
>>> be used to dynamically
>>> create your links.
>>>
>>>
>>>
>>
>> http://struts.apache.org/userGuide/struts-html.html#link
>>
>>
>>> Hope that helps,
>>>
>>> Erik
>>>
>>>
>>> Original Message:
>>> -----------------
>>> From: jj endenburg endenburgjj@yahoo.com
>>> Date: Tue, 8 Mar 2005 00:29:46 -0800 (PST)
>>> To: user@struts.apache.org
>>> Subject: parameter passing from one jsp-screen to
>>> another
>>>
>>>
>>> Hi everyone,
>>>
>>> I have the following problem: how can I pass a
>>> parameter from a jsp-screen A to a jsp-screen B
>>> within
>>> the struts-framework?
>>>
>>> More concrete:
>>> Screen A has several clickable link instances to
>>> screen B. Each link instance has its own
>>> (dynamically
>>> calculated) parameter value to pass to screen B.
>>> This parameter is hidden from the sreen.
>>> Can someone give me a hint on how this parameter
>>> passing can be done in a handy way within struts?
>>>
>>> Thanks,
>>> Jan-Jaap
>>>
>>> Met vriendelijke groeten,
>>> Jan-Jaap Endenburg
>>>
>>>
>>>
>>>
>>> __________________________________ Celebrate Yahoo!'s 10th Birthday!
>>> Yahoo! Netrospective: 100 Moments of the Web
>>> http://birthday.yahoo.com/netrospective/
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>
>>
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>
>> --------------------------------------------------------------------
>>
>>
>>> mail2web - Check your email from the web at
>>> http://mail2web.com/ .
>>>
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>>
>>
>>> To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail:
>>> user-help@struts.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>>
>> __________________________________ Celebrate Yahoo!'s 10th Birthday!
>> Yahoo! Netrospective: 100 Moments of the Web
>> http://birthday.yahoo.com/netrospective/
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Hidden parameter passing: RE: parameter passing from one jsp-screen
to another
Posted by Erik Weber <er...@mindspring.com>.
Well, this is not great nice solution in my opinion, but it does seem to
be popular. This requires you to have a form on screen A and to use POST
instead of GET to request screen B. Also, it requires JavaScript.
You could make all your links have the same URL, but put an "onclick"
JavaScript handler with a different parameter on each one (most of the
Struts HTML tags support the onclick, onsubmit, etc., attributes). The
onclick handler does two things when you click the link:
1) sets the value of a hidden variable in the form
2) submits the form
So basically, you are turning your hyperlink into a submit button.
On the server, you now have the request parameter just as before, only
now it comes from a form field instead of a query string variable.
You have to realize, though, that the value isn't truly hidden from the
user (or from a network snooper) -- the user can view the HTML source to
see what value gets sent with each click, and the parameter is still
delivered in a request packet (though it won't show up in a URL request
log). But, you won't see this parameter in a typical browser status bar
when you hover your mouse pointer over the link, or in the address bar
after your browser starts receiving the response.
Perhaps someone else might have another solution. This is the one that
came to mind.
Erik
jj endenburg wrote:
>Thank you Erik!
>
>Actually, the information in my question was not
>complete. I am sorry for this...
>The parameter to pass from jsp-screen A to jsp-screen
>B should stay hidden from the end-user.
>This is why displaying this parameter in the URL is
>not possible, unfortunately.
>Instead of this, how can I pass this parameter within
>Struts, without the end-user being able to see it?
>
>Thank you,
>Jan-Jaap
>
>--- "erikweber@mindspring.com"
><er...@mindspring.com> wrote:
>
>
>>Well, how about using a query string parameter in
>>your links?
>>
>>http://foo.com/myapp/bar.jsp?itemId=1
>>http://foo.com/myapp/bar.jsp?itemId=2
>>
>>And so on?
>>
>>The Struts html:link tag (or the JSTL c:url tag) can
>>be used to dynamically
>>create your links.
>>
>>
>>
>>
>http://struts.apache.org/userGuide/struts-html.html#link
>
>
>>Hope that helps,
>>
>>Erik
>>
>>
>>Original Message:
>>-----------------
>>From: jj endenburg endenburgjj@yahoo.com
>>Date: Tue, 8 Mar 2005 00:29:46 -0800 (PST)
>>To: user@struts.apache.org
>>Subject: parameter passing from one jsp-screen to
>>another
>>
>>
>>Hi everyone,
>>
>>I have the following problem: how can I pass a
>>parameter from a jsp-screen A to a jsp-screen B
>>within
>>the struts-framework?
>>
>>More concrete:
>>Screen A has several clickable link instances to
>>screen B. Each link instance has its own
>>(dynamically
>>calculated) parameter value to pass to screen B.
>>This parameter is hidden from the sreen.
>>Can someone give me a hint on how this parameter
>>passing can be done in a handy way within struts?
>>
>>Thanks,
>>Jan-Jaap
>>
>>Met vriendelijke groeten,
>>Jan-Jaap Endenburg
>>
>>
>>
>>
>>__________________________________
>>Celebrate Yahoo!'s 10th Birthday!
>>Yahoo! Netrospective: 100 Moments of the Web
>>http://birthday.yahoo.com/netrospective/
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
>>
>>
>>
>--------------------------------------------------------------------
>
>
>>mail2web - Check your email from the web at
>>http://mail2web.com/ .
>>
>>
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
>>
>>
>
>
>
>
>__________________________________
>Celebrate Yahoo!'s 10th Birthday!
>Yahoo! Netrospective: 100 Moments of the Web
>http://birthday.yahoo.com/netrospective/
>
>---------------------------------------------------------------------
>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: Hidden parameter passing: RE: parameter passing from one jsp-screen
to another
Posted by Rick Reumann <st...@reumann.net>.
jj endenburg wrote the following on 3/8/2005 5:43 AM:
> Actually, the information in my question was not
> complete. I am sorry for this...
> The parameter to pass from jsp-screen A to jsp-screen
> B should stay hidden from the end-user.
> This is why displaying this parameter in the URL is
> not possible, unfortunately.
> Instead of this, how can I pass this parameter within
> Struts, without the end-user being able to see it?
Why not just set the param in the Session and pull it from there? Before
you leave your servlet/action place a param in Session scope and you'll
have it again later whenever you need it. Have to be careful you don't
get tripped up though with the var being around when you think it isn't.
At least the value will be hidden.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org