aspose file tools*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet @WebServlet url patterns" Watch "Servlet @WebServlet url patterns" New topic
Author

Servlet @WebServlet url patterns

malik ge
Ranch Hand

Joined: May 13, 2011
Posts: 69
Hi,
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
    Marshal

    Joined: Mar 22, 2005
    Posts: 42292
        
      64
    You could call HttpServletRequest.getRequestURL to determine which URL was actually called.


    Ping & DNS - my free Android networking tools app
    malik ge
    Ranch Hand

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