jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Servlet @WebServlet url patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet @WebServlet url patterns" Watch "Servlet @WebServlet url patterns" New topic

Servlet @WebServlet url patterns

malik ge
Ranch Hand

Joined: May 13, 2011
Posts: 69
In the following code:

The @WebServlet annotation defines two urlPatterns signIn and signUp.
I want to know, is it possible if:

  • signIn is passed then servlet should perform some task,
  • and if signUp is passed then some other functionality is performed, other than sign-In's functionality

  • Ulf Dittmer

    Joined: Mar 22, 2005
    Posts: 42959
    You could call HttpServletRequest.getRequestURL to determine which URL was actually called.
    malik ge
    Ranch Hand

    Joined: May 13, 2011
    Posts: 69
    I agree. Here's the link: http://aspose.com/file-tools
    subject: Servlet @WebServlet url patterns
    It's not a secret anymore!