File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes mapping .jsp to .html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "mapping .jsp to .html" Watch "mapping .jsp to .html" New topic
Author

mapping .jsp to .html

Mark Stein
Ranch Hand

Joined: May 20, 2002
Posts: 75
I'm switching a static html site over to jsp. Does anyone know of a way to map the *.jsp to *.html using servlet mapping in the web.xml? And if it was done this way, would it default to a .html if there was no matching .jsp file?
I'll be using Apache with Resin.
Thanks.
kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
only servlet classes are writen in web.xml , the submit class is writen in action in jsp


Sun Certified Java Programmer, Sun Certified Java Developer. <br />Strving to be a real architect.
kevin chang
Ranch Hand

Joined: Mar 08, 2003
Posts: 64
it couldn't be a html , i think.
Han You
Greenhorn

Joined: Oct 26, 2003
Posts: 25
Hm, I kinda think you've anwered your own question. In the web.xml file, you're probably going to be mapping your servlet to a url, right? Well you can use that url to reference that particular servlet. All you need to do is place that url into an html link, (for example).... I hope you understand what I'm trying to get at... ^^
Mark Stein
Ranch Hand

Joined: May 20, 2002
Posts: 75
Han, I think I understand what your saying. Since jsp are servlets, and declared as such in one of the configuration files (not web.xml), I can use the servlet mapping tags to map jsp to .html extentions.
While I know I can do that individually for each page, I was hoping to be able to do it with wildcard characters. But since there would still be a few html pages mixed in, I was looking for a way where it would look for a jsp file first, and if it didn't exist, default to the .html page. Might have to look at apache's mod_rewrite for what I want.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mapping .jsp to .html