aspose file tools*
The moose likes Struts and the fly likes Navigation Problem, Please Help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Navigation Problem, Please Help me" Watch "Navigation Problem, Please Help me" New topic
Author

Navigation Problem, Please Help me

Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Hello All,

I have a form. on submitting that form, i need to do two types of actions

1. if validation errors occurs i need to redirect to the same form with errors in the same window.

2. if no validation errors then i need to save the form information and close the window.

Can anybody have suggestions?

My question is how to from javascript that no validation errors occured from struts side?

Thanks,
Srilakshmi
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Create a file called closeWindow.htm with the following tag:


(The above on load should be all one word with no spaces, but for some reason the the program used by javarach wouldn't let me post it as one word)

Follow the normal procedure for a struts action: Create two local forwards, for "success" and "failure". Have "failure" forward back to the original jsp and have your "success" forward to closeWindow.htm.


Merrill
Consultant, Sima Solutions
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Thanks Merrill. I will try and let you know how it worked.

Is there anything direct method? without the closeWindow
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
Thanks All!!

It worked perfect!
 
Consider Paul's rocket mass heater.
 
subject: Navigation Problem, Please Help me