File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web.xml files

 
Brian Mulvany
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have created several Java classes that will search http://www.cdwow.com for cds by an artist or album name and will parse some of the information. The search it carries out on the site is dependant on what the runtime paramaters for the program are set to.
I have created a servlet (in a seperate package)in JBuilder that has a shtml form. I enter a value in this form and this value is used as a paramater for the package with all the parsing classes. This works in JBuilder. So when I enter in U2 in the shtml form it will search CDWow for cds by U2.
I want to get this working outside JBuilder. I see somebody mentioned you have to change the web.xml file so it will work for whatever file you are trying to create.
When I try and request the shtml file by typing in the following
http://localhost:8080/webapp/servlet1.shtml
it says it cannot find the file, but if I resave the form as form.html it can find that and it works grand in JBuilder. But as the web.xml file is set up for shtml the html version wont work. So I was thinking if I alterthe xml file to work for html it might work.

There are two parts of the code that might need changing included below.

<servlet-mapping>
<servlet-name>shtml</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>shtml</servlet-name>
<servlet-class>com.borland.jbuilder.webserverglue.shtml.ShtmlLoaderEcho</servlet-class>


Thanks
Brian
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the tomcat docs.
If 5.0 see http://jakarta.apache.org/tomcat/tomcat-5.0-doc/index.html.

Moreover, you should download servlet spec, and jsp spec from java.sun.com. Read about web.xml and its elements.
[ March 06, 2005: Message edited by: Adeel Ansari ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic