File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes A big problem for me in Action Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "A big problem for me in Action Mapping" Watch "A big problem for me in Action Mapping" New topic

A big problem for me in Action Mapping

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 131
I have a action mapping as below,
<action path="/pages/sessioninvalid"
<forward name="success" path="/pages/index.jsp"
redirect="false" />
Then i have jsp called include.jsp in "pages" folder
with following line of code
String user = (String)session.getAttribute("user");
if (user == null)
System.out.println("there is no user so invalid
Then I include this jsp in all my pages to check if
the session is valid or not,
I have some jsp in folder "pages" and some jsp in
subfolder in side pages (say "planning")
now the code in include.jsp works very well in all the
jsp in "pages" folder,
but it does not work in jsp in subfolders, i get the
following error
2002-10-02 18:06:44,078 INFO [HttpProcessor[8080][3]]
action.RequestProcessor ( -
Processing a 'GET' for path
2002-10-02 18:06:44,078 ERROR [HttpProcessor[8080][3]]
action.RequestProcessor ( -
Invalid path /pages/planning/sessioninvalid was
so what is wrong if i have to make it work how can i
do it..
thanx in advance

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Despite the fact that both traditional file paths and URLs can be represented with "/"s in them, an URL only actually represents subdirectories if the webserver wants them to to so. Or, as I periodically chant: "A Web Server is NOT a File Server".
In the case of Struts, I've noticed that the Struts Action Servlet will generally consume URL subpaths but not use them for location purposes.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: A big problem for me in Action Mapping
It's not a secret anymore!