- From: Luc Saint-Elie <stelie@pictoris-interactive.fr>
- Date: Mon, 1 Mar 1999 07:36:27 -0500 (EST)
- To: W3 Jigsaw Mailinglist <www-jigsaw@w3.org>
Hello all,
I've a problem with a Jigsaw tag that I fail to disable
I've written a servlet that access a Ms Acess database on a Windows 98 box with
JigSaw 2.0.1
The applet works well.. but at the beginning of the produced HTML file i got :
HTTP/1.1 100 Continue
Date: Mon, 01 Mar 1999 05:27:34 GMT
Server: Jigsaw/2.0.1
And I don't know how to suppress this !
I've writtent other servlets without problem, its the first time i get this.
Thanks in advance
Here is my code:
// BEGINNING OF CODE
/*
Adapted from an example
by: Jon Strande
*/
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.math.*;
import java.io.*;
import java.net.*;
import java.util.*;
public class BICSearch2 extends HttpServlet
{
Connection con;
public void init (ServletConfig config) throws ServletException
{
super.init(config);
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");
res.setDateHeader( "Expires", new java.util.Date().getTime() );
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN//\">"+
"<html>"+
"<head><title>Résultats de la recherche</title></head>"+
"<BODY bgcolor=\"#000000\" text=\"#FFFFFF\">" +
"<font face =\"arial\" size=\"1\">");
//register a driver
try
{
DriverManager.registerDriver (new
sun.jdbc.odbc.JdbcOdbcDriver());
}
catch(SQLException e)
{
log( "Probleme avec DriverMgr: " + e + '\t' );
}
//open a connection
try
{
con = DriverManager.getConnection("jdbc:odbc:BIC", "","");
}
catch(SQLException e)
{
log( "Erreur Connexion: " + e + '\t' );
}
try
{
String SearchWord="";
Enumeration values = req.getParameterNames();
while(values.hasMoreElements())
{
String name = (String)values.nextElement();
String value = req.getParameterValues(name)[0];
if(name.equalsIgnoreCase("searchword"))
SearchWord=value;
}
SearchWord = SearchWord.trim();
Statement stmt = con.createStatement();
int columns = 0;//how many columns are returned in the
ResultSet
String sql = "SELECT * FROM Annu_Pictoris WHERE
Annu_Pictoris.Nom = \'" + SearchWord + "\'";
out.println( "<h2>Recherche dans Annu_Pictoris depuis un
Servlet java</h2>"+
"<br>");
stmt.execute(sql);
ResultSet rs1 = stmt.getResultSet();
ResultSetMetaData rsmd = rs1.getMetaData();
columns = rsmd.getColumnCount();
if(columns > 0)
{
out.println("<b>Résultats de la recherche</b><br>");
out.println("<table border=0 cellpadding=2
cellspacing=2
align=\"center\">");
out.println("<tr><td><b>Nom</b></td>");
out.println("<td><b>Prénom</b></td>");
out.println("<td><b>Fonction</b></td></tr>");
stmt.execute(sql);
ResultSet rs = stmt.getResultSet();
while(rs.next())
{
//get the info here
String strNom = rs.getString("Nom");
String strPrenom = rs.getString("Prenom");
String strFonction = rs.getString("Fonction");
out.println( "<tr><td align=left>" +
strNom +
"</td>"+
"<td align = left>" + strPrenom
+ "</td>"+
"<td align = left>" +
strFonction + "</td></tr>");
}
out.println("</table>");
out.println("<hr>");
out.println("<a
href=\"http://127.0.0.1:8001/TestDB/search.html\">Lancer une autre
recherche</a><br>");
}
else
{
out.println("<b>Votre recherche n'a généré aucun
résultat</b><br><hr>");
out.println("<hr>");
out.println("<a
href=\"http://127.0.0.1:8001/TestDB/search.html\">Essayez une autre
recherche</a><br>");
}
out.println(
"<a href=\"http://127.0.0.1:8001/servlets/BICTables\">Voir tous les
enregistrements</a><br>"+
"<a href=\"http://127.0.0.1:8001/TestDB/OracleUpdate.html\">Ajouter un
enregistrement</a><br>"+
"</font> </body></html>"
);
out.flush();
stmt.close();
con.close();
}
catch(SQLException e)
{
out.println( "Erreur SQL: " + e + '\t' );
}
}
}
// END OF CODE
Luc Saint-Elie
Consultant
PICTORIS INTERACTIVE
Electronic & New Media Agency
Dauphin d'Or Intranet - Biarritz 98
Dauphin d'Argent Audiovisuel Institutionnel - Biarritz 98
Grand Prix Internet - Biarritz 97
62, rue d'Hauteville - 75010 Paris
Tel : 01 48 24 97 43 - Fax : 01 48 24 00 68
http://www.pictoris-interactive.fr
Received on Monday, 1 March 1999 07:41:41 UTC