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
[EMAIL PROTECTED]
http://www.phase.ws


-----Original Message-----
From: shashi [mailto:[EMAIL PROTECTED]]
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" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to