File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Why .action not show up in URLs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Why .action not show up in URLs" Watch "Why .action not show up in URLs" New topic
Author

Why .action not show up in URLs

James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
Hi everyone,

Each request is sent to an action which processes the request and then redirected to a JSP result page based on the execution of the action class. So the <action name>.action should be in the URL when we browse a web site built in struts. My question is why the <action name>.action is not in the browser's URLs.

Thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29247
    
139

James,
If I understand correctly, "<action name>.action" is a JSP.

JSPs don't show up in the web browser history in Struts because they are results of a forward. In the browser's mind, it simply doesn't exist. Consider the steps involved in a forward:
- browser requests URL
- action processes
- struts forwards to JSP
- JSP is output
- browser receives output of JSP

Since the browser only received one thing, it thinks the output of the JSP is the output of the URL it requested. The browser doesn't know something else happened in between.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why .action not show up in URLs
 
Similar Threads
Request Handler
Struts 1 module - can't get the right module to be used
Dispatch Action and Multiple form beans
Getting org.xml.sax.SAXParseException
HTTP Status 405 - HTTP method GET is not supported by this URL