SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 104 | Next

Deepak Vohra

"Ajax in Oracle JDeveloper"

If the result set is empty the Catalog Id value specified in the
input form is valid and if the result set is not empty the Catalog Id value is
not valid. The business logic for defining a valid Catalog Id may include
match with a regular expression pattern. The response from the server for
an Ajax request sent with the ajax:htmlContent tag is required to be
HTML. Therefore, set content type of the response to HTML.
response.setContentType(???text/html???);
With rs as the ResultSet output an HTML response that includes
instructions about the validity of the Catalog Id value.
if (rs.next()) {
out.println(???

Catalog Id is not Valid

???);
} else {
out.println(???

Catalog Id is Valid

???);
}
For a valid catalog Id a new catalog entry may be created using the
Create Catalog Entry button. The form is submitted using HTTP method
POST, which invokes the doPost() method in the FormServlet
servlet. In the doPost() method the field values in the input form are
retrieved, a connection with the database obtained and a new catalog entry
created. The FormServlet.java servlet class is listed below.
package ajaxtags;
import java.io.*;
import java.sql.*;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.*;
public class FormServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
try {
// Obtain value of Catalog Id field to ve validated.


Pages:
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6