File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Using validate with different input jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using validate with different input jsps" Watch "Using validate with different input jsps" New topic

Using validate with different input jsps

sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
Hi i have an action mapping called '/register' and 3 of my jsps use that action mapping. Now in case there is an error on the validate of the form bean ( 1 action means 1 form bean ), i need to set the input to the page that sent the request originally so i cannot have a input = ??
hard coded in the action mapping. If i try to set the input parameter of the mapping on the fly, i get an IllegalStateException as the action config is frozen.
Does anyone know how to achieve this.

Sazzad Rafique

Joined: Jul 29, 2003
Posts: 5
I had the same situation. What I did was just writing 3 action mappings having almost the same thing inside except that the "path" and the "input" attrbutes were different. the page mentioned in the input attribute is the place where you mention the page to be shown in case of validation error. though the path attribute is different but the type attribute will be the same for all the three action mappings. so the same action class will handle the action.
I agree. Here's the link:
subject: Using validate with different input jsps
It's not a secret anymore!