struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wes Wannemacher <>
Subject Re: equivalent of request.getParameter();
Date Tue, 04 Aug 2009 18:14:03 GMT
On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<> 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 Wannemacher

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message