servlet invocation using url pattern

Discussion in 'Java' started by vaneric, Nov 24, 2008.

  1. vaneric

    vaneric Guest

    hi
    i am using ant to deploy a basic web application that consists of a
    servlet presenting a form for user inputs .I made a web.xml to
    associate the servlet to a url pattern.I tried to deploy it on tomcat

    <servlet>
    <servlet-name>CookieServlet</servlet-name>
    <servlet-class>com.jspservletcookbook.CookieServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>CookieServlet</servlet-name>
    <url-pattern>/mycookie</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>CookieServlet</servlet-name>
    <url-pattern>/cookie/*</url-pattern>
    </servlet-mapping>

    The second servlet mapping causes an error in tomcat while deploying
    thru ant script(copying the war file to webapps dir)
    Is this /cookie/* pattern invalid?
    Also, i read about jsp type url for servlets like
    <servlet>
    <servlet-name>JspInfo</servlet-name>
    <servlet-class>com.parkerriver.cookbook.JspInfo</servlet-
    class>
    </servlet>
    <servlet-mapping>
    <servlet-name>JspInfo</servlet-name>
    <url-pattern>/info.jsp</url-pattern>
    </servlet-mapping>

    Is this valid?

    thanks
    eric
    vaneric, Nov 24, 2008
    #1
    1. Advertising

  2. vaneric

    Arne Vajhøj Guest

    vaneric wrote:
    > hi
    > i am using ant to deploy a basic web application that consists of a
    > servlet presenting a form for user inputs .I made a web.xml to
    > associate the servlet to a url pattern.I tried to deploy it on tomcat
    >
    > <servlet>
    > <servlet-name>CookieServlet</servlet-name>
    > <servlet-class>com.jspservletcookbook.CookieServlet</servlet-class>
    > </servlet>
    >
    > <servlet-mapping>
    > <servlet-name>CookieServlet</servlet-name>
    > <url-pattern>/mycookie</url-pattern>
    > </servlet-mapping>
    >
    > <servlet-mapping>
    > <servlet-name>CookieServlet</servlet-name>
    > <url-pattern>/cookie/*</url-pattern>
    > </servlet-mapping>
    >
    > The second servlet mapping causes an error in tomcat while deploying
    > thru ant script(copying the war file to webapps dir)
    > Is this /cookie/* pattern invalid?


    Try give us the full error text.

    Arne
    Arne Vajhøj, Nov 25, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. D. Lane
    Replies:
    0
    Views:
    767
    D. Lane
    Jun 27, 2003
  2. Albretch
    Replies:
    2
    Views:
    925
    William Brogden
    Jul 11, 2003
  3. circuit_breaker
    Replies:
    2
    Views:
    1,981
    Jack Jia
    Apr 4, 2004
  4. Replies:
    4
    Views:
    675
    santax
    Apr 20, 2007
  5. lightning
    Replies:
    0
    Views:
    366
    lightning
    Aug 5, 2008
Loading...

Share This Page