Solved

actionmapping

Posted on 2003-10-23
5
194 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
Comment Utility
mapping.getPath()

?
0
 
LVL 1

Author Comment

by:soft_techy
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now