|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.web.FormHandler
public class FormHandler
Simple form handler base class - does not depend on servlets or jsp,
but instead the subclasses are populated with javabean properties. e.g.
Field Summary | |
---|---|
protected String |
_action
|
protected RouterContext |
_context
|
protected Log |
_log
|
protected String |
_method
|
protected String |
_passphrase
|
Constructor Summary | |
---|---|
FormHandler()
|
Method Summary | |
---|---|
String |
_(String s)
translate a string |
String |
_(String s,
Object o)
translate a string with a parameter This is a lot more expensive than _(s), so use sparingly. |
String |
_(String s,
Object o,
Object o2)
two params @since 0.8.2 |
protected void |
addFormError(String errorMsg)
Add an error message to display |
protected void |
addFormNotice(String msg)
Add a non-error message to display |
String |
getAllMessages()
Display everything, wrap it in a div for consistent presentation |
String |
getErrors()
Display any error messages (processing the form if it hasn't been yet) |
String |
getNewNonce()
Generate a new nonce, store old and new in the system properties. |
String |
getNotices()
Display any non-error messages (processing the form if it hasn't been yet) |
protected void |
processForm()
Override this to perform the final processing (in turn, adding formNotice and formError messages, etc) |
void |
setAction(String val)
|
void |
setContextId(String contextId)
Configure this bean to query a particular router context |
void |
setNonce(String val)
|
void |
setPassphrase(String val)
|
void |
storeMethod(String val)
Call this to prevent changes using GET |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RouterContext _context
protected Log _log
protected String _action
protected String _method
protected String _passphrase
Constructor Detail |
---|
public FormHandler()
Method Detail |
---|
public void setContextId(String contextId)
contextId
- beginning few characters of the routerHash, or null to pick
the first one we come across.public void setNonce(String val)
public void setAction(String val)
public void setPassphrase(String val)
public void storeMethod(String val)
val
- the request methodprotected void processForm()
protected void addFormError(String errorMsg)
protected void addFormNotice(String msg)
public String getAllMessages()
public String getErrors()
public String getNotices()
public String getNewNonce()
public String _(String s)
public String _(String s, Object o)
s
- string to be translated containing {0}
The {0} will be replaced by the parameter.
Single quotes must be doubled, i.e. ' -> '' in the string.o
- parameter, not translated.
To tranlslate parameter also, use _("foo {0} bar", _("baz"))
Do not double the single quotes in the parameter.
Use autoboxing to call with ints, longs, floats, etc.public String _(String s, Object o, Object o2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |