struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shashi" <shashipa...@hotmail.com>
Subject Re: Use of DispatchAction class
Date Tue, 18 Feb 2003 05:04:43 GMT
Thanks alot for help me to solveing the issue.




----- Original Message -----
From: "Brandon Goodin" <mail@phase.ws>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Monday, February 17, 2003 10:28 PM
Subject: RE: Use of DispatchAction class


> You would retrieve the hidden form property like any other.
>
> In other words you have a hidden form element:
> <input type="hidden" name="myProperty" value="Be cool"/>
>
> In you action form you have a property with setter/getter:
>
> public MyActionForm extends ActionForm {
>
> ...
> protected String myProperty;
>
> ...
> public void setMyProperty(String myProperty) {
>
> this.myProperty = myProperty;
>
> }
>
> public String getMyProperty() {
>
> return this.myProperty;
>
> }
>
> }
>
> In your Action class you would access the ActionForm from within your
> execute or lookupMethod(DispatchAction) and retrieve the property value:
>
> public MyAction extends Action {
>
> ...
>
> public ActionForward execute(
> ActionMapping mapping,
> ActionForm form,
> HttpServletRequest request,
> HttpServletResponse response) {
>
> MyActionForm myActionForm = (MyActionForm)form;
>
> String myProperty = myActionForm.getMyProperty();
>
> // perform logic/model calls
>
> return mapping.findForward("success");
> }
>
> ...
>
> }
>
>
> Brandon Goodin
> Phase Web and Multimedia
> PO Box 85
> Whitefish MT 59937
> P (406) 862-2245
> F (406) 862-0354
> mail@phase.ws
> http://www.phase.ws
>
>
> -----Original Message-----
> From: shashi [mailto:shashipahwa@hotmail.com]
> Sent: Monday, February 17, 2003 5:47 AM
> To: Struts Users Mailing List
> Subject: Re: Use of DispatchAction class
>
>
> Thanks Alot
>
> If  I make a method with  the name of hidden field parameter in the Bean
> Class and give as parameter in the structs_config.xml.
>
> Is it helpful for me to find the hidden field value in the class which is
> extended the Action class.
>
> Regards
>
> Shashi
>
>
>
>
> ----- Original Message -----
> From: "Alex McLintock" <alex@OWAL.co.uk>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Monday, February 17, 2003 6:17 PM
> Subject: Re: Use of DispatchAction class
>
>
> > At 10:59 17/02/03, shashi wrote:
> > >I am new in the struts and working on a form in which i want to use the
> > >hidden fields in my Action class.
> > >Please give me any idea regarding how i can implement the functionalty.
> >
> >
> > Hello,
> >
> > You may find Ted Husted's Artimus example useful. It has a form with
> hidden
> > fields in it. I think it is the article editing form - you need the
> article
> > id in a field - but it shouldn't be edited by the user - therefore it is
> > put into a hidden field.
> >
> > I can't remember the URL for the WAR file download off the top of my
head.
> > Either Ted can remind us, or you can do a google search.
> >
> > Goodluck
> >
> > Alex
> >
> >
> >
> > Available for java/perl/C++/web development in London, UK or nearby.
> > Apache FOP, Cocoon, Turbine, Struts,XSL:FO, XML, Tomcat, JSP
> > http://www.OWAL.co.uk/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>

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


Mime
View raw message