• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why .action not show up in URLs

 
James Lee
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic