ibm.com/developerWorks
Presented by developerWorks, your source for great tutorials
/** Handles the HTTP POST method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, java.io.IOException {
processRequest(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "XDoc Rules";
}
private void getJdbcPool(java.io.PrintWriter out)throws Exception{
out.println(" br>");
Object obj = new InitialContext().
lookup("java:comp/env/jdbc/mydb");
DataSource pool = (DataSource)obj;
if (pool == null) return;
Connection connection = pool.getConnection();
out.println("");
try{
ResultSet rs =
connection.getMetaData().
getTables(null,null,null,null);
while(rs.next()){
out.println("");
out.println(rs.getString("TABLE_NAME"));
}
}finally{
connection.close();
}
out.println("
");
out.println(" br>");
}
}
When you apply the XDoclet Ant task,
webdoclet
, to the above source file you will get
the following deployment descriptor.
Application 2.3//EN" "http://java.sun.com/dtd/web app_2_3.dtd">
Page 8 of 49
Enhance J2EE component reuse with XDoclets
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved