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 <[email protected]> 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 <[email protected]>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 <[email protected]> wrote: >> >>> On Tue, Aug 4, 2009 at 2:09 PM, Bhaarat Sharma<[email protected]> >>> 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: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >> >

