When retrieving information about usesr:
- Prepare:
import com.google.codeu.service.Session;
Session session = new Session();
- Check if the user is logged in. Returns boolean value of whether is logged in
session.isLoggedIn(request,response);
- If not logged in,
response.sendRedirect("/login");
- If logged in,query the datastore
\\if you want to look up users with the key-value pair property
List<User> users = datastore.findUserBy(key,value);
\\ if you want to find the user that is currently logged in.
User user = session.getCurrentUser(request,response);
private String userName;
private String gender;
private String email;
private String birthday;
private String description;
If you want to add other data field, please update the findUserBy and getCurrentUser method. It should be pretty straight forward how to update it.