This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Using ActionFormClass for multiple forms Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Using ActionFormClass for multiple forms" Watch "Using ActionFormClass for multiple forms" New topic
Author

Using ActionFormClass for multiple forms

Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi,

Can anyone tell is there a way to Use same ActionForm Class from different forms(JSP pages).

I used the mapping's name property and tried to do this, But is there
any other Efficient way to do this?.

Plese write if you know.

thanks
Anurag


SCJP 1.2
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4725

The mappings' name attribute is what you do.


A good workman is known by his tools.
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
yes, i just differentiate the logic based on mapping's name in such a way

String formName = mapping.getName();

if(formName.equals("firstForm"))
{

}
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
yes, i just differentiate the logic based on mapping's name in such a way

String formName = mapping.getName();

if(formName.equals("firstForm"))
{
//do something
}
else if(formName.equals("secondForm"))
{
//do somethig Extra

}

thanks
Anurag
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Using ActionFormClass for multiple forms
 
Similar Threads
Forms in Java/Servlets
DynaValidatorActionForm sublclass (specialization)
how to Evaluate the online exam question.
submit nested form ?
Multiple forms using same radio button choice