Andy Wickson wrote:
Hi all,

If I put a servlet called Hello.class into a package called com.myco.test and have a suitable dir structure under WEB-INF\classes to reflect this, do I still need to give the full URL of the class in the web.xml file e.g.,

    <servlet-name>Hello</servlet-name>
    <servlet-class>com.myco.test.Hello</servlet-class>

    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
     <url-pattern>com.myco.test.Hello</url-pattern>
    </servlet-mapping>

Also when referencing this servlet from an html form do I need to give the full URL?
The URL pattern is wrong - it should be and URL :-)

<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>com.myco.test.Hello</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/whatever/helloServlet</url-pattern>
</servlet-mapping>

Then the access URL (from browser) is http://<FQDN of your server>/<path to the webapp deployment>/whatever/helloServlet

For example: http://www.myserver.domain.com/mywebapps/whatever/hellServlet

Nix.


--
To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to