Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems in running servlet

843836Feb 1 2005 — edited Feb 1 2005
I hav done following to compile & run servlet:

1.Installed JDK1.4 & set the JAVA_HOME=e:\j2sdk1.4
2.installed tomcat4.1 & set the TOMCAT_HOME=e:\tomcat4.1
3.compiled the servlet java with the classpath=.;e:\tomcat4.1\common\lib\servlet.jar
4.copied the class file to the E:\Tomcat 4.1\webapps\examples\WEB-INF\classes\ dir
5.JavaServletcodename:ColorGetServlet
6.Html code Name:ColorGet.html
7.Enabled the following code in e:\tomcat4.1\conf\web.xml


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

<!-- The mapping for the invoker servlet -->

<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>



And also included the following code:


<servlet>
<servlet-name>ColorGetServlet</servlet-name>
<servlet-class>ColorGetServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ColorGetServlet</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

The following code is included in the f:\tomcat4.1\conf\server.xml:

<Context path="/examples" docBase="/webapps/examples" debug="0"
reloadable="true" crossContext="true">


I am able to compile the javaservlet code & get the class file.When i run the html file in the browser,the web page is displayed.But when i click the submit button the error is displayed.

The displayed error message is:


HTTP Status 404 - /servlet/ColorGetServlet

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

type Status report

message /servlet/ColorGetServlet

description The requested resource (/servlet/ColorGetServlet) is not available.


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

Apache Tomcat/4.1.31



What could be the reason for the above error?Please kindly help me to proceed further.Awaiting reply.

Gaya3



http://www.junlu.com/9.html
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2005
Added on Feb 1 2005
1 comment
111 views