KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > servlet > AuthenticationServlet


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.core.servlet;
10
11 import java.io.IOException JavaDoc;
12
13 import javax.servlet.ServletException JavaDoc;
14 import javax.servlet.http.HttpServlet JavaDoc;
15 import javax.servlet.http.HttpServletRequest JavaDoc;
16 import javax.servlet.http.HttpServletResponse JavaDoc;
17
18 /**
19  * Perform the last pass of the sign in protocol.
20  *
21  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
22  * @version $Revision: 1.6 $
23  */

24 public class AuthenticationServlet extends HttpServlet JavaDoc
25 {
26
27    protected void doGet(HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc resp) throws ServletException JavaDoc, IOException JavaDoc
28    {
29       doPost(req, resp);
30    }
31
32    protected void doPost(HttpServletRequest JavaDoc req, HttpServletResponse JavaDoc resp) throws ServletException JavaDoc, IOException JavaDoc
33    {
34       // Get the redirect relative URL if it exist
35
String JavaDoc redirect = req.getParameter("redirect");
36
37       // Redirect
38
String JavaDoc url = redirect == null ? req.getContextPath() : redirect;
39       resp.sendRedirect(url);
40    }
41 }
42
Popular Tags