jWebForm consists of 3 thingys: a servlet (DoJWebForm), a base class (jWebForm), and a class for encapsulating validation logic (vtor). This is a simple framework, but the supporting technologies are not. Once you have the supporting platform configured and working, you are ready to try the jWebForm.
First, extend your javabean with jWebForm, like so:
myFormBean : extends jWebForm
Then add some vtors, a URL for success, and a URL for failure.
The bean's constructor is a good place to do this:
myFormBean()
{
    super();
    addVtor("Name", "Name is a required field", V_REQUIRED);
    addVtor("ZipCode", "Hey! Zip Codes are numeric! Sheesh...", V_NUMERIC);
    setNextURL("/myThingy/myFormSuccess");
    setBoloURL("/servlet/myFormErr");
}
Upon submission, the form should go to an instance of the DoJWebForm servlet, or a derivitive thereof.
jWebForm uses a single interface for retrieving error messages: getFieldError(String paramname).
To process error messages, you will need a servlet. This servlet must have access to the same
jWebForm instance as was used in the form. I use a JSP, and I copy the Java Servlets
Java Server Pages (JSP)
JavaBeans
download via http: jwebform.tar.gz
Click here to see the error-handling servlet
Requirements:
I use apache 1.3.3 and mod_jserv 0.9.12 (on linux).
I've also used apache 1.3.3 and LiveSoftare's JRun.
I will add compatable platforms here.
I use gnuJSP (go Vincent!), which is also available from the Giant Java Tree.
Specifically, JavaBeans embedded within a JSP.
This is a bit tricky to set up, so make sure it works before going any further.
Getting jWebForm
Last modified: Thu Mar 19 13:13:57 Eastern Standard Time 1999