Solved

actionmapping

Posted on 2003-10-23
5
206 Views
Last Modified: 2010-03-31
I'm using struts
My webapplication contains 5 JSP Pages, all of the pages have a button which corresponds to single action.

How can i know in my Action class that the request came  from which page?, beacause if the calling page is 1 i have to forward to page 2, and like that i have different combinations

Thanks
0
Comment
Question by:soft_techy
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9608934
mapping.getPath()

?
0
 
LVL 1

Author Comment

by:soft_techy
ID: 9611438
it is giving my action path, i have same action in all pages
0
 
LVL 2

Accepted Solution

by:
f_98 earned 50 total points
ID: 9620018
try getting the headers; i believe it stores a referrer attribute; dont know if this applies for all
apps thoughl. you may want to print out all header names just to be sure

Enumeration e = request.getHeaderNames();

String source = null;

while (e.hasMoreElements())
{
    String key = (String)e.nextElement();
    if (key.equals("referrer"))
    {
        source = request.getHeader(key);
        break;
    }
}
0
 
LVL 92

Expert Comment

by:objects
ID: 10215129
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept f_98's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

objects
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hibernate jars 4 57
Delete Android all or certain applications data programmatically 9 106
Desingning Refactoring existing code 2 31
ejb entity bean example 2 31
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question