Two Laptop Bag*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using validate with different input jsps" Watch "Using validate with different input jsps" New topic
Author

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.
TIA
S


Adios
Sazzad Rafique
Greenhorn

Joined: Jul 29, 2003
Posts: 5
Hi,
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.
 
Consider Paul's rocket mass heater.
 
subject: Using validate with different input jsps
 
Similar Threads
Redirecting to the JSP when validation error occurs
Populating List thru logic:iterate , The modified List is not reaching action
problem in getting data from request
Struts Validation
Behaviour on failure of validate in form bean