aspose file tools*
The moose likes Servlets and the fly likes placing HTML files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "placing HTML files " Watch "placing HTML files " New topic
Author

placing HTML files

madhur jain
Ranch Hand

Joined: Aug 27, 2002
Posts: 49
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.
Ken Robinson
Ranch Hand

Joined: Jul 25, 2002
Posts: 52
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 ]
Thomas Hubschman
Ranch Hand

Joined: Sep 25, 2002
Posts: 88
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


SCJP '02, SCWCD '02, SCJD '08, SCSNB '09, SCEA '10
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: placing HTML files