Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts extension

 
sreedhar lak
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Struts frame work using Jsp and Servlets.
Whenever we will forward a request from one jsp to the controller in the
browser we will see ".do" as an extension for action class,but my client requires that it should display the ".jsp" and the current jsp.
Which is very urgent....

Thanks a lot
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to achieve this would be to specify redirect="true" with every forward. This would cause the browser to display myPage.jsp instead of myAction.do. However, there's one serious drawback to this approach: All data that you pass between the action class and the JSP must be passed in the form of parameters passed in the query string (?parm1=abcz&parm2=xyz, etc). You will not be able to use the request.setAttribute() method to store information to be passed to the JSP. Session and Applicatoin scoped variables will still work, however.
[ March 07, 2006: Message edited by: Merrill Higginson ]
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest that you explain to your client that this is a dumb request; that they are wasting your time and/or their money for a "feature" that has no advantage. I can understand a request to hide the underlying technology (so the user does not see .do, .jsp, .asp, ...) but I don't see an advantage with showing .jsp extensions. What happens when a user bookmarks a URL with a jsp extension?

If there is a valid reason, could you share it?

BTW, clients usually don't like it when you say that their ideas are dumb...so you might want to use a different phrase. ;-)

- Brent
[ March 08, 2006: Message edited by: Brent Sterling ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic