My tomcat and its example application is running but I got an error with my
own application .My port number is 8080 .I compile my servlet programme in
jdk 7 .and my web.xml file is below
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
</web-app>
My servlet class name is TestServlet
On Thu, Feb 6, 2014 at 3:53 PM, Neven Cvetkovic
<[email protected]>wrote:
> On Feb 6, 2014 9:58 AM, "Shivam Mishra" <[email protected]> wrote:
> >
> > Hye I am using Tomcat 8.0.1 ,my operating system is Windows 8.1 and it is
> > 64- bit configuration .I made a folder in webapps for my servlet but I am
> > unable to access it Please help
>
> Shivam,
>
> Is your tomcat running? What port number? How did you start tomcat?
>
> Do you see the default application?
> e.g. http://localhost:8080
>
> Typical web application would have the following folder structure:
>
> myapp/
> myapp/WEB-INF/classes/com/shivamcompany/myproject/web/MyServlet.class
> myapp/index.jsp
> myapp/images/...
> ...
>
> You would either make a myapp.war or just copy the folder into
> TOMCAT_INSTALL_FOLDER_ON_YOUR_SYSTEM/webapps.
>
> Start your tomcat if it is not started.
>
> Your application should be visible from http://localhost:8080/myweb
>
> How did you compile your servlet?
>
> How is your servlet mapped? Are you using web.xml to map or annotations in
> the servlet code?
>
> Your servlet should be visible from
> http://localhost:8080/myapp/servlet_mapping
>
> and would execute doGet(...) method you defined in your servlet (if you
> just requested the address in the browser).
>
> Hope that helps.
> Good luck!
>