wood burning stoves 2.0*
The moose likes Struts and the fly likes Connecting two actions to the same ActionForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Connecting two actions to the same ActionForm" Watch "Connecting two actions to the same ActionForm" New topic

Connecting two actions to the same ActionForm

Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361

Can I connect two actions in struts to the same action form.
The page I am developing is full of drop down lists. The first action for example [init_register.do] will initialize all drop down lists.

Why I want to do this ??

Because I am using the Struts Validator framework [Validation rules through validation.xml], so I cannot initialize the lists through the same action because validation rules will prevent from reaching that action till all form data is valid.

I am going in the right approach.

Thanks in advance.

Khaled Mahmoud
CRM Developer

SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
Palak Shah

Joined: Jan 21, 2005
Posts: 18
yes you can... just give name="sameForm" in both actions. Also mention validate="false" in the action where you don't want to validate but just wanna initialize....

Palak Shah,<br />SCJP (85%), SCWCD (84%), SCBCD (95%).
It is sorta covered in the JavaRanch Style Guide.
subject: Connecting two actions to the same ActionForm
Similar Threads
Server side validation question
Submitting hidden values on the form with onSelect option
Dynamic action path to share same validation configuration
Retaining List Values After Validating - Is there a way?
Fill An Option with data