This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes How to do it in Struts, pls. help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to do it in Struts, pls. help!" Watch "How to do it in Struts, pls. help!" New topic
Author

How to do it in Struts, pls. help!

Bob Green
Ranch Hand

Joined: Feb 29, 2004
Posts: 93
I have a main jsp, let call it jsp1. jsp1 has a hyperlink; when the link is clicked, it opens another jsp window, let name it jsp2. In jsp2, there are two buttons, Submit and Cancel. When the cancel button is clicked, it goes back to jsp1 and closes jsp2 window. When the submit button is clicked, it validates the inputs; if there is no error, it also goes back to jsp1 and closes jsp2 window. If any errors occur, it displays the error messages in jsp2.
Can someone know how to implement the above requirement with Struts?

Thanks!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Bob,
That's a lot of questions! Let's look at which Struts technologies to use for the different parts of your requirements:

"I have a main jsp, let call it jsp1. jsp1 has a hyperlink; when the link is clicked, it opens another jsp window, let name it jsp2." - javascript for pop up and struts config file for link to jsp2

"In jsp2, there are two buttons, Submit and Cancel." - html submit and cancel tags in Struts

"When the cancel button is clicked, it goes back to jsp1 and closes jsp2 window. " - again javascript to close the window and struts config for link

"When the submit button is clicked, it validates the inputs; if there is no error, it also goes back to jsp1 and closes jsp2 window. If any errors occur, it displays the error messages in jsp2." - Struts validation framework. Note that you may run into some trouble on this requirement. I don't think you can redirect to different pages easily.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to do it in Struts, pls. help!