File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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: 42028
    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
    Consider Paul's rocket mass heater.
    subject: Servlet @WebServlet url patterns