Logo of Bento frameworkspaceObject Oriented Programming


JBuilder 2007

ServletWorker

Free source code example for Bento framework...

Seeing is believing! First of all, please enjoy the example of Bento framework that is running on our web site. It is the simple photo Blog where you can upload the image files by your web browser (multipart/form-data), or e-mail with file attachment. After you grasp how it works, please explore its source code. The source code of the example is included in the FREE trial version of Bento framework.

[ Try and download example ... ]

Model in MVC (Model-View-Controller) framework ...

This API plays a model part in the MVC (Model-View-Controller) framework. To grasp the whole picture of Bento framework, please read Introduction of Bento framework.

Input to Model ...

The next parameters will be passed to the model by the controller Servlet.

Please retrieve the required information from the second parameter, because you can avoid the unnecessary byte-to-character conversion. ParsedRequestParameters can also be used to save some of the request parameters into the SQL table by RequestStore. By the third parameter, the model can identify the user id and the group to which the user belongs. The model can put some object into UserInfo, and the subsequent model within the same session can get it later. For details, please read about LoginManager.

Output from Model ...

The return value from the model is WorkResult. It includes:

View code: The configuration XML of ViewGenerator allows you to define more than one XML per each request path. This code (int value) indicates which XML should be used to generate the view. Note that the code starts with 0 (zero).
Map of String: The map of the key-value pairs, whose values are Strings. ViewGenerator will insert these Strings into the XML. The key specifies where to insert each String.
Map of Boolean: The map of the key-value pairs, whose values are Booleans. Based on these Booleans, ViewGenerator will select the XML fragment to generate the view. The key specifies the XML fragment.

Based on these information, the controller Servlet calls the method of ViewGenerator to generate the view.

Model for each host ...

Apache Tomcat behind the Apache web server (HTTP daemon) can accept the HTTP request for more than one host. And one set of Servlet/JSP on Tomcat can accept the HTTP requests with various host headers. On this kind of configuration, you may need to allocate the different Model for each host. The deployment XML of ServletWorker makes it easy. For details, please click the link below and read another page.

[ View/Model for each host ... ]

Read Java doc / FREE Download

You can read the Java doc for this API online. Or it is included in the distribution of this API and you can download it at FREE.

Java doc README
Product License
Download

Copyright © 1997-2008 OOP-Research CorporationTM, All Rights Reserved.

Valid XHTML 1.0! Valid CSS!