Originally posted by Lakshmi Nimishakavi:
the web.xml in the WEB-INF of MYAPP has the tag
<display-name>MYAPP</display-name>
<description>a basic application.</description>
Thanks
Deepa
varun Dosapati wrote:Hi Dev
Thanks for Response
Tomcat is working fine in Eclipse IDE. And also executing fine while I am trying to run the program in Eclipse.
But while I am trying manually from browser. Say like "http://localhost/8080" it showed me Oracle home page.
So I changed the port number of "server.xml" in "conf" folder in "tomcat" by following the link "http://lkamal.blogspot.com/2008/06/tomcat-how-to-change-port-8080.html".
Now when I try "http://localhost/8081" it is showing me the home page of tomcat. but when I am trying the application it is showing me the 404 status error.
Application deployment
tomcat6-->webapps--->DemoApp(Myapplication)-->WEB-INF-->classes-->servlet.java/servlet.java
|
web.xml
I am also the providing the data presented in servlet.java and web.xml file
servlet.java
import javax.servlet.*;
import java.io.*;
public class Servlet1 extends GenericServlet{
public void service(ServletRequest request, ServletResponse response) throws ServletException,IOException{
PrintWriter pw = response.getWriter();
pw.println("<html><body text=blue>");
pw.println("<h1> Servlets Demo Using Manual Configuration </h1><hr>");
pw.println("This is first servlet....");
pw.println("</body></html>");
pw.close();
}
}
web.xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<servlet>
<servlet-name>ourservlet</servlet-name>
<servlet-class>Servlet1<servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ourservlet</servlet-name>
<url-pattern>firstservlet</url-pattern>
</servlet-mapping>
</web-app>
I am thinking this is due to two similar port numbers for oracle database and tomcat server in the system![]()
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|