package com.wangsus.suwangapp;

import java.io.IOException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class SuWangAppServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("Hello, world");
	}
}

@@ -83,16 +83,126 @@
 ttp.*;%0A%0A
+import com.google.appengine.api.users.UserService;%0Aimport com.google.appengine.api.users.UserServiceFactory;%0A%0A
 @Suppres
@@ -372,45 +372,219 @@
 %7B%0A%09%09
-resp.setContentType(%22text/plain%22);%0A%09%09
+UserService userService = UserServiceFactory.getUserService();%0A%0A        String thisURL = req.getRequestURI();%0A%0A        resp.setContentType(%22text/html%22);%0A        if (req.getUserPrincipal() != null) %7B%0A            
 resp
@@ -609,23 +609,520 @@
 ln(%22
+%3Cp%3E
 Hello, 
-world%22);
+%22 +%0A                                     req.getUserPrincipal().getName() +%0A                                     %22!  You can %3Ca href=%5C%22%22 +%0A                                     userService.createLogoutURL(thisURL) +%0A                                     %22%5C%22%3Esign out%3C/a%3E.%3C/p%3E%22);%0A        %7D else %7B%0A            resp.getWriter().println(%22%3Cp%3EPlease %3Ca href=%5C%22%22 +%0A                                     userService.createLoginURL(thisURL) +%0A                                     %22%5C%22%3Esign in%3C/a%3E.%3C/p%3E%22);%0A        %7D%0A
 %0A%09%7D%0A

add user