aspose file tools*
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
Author

A big problem for me in Action Mapping

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
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


A$HI$H
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A big problem for me in Action Mapping