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 struts extension Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts extension" Watch "struts extension" New topic
Author

struts extension

sreedhar lak
Ranch Hand

Joined: Feb 26, 2006
Posts: 42
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


Thanks a lot<br />Learn from yesterday, live for today, hope for tomorrow. The important thing is to not stop questioning
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts extension
 
Similar Threads
Servlet extension
actual file content is showing[browser issue]
Is it possible not to use extension mapping ?
JSP source
uploading a file but want to restrict the type of files