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.
Joined: Jul 25, 2002
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 ]
Joined: Sep 25, 2002
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: