Archived

This topic is now archived and is closed to further replies.

[java] More help needed for servlets

This topic is 5750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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.

Share on other sites
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?

[<><]

Share on other sites

  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.

Share on other sites
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

Share on other sites
>> 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.

Share on other sites
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?

Share on other sites
Dare mo tetsudatte kurenai ka?

Share on other sites
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.