Manual with JSP Only


This section describes how integrate quickly FormView with JSP Only (Without Struts) with basic configuration of FormView. To configurate FormView (form-view.xml; displayer-config.xml), you must define the FormviewServlet in your web.xml. So after you can use FormView like Struts.


To configurate FormviewServlet servlet, you must do like this :

  <!-- Servlet FormView which load config of FormView -->
      <!-- FormView Config files (Required) -->
      <!-- Displayer Config files (Not required) -->

This Servlet initialize :

  • formViewConfig which contains form-view.xml to use. If you have several configuration files, you can declare it sperated by , character, like this :
  • displayerConfig, if you want configure your displayer config.

Using FormView in your JSP

Once FormView configurate, you can use FormView with request variable and application variable :

  // Set state to READ
  WEBFormViewUtil.saveState(request, application, FormViewConstants.STATE_READ);
  // Save Formview 
  WEBFormViewUtil.saveFormView(request, application, "/project");

Manage date, required and maxlength property.

If you use FormView, without Struts, you have not validation XML configuration for merging date, required and maxlength property with field. But you can manage it (to add automaticly (*) if field is required, calendar.gif if field is date, by configuring formview-config.xml like this :

  <form name="/project" >
    <field property="name" required="true" />
    <field property="date" date="true" />
    <field property="managerId" required="true" />

This configuration will add (*) to name and managerId input HTML and will add a calendar.gif to date input HTML.