![]()
|
|||||
OOP ViewGenerator API : Simpler than JSP, JSTL, Apache Struts or JavaServer Faces / Input validation from CGI FORM / Easy localization (L10n) / Servlet in Japanese Shift_JIS, Chinese BIG5 or GB2312
Servlet by XML. Simpler than JSP/JSTL, Apache Struts or JavaServer Faces. Input validation from CGI FORM. Localization (L10n). Servlet in Japanese Shift_JIS, Chinese BIG5 or GB2312.
Putting it all togather : OOP Bento frameworkThis Java API is now a part of OOP Bento framework. In this MVC framework by XML, you can write all the GUIs in the web application in the normal HTML, XHTML, WML, HDML or any other mark-up languages. And you no longer need to bother about the user authentication and the session tracking. Because its full working source code example will be the good starting point of this Java API, please also try OOP Bento framework. Related Pages:
|
|||||
Servlet response by the normal HTML!
Believe or not, all the response from your Servlet can be written in just the normal HTML (or any mark-up languages such XHTML, WML or HDML)!
Unlike the JSP/JSTL based solutions like Apache Struts or JavaServer Faces, the web designers (or page authors) of your project need not know even a bit of the custom tag libraries.
Once the response is written in the normal HTML, it's time to run HtmlToXml conversion tool:
This Java Swing GUI based conversion tool converts the normal HTML into the template XML. You can also update the template XML by HtmlToXmlEdit, another GUI tool in this Java API.
Both of these tools are included in OOP ViewGenerator API. When you finish the template XML, please place them into:
Makes your life easier by OOP ViewGenerator API!
Input validation from CGI FORM by XML
While interacting with the user, each text field in your CGI FORM expects the specific pattern of input.
For example, the user should type only the digit (0-9) in some text field of your CGI FORM.
If s/he sends the wrong input, the destination Servlet should detect it and show the same CGI FORM again.
But the CGI FORM at this time should include all the previous inputs in it as the default value.
In addition, the wrong input should be highlighted by the colored font or something:
By the help of OOP ViewGenerator API, a few lines of code are enough for the input validation in your Servlet. When you work with HtmlToXml, you can specify the acceptable data type for each request parameter from the CGI FORM:
Along with the set of the HTML tags, these information are also written into the template XML. Given these information from the XML, your Servlet can check all the request parameters at once. For instance, the source code of your ServletWorker will look like this:
Note that the source code above does not bother about the validity of each request parameter from CGI FORM. Based on the information in the XML, OOP ViewGenerator API checks the validities of all the request parameters. OOP ViewGenerator API works with: and the source code above implements ServletWorker interface.
Easy localization (L10n)
In case of the JSP/JSTL based solutions like Apache Struts or JavaServer Faces, the localized messages should be written in the property resource file for each Locale.
In the template solution by OOP ViewGenerator API, the localization (L10n) of your Servlet is much easier.
Please prepare the normal HTML in as many human languages as you like (each of them will includes the localized message for the expected Locale).
Because all the localized messages can written in the normal HTML, there is no difficulty even in the 2 byte characters such as Japanese Shift_JIS, Chinese BIG5 or GB2312.
DownloadThis API is now a part of Bento framework. There are the better documentations and source code examples on the web site for Bento framework. There, you will also find the link to download the entire framework or each API in it. |
|
||||
|
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries. |
|||||
|
ALL CONTENTS COPYRIGHT 1997-2007, OOP-Research Corporation. All rights reserved. |
|||||