java - problem using UserService of google appengine -


public class myservlet extends httpservlet { public void doget(httpservletrequest request, httpservletresponse response) throws ioexception { userservice userservice = userservicefactory.getuserservice();

    string thisurl = request.getrequesturi();     if (request.getuserprincipal() != null) {         response.getwriter().println("<p>hello, " +                                      request.getuserprincipal().getname() +                                      "!  can <a href=\"" +                                      userservice.createlogouturl(thisurl) +                                      "\">sign out</a>.</p>");         system.out.println("<p>hello, " +                 request.getuserprincipal().getname() +                 "!  can <a href=\"" +                 userservice.createlogouturl(thisurl) +                 "\">sign out</a>.</p>");     } else {         response.getwriter().println("<p>please <a href=\"" +                                      userservice.createloginurl(thisurl) +                                      "\">sign in</a>.</p>");     } } 

}

where should call servlet from?

after configuring servlet in web.xml file, call url defined in servlet mapping.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -