|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.alicebot.server.core.responder.AbstractMarkupResponder org.alicebot.server.core.responder.HTMLResponder
public class HTMLResponder
Responsible for handling requests that come via HTTP, and delivering the response via dynamically-generated HTML based on user-designed templates.
Field Summary | |
---|---|
static java.lang.String |
PASSWORD_COOKIE_NAME
The password cookie name. |
static java.lang.String |
USER_COOKIE_NAME
The user id cookie name. |
Fields inherited from class org.alicebot.server.core.responder.AbstractMarkupResponder |
---|
ALICE_IN, ALICE_OUT, ATOMIC_MARKER_END, bot, BOT_, BOT_NAME_EQUALS, botid, EMPTY_STRING, footer, header, HNAME, hostName, HOSTNAME, MARKER_END, MARKER_START, QUOTE_MARK, REPLY_END, REPLY_START, replyPart, response, RESPONSE, SPACE, tags, UNDERSCORE, USERINPUT |
Constructor Summary | |
---|---|
HTMLResponder(java.lang.String botid,
java.lang.String templateName)
|
Method Summary | |
---|---|
java.lang.String |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String userid)
Tries to authenticate a user. |
static java.lang.String |
changePasswordRequest()
Processes a change password request. |
static java.lang.String |
loginRequest()
loginRequest with no parameters means unknown username, password |
static java.lang.String |
loginRequest(java.lang.String user,
java.lang.String password)
Processes a login request |
static java.lang.String |
registerRequest()
Processes a registration request |
Methods inherited from class org.alicebot.server.core.responder.AbstractMarkupResponder |
---|
append, loadTemplate, log, parse, parseTemplate, postprocess, preprocess, registerTemplates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USER_COOKIE_NAME
public static final java.lang.String PASSWORD_COOKIE_NAME
Constructor Detail |
---|
public HTMLResponder(java.lang.String botid, java.lang.String templateName) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public static java.lang.String loginRequest()
public static java.lang.String loginRequest(java.lang.String user, java.lang.String password)
user
- the usernamepassword
- the passwordpublic static java.lang.String registerRequest()
public static java.lang.String changePasswordRequest()
public java.lang.String authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String userid)
Tries to authenticate a user. Different things can happen, depending on parameters in the request. Here are the meanings of the parameter values:
Most important goal is to get out of here as quickly as possible. This relies on the DBMultiplexor having a quick method to check a user -- ideally not going to the database each time. Also relies on creating as few objects as possible, even avoiding Strings if possible, but never checking the same parameter more than once. Of course, the order is the most important thing. We have to first see if there are any of the relevant parameters supplied, then check a couple of server properties, to know what we have to do. It's okay if the registration and login steps are a little slower, but not okay if each reply is slowed down in a conversation. That's what we tried hard to avoid here.
request
- the HttpServletRequestresponse
- the HttpServletResponseuserid
- the userid given with the request (will not be the same as final userid)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |