.java is the source file, the one you use to compose your program. It is like any other text file, you can use any text editor to create a .java source file.
The .class file is a compiled version of the .java file, ready for execution by the servlet container.


For your second question, you only need to define the servlet name, as you have already earlier declared the servlet name like this:

<servlet>
      <servlet-name> SomeName</servlet-name>
      <servlet-class>com.company.name.Servlet</servlet-name>
</servlet>

So when you do the servlet mapping you use the servlet name instead.

Your servlets should be located in $CATALINA_HOME/webapps/$WEBAPP/WEB-INF/lib/$JARFILE if you pack them up as a jar
or in $CATALINA_HOME/webapps/$WEBAPP/WEB-INF/classes if you did not pack them up in a jar file.


kitty winslet wrote:

In WEB-INF\classes\ I always find 2 kind of file SendMailServlet.java

and SendMailServlet.class,

what is the difference btw *.java and *.class ?

In the servlet mapping fields, why it only shows the

name of the servlet, not the full path to where it

located for example c:\tomcat\webapps\examples\WEB-INF\classes\SendMailServlet?

Robert Wray <[EMAIL PROTECTED]> wrote:

The SendMailServlet code should be located in tomcat_installation_directory\webapps\examples\WEB-INF\classes\SendMailServlet.javaThe web.xml file in the WEB-INF directory should have a tags: <servlet> <servlet-name>SendMailServlet</servlet-name> <servlet-class>SendMailServlet</servlet-class> </servlet>and <servlet-mapping> <servlet-name>SendMailServlet</servlet-name> <url-pattern>/SendMailServlet</url-pattern> </servlet-mapping>which tell tomcat where to find the servlet when you request http://localhost:8888/examples/SendMailServletAt 07:07 AM 09/07/2003 -0400, you wrote:>To create/use servlets, you just need to folow Sun's Servlet Specification.>>http://java.sun.com/webservices/docs/1.1/tutorial/doc/>http://servlets.com/index.tea>http://moreservlets.com/>>-Tim>




---------------------------------
Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to