You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2009/08/04 19:56:10 UTC

equivalent of request.getParameter();

In servlets we can do request.getParameter("someParm"); to gain access to
parameters passed to the jsp.
what is the equivalent of this in struts2?

is there an html tag for this?

Re: equivalent of request.getParameter();

Posted by Chris Pratt <th...@gmail.com>.
RequestAware gives you access to the Request Attribute map, not the
Parameter map.  You can use ParameterAware to get the Map of Parameters or
ServletRequestAware to get access to the HttpServletRequest directly.  But
the best way to get access to values from forms or query strings is to allow
Struts to inject the values into you action automatically.  By default if
you have:

<input type="text" name="fieldOne"/>

in your HTML, Struts will look for and call

public void setFieldOne (String fieldOne) {
  // do something with the value
}

automatically for you.
  (*Chris*)

On Tue, Aug 4, 2009 at 11:00 AM, Kawczynski, David <
david_kawczynski@merck.com> wrote:

> Implement the requestAware interface to have access to a Map containing
> request parameters as name-value pairs.
> In terms of an html tag, use OGNL to get to the request parameters.
> Especially the #request object.  EG %{#request.someParam}
>
> > -----Original Message-----
> > From: Bhaarat Sharma [mailto:bhaarat.s@gmail.com]
> > Sent: Tuesday, August 04, 2009 1:56 PM
> > To: Struts Users Mailing List
> > Subject: equivalent of request.getParameter();
> >
> > In servlets we can do request.getParameter("someParm"); to
> > gain access to
> > parameters passed to the jsp.
> > what is the equivalent of this in struts2?
> >
> > is there an html tag for this?
> >
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or
> MSD and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and
> then delete it from your system.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: equivalent of request.getParameter();

Posted by "Kawczynski, David" <da...@merck.com>.
Ajax call?  ESP?  

> -----Original Message-----
> From: Bhaarat Sharma [mailto:bhaarat.s@gmail.com] 
> Sent: Tuesday, August 04, 2009 2:10 PM
> To: Struts Users Mailing List
> Subject: Re: equivalent of request.getParameter();
> 
> Thanks.
> I have another question, which might be a little off topic.
> 
> if I have a method like this in my Action class
> 
>     public void setPrinter(String print)
>     {
>         this.printer = print;
>     }
> 
> how can I call this setter with some value from my jsp page 
> using struts2?
> 
> I know this can be set if I submit a form with hidden value 
> and stuff but I
> dont want to submit a form. I just want to set the value from 
> the jsp page.
> ..
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


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


Re: equivalent of request.getParameter();

Posted by mu...@aol.com.
 



it possible to not click any url but
still set a setter


 If you don't need any user interraction why not do it in the action? It is not clear what
would be the point of a view that without any user input then proceeds to do further logic...
Chris 


 


 

-----Original Message-----
From: Bhaarat Sharma <bh...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Tue, Aug 4, 2009 2:25 pm
Subject: Re: equivalent of request.getParameter();










thanks wes. so when that url will be clicked the setter will be set.
...maybe pushing the envelope but is it possible to not click any url but
still set a setter. just like we call a getter.
<s:property value = "%{stuff}"/>



On Tue, Aug 4, 2009 at 2:22 PM, Bhaarat Sharma <bh...@gmail.com> wrote:

> wow ..just explaining the problem i figured out I can just avoid doing what
> i was thinking and just check for request.getParamter() inside the action
> class.
> anyways...still curious if there is a way to set a setter w/out doing form
> submission..
>
>
> On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma <bh...@gmail.com>wrote:
>
>> I know its not the best case scenario.  If i can do this then I will not
>> have to change major piece of the code.
>> I'll try to explain the scenario: basically one jsp page is used to show
>> results. this jsp page has pagination so each time 50 results are shown. But
>> the page has a printer friendly version.  when printer friendly link is
>> clicked this same jsp page is loaded again but this time around we want to
>> print everything not just 50 records. so in my action class there is a
>> method which returns sublist. but in this case i want it to return the whole
>> list.
>>
>> So in the jsp i know when printerfriendly is taking place because it is
>> being passed a parameter called ?print=true
>>
>> so i thought that in jsp i could check if print=true then set action class
>> Printer method to true. ....kind of confusing i bet it sounds..
>>
>>
>> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher <we...@wantii.com> wrote:
>>
>>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com>
>>> wrote:
>>> > Thanks.
>>> > I have another question, which might be a little off topic.
>>> >
>>> > if I have a method like this in my Action class
>>> >
>>> >    public void setPrinter(String print)
>>> >    {
>>> >        this.printer = print;
>>> >    }
>>> >
>>> > how can I call this setter with some value from my jsp page using
>>> struts2?
>>> >
>>> > I know this can be set if I submit a form with hidden value and stuff
>>> but I
>>> > dont want to submit a form. I just want to set the value from the jsp
>>> page.
>>> > ..
>>> >
>>>
>>> At which point will that value be used? If you need to know the value
>>> of the 'print' variable within the execute method of your action, then
>>> it should be part of the form submission... In fact, I am having
>>> trouble thinking of a scenario where you would want to call that sort
>>> of method from a JSP that doesn't involve form submission (except
>>> javascript, but still, just calling a setter alone doesn't really have
>>> any effect unless you are calling another action method afterwards
>>> that has an interest in that variable's value).
>>>
>>> -Wes
>>>
>>> --
>>> Wes Wannemacher
>>>
>>> Head Engineer, WanTii, Inc.
>>> Need Training? Struts, Spring, Maven, Tomcat...
>>> Ask me for a quote!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>



 


Re: equivalent of request.getParameter();

Posted by Greg Lindholm <gr...@gmail.com>.
@OP: You should listen to Wes, he knows what he's talking about.  There is
no reason to call a setter on your action after the action method has
executed and the jsp result page is being rendered. (OK, maybe if the setter
has some side effect, but this would be a really odd case and a bad design.)

You would be better off explaining what behavior you are trying to achieve
and asking how it's done with struts.


On Tue, Aug 4, 2009 at 3:57 PM, Wes Wannemacher <we...@wantii.com> wrote:

> On Tue, Aug 4, 2009 at 2:25 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
> > thanks wes. so when that url will be clicked the setter will be set.
> > ...maybe pushing the envelope but is it possible to not click any url but
> > still set a setter. just like we call a getter.
> > <s:property value = "%{stuff}"/>
> >
> >
> >
>
>
> The paradigms are different... in your little example, the getter is
> called, yes, but you are looking at a "view" of your data, so it sort
> of makes sense that you can get to getters. I am sure there is a way
> to get to setters, but what I was trying to get to before is that
> there doesn't appear to be any good reason to call a setter when you
> are rendering a view (unless you are going to read that value from the
> action further down the page, but why use an action property for
> that)... What I am trying to say is that you send parameters to
> struts, struts performs some magic (well, not really) that converts
> those parameters and calls your setters, then struts calls your
> action's business method (most likely 'public String execute()') and
> returns a string indicating to struts which view to render. What
> you're asking is how to call a setter from the last step... What I am
> saying is that it's only really helpful to call a setter if you are
> planning on calling an action method afterwards. Calling an action
> method means making some sort of call back to your server. So,
> construct an URL that specifies the appropriate parameters, then hit
> that URL... whether you do it by clicking, async JS, trojan horse,
> whatever, it doesn't matter.
>
> To answer your question (after making the point that it may be
> useless), you can probably call your setter by doing -
>
> <s:property value="%{setStuff('string value')}" />
>
> You might have to do this -
>
> <s:property value="%{#top.setStuff('string value')}" />
>
> or
>
> <s:property value="%{#action.setStuff('string value')}" />
>
> again, though, I question the point because this will happen after
> your business method has returned and further requests to your action
> will result in the creation of a new instance of your action (meaning
> that setter call will have no discernible purpose, it won't even
> output anything).
>
> -Wes
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: equivalent of request.getParameter();

Posted by Musachy Barroso <mu...@gmail.com>.
On Tue, Aug 4, 2009 at 12:57 PM, Wes Wannemacher<we...@wantii.com> wrote:
>
> <s:property value="%{#top.setStuff('string value')}" />

<s:property value="%{top.setStuff('string value')}" />

If my memory is not failing "#top" doesn't work, it has to be "top".

musachy

-- 
"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: equivalent of request.getParameter();

Posted by Wes Wannemacher <we...@wantii.com>.
On Tue, Aug 4, 2009 at 2:25 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
> thanks wes. so when that url will be clicked the setter will be set.
> ...maybe pushing the envelope but is it possible to not click any url but
> still set a setter. just like we call a getter.
> <s:property value = "%{stuff}"/>
>
>
>


The paradigms are different... in your little example, the getter is
called, yes, but you are looking at a "view" of your data, so it sort
of makes sense that you can get to getters. I am sure there is a way
to get to setters, but what I was trying to get to before is that
there doesn't appear to be any good reason to call a setter when you
are rendering a view (unless you are going to read that value from the
action further down the page, but why use an action property for
that)... What I am trying to say is that you send parameters to
struts, struts performs some magic (well, not really) that converts
those parameters and calls your setters, then struts calls your
action's business method (most likely 'public String execute()') and
returns a string indicating to struts which view to render. What
you're asking is how to call a setter from the last step... What I am
saying is that it's only really helpful to call a setter if you are
planning on calling an action method afterwards. Calling an action
method means making some sort of call back to your server. So,
construct an URL that specifies the appropriate parameters, then hit
that URL... whether you do it by clicking, async JS, trojan horse,
whatever, it doesn't matter.

To answer your question (after making the point that it may be
useless), you can probably call your setter by doing -

<s:property value="%{setStuff('string value')}" />

You might have to do this -

<s:property value="%{#top.setStuff('string value')}" />

or

<s:property value="%{#action.setStuff('string value')}" />

again, though, I question the point because this will happen after
your business method has returned and further requests to your action
will result in the creation of a new instance of your action (meaning
that setter call will have no discernible purpose, it won't even
output anything).

-Wes

-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: equivalent of request.getParameter();

Posted by Bhaarat Sharma <bh...@gmail.com>.
thanks wes. so when that url will be clicked the setter will be set.
...maybe pushing the envelope but is it possible to not click any url but
still set a setter. just like we call a getter.
<s:property value = "%{stuff}"/>



On Tue, Aug 4, 2009 at 2:22 PM, Bhaarat Sharma <bh...@gmail.com> wrote:

> wow ..just explaining the problem i figured out I can just avoid doing what
> i was thinking and just check for request.getParamter() inside the action
> class.
> anyways...still curious if there is a way to set a setter w/out doing form
> submission..
>
>
> On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma <bh...@gmail.com>wrote:
>
>> I know its not the best case scenario.  If i can do this then I will not
>> have to change major piece of the code.
>> I'll try to explain the scenario: basically one jsp page is used to show
>> results. this jsp page has pagination so each time 50 results are shown. But
>> the page has a printer friendly version.  when printer friendly link is
>> clicked this same jsp page is loaded again but this time around we want to
>> print everything not just 50 records. so in my action class there is a
>> method which returns sublist. but in this case i want it to return the whole
>> list.
>>
>> So in the jsp i know when printerfriendly is taking place because it is
>> being passed a parameter called ?print=true
>>
>> so i thought that in jsp i could check if print=true then set action class
>> Printer method to true. ....kind of confusing i bet it sounds..
>>
>>
>> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher <we...@wantii.com> wrote:
>>
>>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com>
>>> wrote:
>>> > Thanks.
>>> > I have another question, which might be a little off topic.
>>> >
>>> > if I have a method like this in my Action class
>>> >
>>> >    public void setPrinter(String print)
>>> >    {
>>> >        this.printer = print;
>>> >    }
>>> >
>>> > how can I call this setter with some value from my jsp page using
>>> struts2?
>>> >
>>> > I know this can be set if I submit a form with hidden value and stuff
>>> but I
>>> > dont want to submit a form. I just want to set the value from the jsp
>>> page.
>>> > ..
>>> >
>>>
>>> At which point will that value be used? If you need to know the value
>>> of the 'print' variable within the execute method of your action, then
>>> it should be part of the form submission... In fact, I am having
>>> trouble thinking of a scenario where you would want to call that sort
>>> of method from a JSP that doesn't involve form submission (except
>>> javascript, but still, just calling a setter alone doesn't really have
>>> any effect unless you are calling another action method afterwards
>>> that has an interest in that variable's value).
>>>
>>> -Wes
>>>
>>> --
>>> Wes Wannemacher
>>>
>>> Head Engineer, WanTii, Inc.
>>> Need Training? Struts, Spring, Maven, Tomcat...
>>> Ask me for a quote!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>

Re: equivalent of request.getParameter();

Posted by Bhaarat Sharma <bh...@gmail.com>.
wow ..just explaining the problem i figured out I can just avoid doing what
i was thinking and just check for request.getParamter() inside the action
class.
anyways...still curious if there is a way to set a setter w/out doing form
submission..

On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma <bh...@gmail.com> wrote:

> I know its not the best case scenario.  If i can do this then I will not
> have to change major piece of the code.
> I'll try to explain the scenario: basically one jsp page is used to show
> results. this jsp page has pagination so each time 50 results are shown. But
> the page has a printer friendly version.  when printer friendly link is
> clicked this same jsp page is loaded again but this time around we want to
> print everything not just 50 records. so in my action class there is a
> method which returns sublist. but in this case i want it to return the whole
> list.
>
> So in the jsp i know when printerfriendly is taking place because it is
> being passed a parameter called ?print=true
>
> so i thought that in jsp i could check if print=true then set action class
> Printer method to true. ....kind of confusing i bet it sounds..
>
>
> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher <we...@wantii.com> wrote:
>
>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com>
>> wrote:
>> > Thanks.
>> > I have another question, which might be a little off topic.
>> >
>> > if I have a method like this in my Action class
>> >
>> >    public void setPrinter(String print)
>> >    {
>> >        this.printer = print;
>> >    }
>> >
>> > how can I call this setter with some value from my jsp page using
>> struts2?
>> >
>> > I know this can be set if I submit a form with hidden value and stuff
>> but I
>> > dont want to submit a form. I just want to set the value from the jsp
>> page.
>> > ..
>> >
>>
>> At which point will that value be used? If you need to know the value
>> of the 'print' variable within the execute method of your action, then
>> it should be part of the form submission... In fact, I am having
>> trouble thinking of a scenario where you would want to call that sort
>> of method from a JSP that doesn't involve form submission (except
>> javascript, but still, just calling a setter alone doesn't really have
>> any effect unless you are calling another action method afterwards
>> that has an interest in that variable's value).
>>
>> -Wes
>>
>> --
>> Wes Wannemacher
>>
>> Head Engineer, WanTii, Inc.
>> Need Training? Struts, Spring, Maven, Tomcat...
>> Ask me for a quote!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

Re: equivalent of request.getParameter();

Posted by Wes Wannemacher <we...@wantii.com>.
No, it's not confusing, the thing about http / html is that it is
still a submission... Just not using <s:textfield, etc.


Anyhow, on to the answer, just construct a link like this -

<s:url action="..." namespace="..."><s:param name="print" value="true"
/></s:url>

-Wes

On Tue, Aug 4, 2009 at 2:18 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
> I know its not the best case scenario.  If i can do this then I will not
> have to change major piece of the code.
> I'll try to explain the scenario: basically one jsp page is used to show
> results. this jsp page has pagination so each time 50 results are shown. But
> the page has a printer friendly version.  when printer friendly link is
> clicked this same jsp page is loaded again but this time around we want to
> print everything not just 50 records. so in my action class there is a
> method which returns sublist. but in this case i want it to return the whole
> list.
>
> So in the jsp i know when printerfriendly is taking place because it is
> being passed a parameter called ?print=true
>
> so i thought that in jsp i could check if print=true then set action class
> Printer method to true. ....kind of confusing i bet it sounds..
>
> On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher <we...@wantii.com> wrote:
>
>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
>> > Thanks.
>> > I have another question, which might be a little off topic.
>> >
>> > if I have a method like this in my Action class
>> >
>> >    public void setPrinter(String print)
>> >    {
>> >        this.printer = print;
>> >    }
>> >
>> > how can I call this setter with some value from my jsp page using
>> struts2?
>> >
>> > I know this can be set if I submit a form with hidden value and stuff but
>> I
>> > dont want to submit a form. I just want to set the value from the jsp
>> page.
>> > ..
>> >
>>
>> At which point will that value be used? If you need to know the value
>> of the 'print' variable within the execute method of your action, then
>> it should be part of the form submission... In fact, I am having
>> trouble thinking of a scenario where you would want to call that sort
>> of method from a JSP that doesn't involve form submission (except
>> javascript, but still, just calling a setter alone doesn't really have
>> any effect unless you are calling another action method afterwards
>> that has an interest in that variable's value).
>>
>> -Wes
>>
>> --
>> Wes Wannemacher
>>
>> Head Engineer, WanTii, Inc.
>> Need Training? Struts, Spring, Maven, Tomcat...
>> Ask me for a quote!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: equivalent of request.getParameter();

Posted by Bhaarat Sharma <bh...@gmail.com>.
I know its not the best case scenario.  If i can do this then I will not
have to change major piece of the code.
I'll try to explain the scenario: basically one jsp page is used to show
results. this jsp page has pagination so each time 50 results are shown. But
the page has a printer friendly version.  when printer friendly link is
clicked this same jsp page is loaded again but this time around we want to
print everything not just 50 records. so in my action class there is a
method which returns sublist. but in this case i want it to return the whole
list.

So in the jsp i know when printerfriendly is taking place because it is
being passed a parameter called ?print=true

so i thought that in jsp i could check if print=true then set action class
Printer method to true. ....kind of confusing i bet it sounds..

On Tue, Aug 4, 2009 at 2:14 PM, Wes Wannemacher <we...@wantii.com> wrote:

> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
> > Thanks.
> > I have another question, which might be a little off topic.
> >
> > if I have a method like this in my Action class
> >
> >    public void setPrinter(String print)
> >    {
> >        this.printer = print;
> >    }
> >
> > how can I call this setter with some value from my jsp page using
> struts2?
> >
> > I know this can be set if I submit a form with hidden value and stuff but
> I
> > dont want to submit a form. I just want to set the value from the jsp
> page.
> > ..
> >
>
> At which point will that value be used? If you need to know the value
> of the 'print' variable within the execute method of your action, then
> it should be part of the form submission... In fact, I am having
> trouble thinking of a scenario where you would want to call that sort
> of method from a JSP that doesn't involve form submission (except
> javascript, but still, just calling a setter alone doesn't really have
> any effect unless you are calling another action method afterwards
> that has an interest in that variable's value).
>
> -Wes
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: equivalent of request.getParameter();

Posted by Wes Wannemacher <we...@wantii.com>.
On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<bh...@gmail.com> wrote:
> Thanks.
> I have another question, which might be a little off topic.
>
> if I have a method like this in my Action class
>
>    public void setPrinter(String print)
>    {
>        this.printer = print;
>    }
>
> how can I call this setter with some value from my jsp page using struts2?
>
> I know this can be set if I submit a form with hidden value and stuff but I
> dont want to submit a form. I just want to set the value from the jsp page.
> ..
>

At which point will that value be used? If you need to know the value
of the 'print' variable within the execute method of your action, then
it should be part of the form submission... In fact, I am having
trouble thinking of a scenario where you would want to call that sort
of method from a JSP that doesn't involve form submission (except
javascript, but still, just calling a setter alone doesn't really have
any effect unless you are calling another action method afterwards
that has an interest in that variable's value).

-Wes

-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: equivalent of request.getParameter();

Posted by Bhaarat Sharma <bh...@gmail.com>.
Thanks.
I have another question, which might be a little off topic.

if I have a method like this in my Action class

    public void setPrinter(String print)
    {
        this.printer = print;
    }

how can I call this setter with some value from my jsp page using struts2?

I know this can be set if I submit a form with hidden value and stuff but I
dont want to submit a form. I just want to set the value from the jsp page.
..

On Tue, Aug 4, 2009 at 2:00 PM, Kawczynski, David <
david_kawczynski@merck.com> wrote:

> Implement the requestAware interface to have access to a Map containing
> request parameters as name-value pairs.
> In terms of an html tag, use OGNL to get to the request parameters.
> Especially the #request object.  EG %{#request.someParam}
>
> > -----Original Message-----
> > From: Bhaarat Sharma [mailto:bhaarat.s@gmail.com]
> > Sent: Tuesday, August 04, 2009 1:56 PM
> > To: Struts Users Mailing List
> > Subject: equivalent of request.getParameter();
> >
> > In servlets we can do request.getParameter("someParm"); to
> > gain access to
> > parameters passed to the jsp.
> > what is the equivalent of this in struts2?
> >
> > is there an html tag for this?
> >
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
> New Jersey, USA 08889), and/or its affiliates (which may be known
> outside the United States as Merck Frosst, Merck Sharp & Dohme or
> MSD and in Japan, as Banyu - direct contact information for affiliates is
> available at http://www.merck.com/contact/contacts.html) that may be
> confidential, proprietary copyrighted and/or legally privileged. It is
> intended solely for the use of the individual or entity named on this
> message. If you are not the intended recipient, and have received this
> message in error, please notify us immediately by reply e-mail and
> then delete it from your system.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: equivalent of request.getParameter();

Posted by "Kawczynski, David" <da...@merck.com>.
Implement the requestAware interface to have access to a Map containing
request parameters as name-value pairs.
In terms of an html tag, use OGNL to get to the request parameters.
Especially the #request object.  EG %{#request.someParam}

> -----Original Message-----
> From: Bhaarat Sharma [mailto:bhaarat.s@gmail.com] 
> Sent: Tuesday, August 04, 2009 1:56 PM
> To: Struts Users Mailing List
> Subject: equivalent of request.getParameter();
> 
> In servlets we can do request.getParameter("someParm"); to 
> gain access to
> parameters passed to the jsp.
> what is the equivalent of this in struts2?
> 
> is there an html tag for this?
> 
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


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