File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes New to Struts - Mappings/Forwards problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "New to Struts - Mappings/Forwards problem " Watch "New to Struts - Mappings/Forwards problem " New topic
Author

New to Struts - Mappings/Forwards problem

beth ana
Greenhorn

Joined: Jul 07, 2004
Posts: 11
Hi,
I am using JSP[Struts] that has a cancel button. But when i click the cancel button I want to go back to the page or action I came from.
I am using the same JSP for two different scenarios, which shows different data. So, the forwards are different based on the scenario. If I explained properly...

Anybody's help is highly appreciated.

[ July 30, 2004: Message edited by: beth ana ]
[ July 30, 2004: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Moving to the Frameworks forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29237
    
139

Beth,
You can use javascript to change the action based on the page.


[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
beth ana
Greenhorn

Joined: Jul 07, 2004
Posts: 11
I have no idea to do that. Can you please attach a sample code?
honey
Greenhorn

Joined: Jul 15, 2004
Posts: 2
http://www.exadel.com/products_tutorials.htm

more examples that will help u for drop down adding items. The examples were in the above side there were many pdf files which contains detail examples.
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
There is another solution, using formless buttons.

Define a simple form with no properties:


Struts config file:


JSP page:
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
"honey",

Your display name does not comply with our naming policy. Please change it a.s.a.p.

Thank you.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29237
    
139

Beth,
This example shows how to dynamically change the action as I was trying to explain above.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: New to Struts - Mappings/Forwards problem
 
Similar Threads
isCancelled(request) not invoked
Reading .properties File From Action Form
How to disable the validation when th Cancel button is clicked (usingStrut validator)
My First Struts App
[TILES] How to include an action as body in a definition [SOLVED]