## net.i2p.router.web
Class FormHandler

    java.lang.Object
      net.i2p.router.web.FormHandler

Direct Known Subclasses:
  ConfigAdvancedHandler, ConfigLoggingHandler, ConfigNetHandler, ConfigServiceHandler, ConfigStatsHandler, ConfigTunnelsHandler, ConfigUpdateHandler

    public class FormHandler

extends java.lang.Object

Simple form handler base class - does not depend on servlets or jsp, but instead the subclasses are populated with javabean properties. e.g. The form is "processed" after the properties are set and the first output property is retrieved - either getNotices() or getErrors().

Field Summary
`protected java.lang.String` `_action`
`protected RouterContext` `_context`
`protected Log` `_log`
`protected java.lang.String` `_passphrase`

Constructor Summary
`FormHandler()`

Method Summary
`protected void` `addFormError(java.lang.String errorMsg)` Add an error message to display
`protected void` `addFormNotice(java.lang.String msg)` Add a non-error message to display
`java.lang.String` `getErrors()` Display any error messages (processing the form if it hasn't been yet)
`java.lang.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(java.lang.String val)`
`void` `setContextId(java.lang.String contextId)` Configure this bean to query a particular router context
`void` `setNonce(java.lang.String val)`
`void` `setPassphrase(java.lang.String val)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _context

    protected RouterContext _context

### _log

    protected Log _log

### _action

    protected java.lang.String _action

### _passphrase

    protected java.lang.String _passphrase

Constructor Detail

### FormHandler

    public FormHandler()

Method Detail

### setContextId

    public void setContextId(java.lang.String contextId)

  Configure this bean to query a particular router context

  Parameters:
    `contextId` - begging few characters of the routerHash, or null to pick the first one we come across.

### setNonce

    public void setNonce(java.lang.String val)

### setAction

    public void setAction(java.lang.String val)

### setPassphrase

    public void setPassphrase(java.lang.String val)

### processForm

    protected void processForm()

  Override this to perform the final processing (in turn, adding formNotice and formError messages, etc)

### addFormError

    protected void addFormError(java.lang.String errorMsg)

  Add an error message to display

### addFormNotice

    protected void addFormNotice(java.lang.String msg)

  Add a non-error message to display

### getErrors

    public java.lang.String getErrors()

  Display any error messages (processing the form if it hasn't been yet)

### getNotices

    public java.lang.String getNotices()

  Display any non-error messages (processing the form if it hasn't been yet)