DTD for CGI FORM, XHTML, SVG, and HDML/WML (WAP phone) by JSP/Servlet on Apache Tomcat
DTD for CGI FORM, XHTML, SVG, and HDML/WML on WAP phone.
By this DTD, you can write a set of code fragments into the XML.
JSP/Servlet on Apache Tomcat can insert arbitrary Strings between them.
The concatenated String can be directly sent back to the web browser (in case of HTML or XHTML), WAP phone (in case of HDML, WML or XHTML) or SVG viewer (in case of SVG).
Or, on the MVC (model-view-controler) design, it can be merged into another JSP response by Apache Tomcat.
The String to be inserted may be selected from SQL table, or it may be the HTTP request parameter.
By this way, JSP/Servlet on Apache Tomcat can generate the CGI FORM, XHTML, SVG, and HDML/WML on the fly.
Moreover, the response from JSP/Servler on Apache Tomcat can be internationalization (i18n) ready.
You can prepare the source XML in many human languages, such as Japanese Shift_JIS, Chinese BIG5, Chinese GB2312 or Russian KOI8-R.
Then, based on the Locale from the HTTP request, the appropriate XML will be selected automatically by this API.
This Java API is useful specificaly for checking the HTTP request parameter from the CGI FORM.
Assuming that your CGI FORM asks the users to enter only the digit (0-9), the destination Servlet should check if the request parameter is valid or not.
If the request parameter includes the characters other than 0-9, it is invalid and the destination Servlet should ask the users to re-enter the correct input.
Typically, it should show them the CGI FORM again, along with the previous input as the default value.
Then, the users can easily fix their input and send it again.
As you know, this is the very tedious part of your development.
But, don't worry.
A few lines of codes are enough for your JSP/Servlet on Apache Tomcat.
In the source XML for your CGI FORM, you can specify which type of text can be accepted for each input field.
In addition, you can write the code fragments both for the valid case and invalid case.
On the destination Servlet, a set of the HTTP request parameters can be inserted into these code fragments at a time.
At the same time, the validity of each HTTP request parameter can be determined.
In this step, the code fragments for the invalid case will be selected, if some of the parameters are invalid.
Then, the concatenated String will be the HTML tag for the CGI FORM, along with the request parameters as the default values.
And the code fragments for the invalid case can indicate which input is invalid.
The generated CGI FORM can be merged into the JSP response, where the HTTP request will be forwarded.
Thus, by the help of OOP FormGenerator, you can easily build the interactive web application or WAP service on Apache Tomcat.
This page shows the DTD for XML parsed by OOP FormGenerator.
Related Pages:
|