• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web.xml files

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic