Skip to main content
gamedev.net
🔒 Locked

[java] More help needed for servlets

Started by Tac-Tics Apr 18, 2002 at 1:01 AM 7 replies 800+ views
Original Post
Tac-Tics
Tac-Tics
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.
tunabox
tunabox
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?

[<><]
Tac-Tics
Tac-Tics

  
Apache Tomcat/4.0.3 - HTTP Status 404 - /serv

--------------------------------------------------------------------------------

type Status report

message /serv

description The requested resource (/serv) is not available.



Serv is the call name for my servlet.
Knudde
Knudde
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
Tac-Tics
Tac-Tics
>> 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.
Tac-Tics
Tac-Tics
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 report

message HTTP method GET is not supported by this URL

description 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?
Tac-Tics
Tac-Tics
Dare mo tetsudatte kurenai ka?
MadLep
MadLep
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."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.