• 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

placing HTML files

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
i am a beg. in servlets.
the dir.
C:\WINDOWS\Desktop\jsdk2.1\webpages\WEB-INF\servlets
is where i place my servlets and i execute them using
http:/localhost:8080/servlet/MyServletclass
but can some one tell me where should i place the static html pages that need to post data to the servlet
i.e.
<form action="servletclass" method=post> should post data to the servlet named "servletclass"
in which dir. should i place the html page.
thanx
madhur.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of using the JSDK2.1 by itself, I would recommend getting the J2EE1.3.1 instead. J2EE includes everything in the Servlet API and is more current (Servlet Spec 2.3).
Next I would get Tomcat (4.1.12 I believe is current) from http://jakarta.apache.org. This is a free webserver that implements the 2.3 spec.
Finally, I would become familiar with the directory structure of the Web ARchive (.war file). ANY J2EE server (Tomcat, WebLogic, WebSphere, JBoss) MUST support this. The .war file and it's structure define exactly what you are looking for and more. The location of static file, config files, servlet classes and anything else required are predermined. This not only standardizes practices, it ensures that your app is portable since the structure is supported by each server. You will not get that portability coding to the 2.1 spec implementation.
[ October 04, 2002: Message edited by: Ken Robinson ]
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the standard web app directory structure:
The context root should be something like:

Your JSP pages and HTML files would be anywhere after the /myWebApp like so:

Your servlets would reside in:

Hope this helps,
Thomas
reply
    Bookmark Topic Watch Topic
  • New Topic