Solved

actionmapping

Posted on 2003-10-23
5
199 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 58
web application structure 18 77
servlet example 17 33
ejb on wildfly 5 20
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

825 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