[java] More help needed for servlets

Started by
7 comments, last by Tac-Tics 22 years ago
I posted a while back for help on setting up servlets. Well I finally got around to getting my server up and now I need a little more help. I have the server running, I have the servlets written and compiled... but that''s where I''m lost. When I try loading them, Apache gives me an error. I figured I needed to configre my web.xml, so I changed it to read:
  
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

    "http://java.sun.com/dtd/web-app_2_3.dtd">


<web-app>

   <servlet>
      <servlet-name>serv</servlet-name>
      <servlet-class>EncodingType</servlet-class>
   </servlet>

   <servlet-mapping>
      <servlet-name>serv</servlet-name>
      <url-pattern>/serv</url-pattern>
   </servlet-mapping>



</web-app>

  
However, I don''t know much of anything about XML and I think my problem is somewhere in there. I''m not sure tho. Any help would be very appriciated.
Advertisement
Post the error you see in your logs.

When you say Apache gives you an error, do you mean the Apache httpd server or Tomcat? What version?

[<><]

  Apache Tomcat/4.0.3 - HTTP Status 404 - /serv--------------------------------------------------------------------------------type Status reportmessage /servdescription The requested resource (/serv) is not available.  


Serv is the call name for my servlet.
For running servlets you just need tomcat. First of all you should try to run your servlets under tomcat. If this is up and running connect apache and tomcat. If you are new to the topic I suggest do everything step by step and don''t try to do everything in the first step.


ciao torsten
There is a very good tutorial on JSP, servlets and tomcat here at http://wdvl.internet.com/Authoring/Java/Servlets/index.html

D-

-----------
Érdely!
-----------Érdely!
>> For running servlets you just need tomcat.

=-/ I said I have tomcat up and going, but I don''t know what to do to set up the servlets. I have the class files in my /ROOT/WEB-INF/classes/ folder, but I think I need to configure something (web.xml I believe) before I can call them remotely from a browser.
After a little fiddling, I got it to change from one error to another:


  Apache Tomcat/4.0.3 - HTTP Status 405 - HTTP method GET is not supported by this URL--------------------------------------------------------------------------------type Status reportmessage HTTP method GET is not supported by this URLdescription The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).  



What does this mean tho?
Dare mo tetsudatte kurenai ka?
Could be a prob with the servlet itself. Posting the servlet code would be helpful.

Guessing that there is a prob with the doGet() method in your servlet.

I pretend to work, they pretend to pay me.
"I pretend to work, they pretend to pay me."

This topic is closed to new replies.

Advertisement