1

I am trying to develop a very simple web app in Eclipse using tomcat as the web container. My problem is that when i type localhost:8080 in the browser it comes up with the tomcat web page, so it works. But when I try to run my servlet on server through Eclipse i get the 404 error saying that the requested resource is not available.

I tried everything I found in the questions that look like mine, but still doesn't work.

I would appreciate any help.

user2975196
  • 11
  • 1
  • 2
  • Show your `web.xml` and tell us what your webapp's context path is. – Sotirios Delimanolis Nov 10 '13 at 01:04
  • the context path shoulb be specified in web.xml ? because i can't find it there. – user2975196 Nov 10 '13 at 12:08
  • "when i type localhost:8080 in the browser it comes up with the tomcat web page, so it works" - nothing worse, that's simple web page. Please try to access the admin panel of tomcat from the initial page, if it works you should login with your credential, if not you will encounter a problem. How is eclipse managing tomcat? How is it managing the deploy of the war on tomcat? – LMG Nov 10 '13 at 12:57
  • If you created the project in eclipse, the context path will usually be the name of the project. You can check you project properties to find it – Sotirios Delimanolis Nov 10 '13 at 14:07
  • the problem seemed to be that i downloaded the wrong binary distribution of tomcat. i downloaded the zip, but then i tried the Windows Service Installer. it works good so far. Thank you anyway ! – user2975196 Nov 10 '13 at 15:22

2 Answers2

0

is this relevant ?

<servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
</servlet>
user2975196
  • 11
  • 1
  • 2
0

I have too faced this issue but I have resolved that . You have to just create web.xml in eclipse , then have to make a entry as follows and you are done :

   <servlet>
    <servlet-name>Example</servlet-name>
    <servlet-class>testingServ</servlet-class>
</servlet>
   <servlet-mapping>
    <servlet-name>Example</servlet-name>
    <url-pattern>/sampleSSO/servlet/testingServ</url-pattern>
</servlet-mapping>
gaurav
  • 1