title: How to redirect page
body: <p>Hi i created one java application in which i tried to open my company's standard login page and i planned to redirect the link to open my own design page. Standard login page is displayed, instead of going to my own design page as usual  its going to mail page. After sign out the mail page i'm gettting my own design page. But my need is, when i sign in the standard login page it should diplay my own design page. Is it possible? Please Help me. </p>
  
  <p>And this is code that i followed
  import java.io.IOException;</p>
  
  <p>import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;</p>
  
  <p>import com.google.appengine.api.users.UserService;
  import com.google.appengine.api.users.UserServiceFactory;
  import com.google.appengine.api.users.User;
  public class New extends HttpServlet {
    /**
    * 
    */
   private static final long serialVersionUID = 1L;</p>
  
  <p>public void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws IOException {
        resp.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
        resp.setContentType("text/html");</p>
  
  <pre><code>  UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();
  
        if (user != null) {
  
            if(user.getEmail().equals("xxx@yy.edu.in")) {
                resp.getWriter().println("done");
                resp.sendRedirect("/login.jsp");
            }
            else {
                resp.getWriter().println("Hello, " + user.getNickname()+"&lt;br&gt;");
                resp.getWriter().println("Thanks for your interest. But this application is still not available to everybody.");
                resp.getWriter().println("&lt;a href="+UserServiceFactory.getUserService().createLogoutURL(userService.createLoginURL(req.getRequestURI()))+"&gt;Log out&lt;/a&gt;");
            }
        } else {
            resp.sendRedirect(userService.createLoginURL("http://mail.yyy.edu.in"));
        }       
  </code></pre>
  
  <p>}</p>
  
  <p>}</p>
  
  <p>Thanks in advance
  Regards
  Sharun.</p>