• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A big problem for me in Action Mapping

 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a action mapping as below,
<action path="/pages/sessioninvalid"
type="com.myapp.action.SessionInvalidAction"
scope="request">
<forward name="success" path="/pages/index.jsp"
redirect="false" />
</action>
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
session");
request.getRequestDispatcher("sessioninvalid.do").forward(request,
response);
}
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 (RequestProcessor.java:217) -
Processing a 'GET' for path
'/pages/planning/sessioninvalid'
2002-10-02 18:06:44,078 ERROR [HttpProcessor[8080][3]]
action.RequestProcessor (RequestProcessor.java:645) -
Invalid path /pages/planning/sessioninvalid was
requested
so what is wrong if i have to make it work how can i
do it..
thanx in advance
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic