RE: My apologies
no thanks, I agree with your mail!! -Original Message- From: Rick Horowitz [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 26, 2001 5:25 PM To: Horowitz Subject: My apologies My sincere apologies to the mailing list for the Boycott China message. I sent it by accident, without filtering mailing list addresses from my personal email addresses before sending. Sincerely, Rick Horowitz _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Problems in POST
doPost needs to call doGet or vice versa -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 27, 2001 1:50 PM To: [EMAIL PROTECTED] Subject: Re: Problems in POST Colin Morris wrote: Hey BO! Thanks! I thought that might be one of the possibilities. I've only overrident the doGet() method. However, overriding the doPost() method... I'm not clear on how to write it to accept values from my form? Or do I just write a blank method? (I'm new to java as well...) I'll try it. Hopefully it's nothing to do with my Tomcat settings? I'll try overriding as u suggested. On 27 Mar 2001, at 15:53, Bo Xu wrote: Hi :-) I guess it is because: did you "override" both doGet/doPost method in your Servlt class? if you enter a URL in browser directly, this is a "GET request", so I guess perhaps you forget the doPost. you also can only override "service" method, now both GET/POST request will work. Bo Mar.27, 2001 [...] Hi :-) the following is a simple demo, as a reference, there is a book (Java Servlet Programming, Jason Hunter ISBN=1-56592-391-X) which includes good details. :-) and the "doGet/doPost/service method" canot be "empty", we need to "response" something to the browser, please see the following sample code. *html HTMLBODY FORM ACTION=http://host:8080/myapp/servlet/MyServlet?tailPrecv0=tailPrecv0V METHOD=GET INPUT TYPE=hidden NAME=bodyPrecv0 VALUE=bodyPrecv0V INPUT TYPE=submit VALUE=GETtest /FORM FORM ACTION=http://host:8080/myapp/servlet/MyServlet?tailPrecv0=tailPrecv0V METHOD=POST INPUT TYPE=hidden NAME=bodyPrecv0 VALUE=bodyPrecv0V INPUT TYPE=submit VALUE=POSTtest /FORM /BODY/HTML *Servlet import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; public class MyServlet extends HttpServlet{ public void init(ServletConfig config) throws ServletException{ super.init(config); } public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ try{ System.out.println( "in 0, getMethod()="+request.getMethod()+", getQueryString(): "+request.getQueryString() ); Enumeration enum=request.getParameterNames(); int i=0; while( enum.hasMoreElements() ){ System.out.println("request.getParameterNames("+i+")="+enum.nextElement()); i++; } response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("HTMLBODY"); out.println("ok"); out.println("/BODY/HTML"); out.close(); }catch(Exception e){System.out.println("e="+e);} } }
RE: iPlanet How To = Netscape How-To ???
Title: "iPlanet How To" = "Netscape How-To" ??? Doesn't the latest iPlanet support jsp and servlets by itself. I think it does. Why would you need Tomcat if that's the case? -Original Message-From: Hawkins, Keith (Keith) [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 22, 2001 12:47 PMTo: tomcat-userSubject: "iPlanet How To" = "Netscape How-To" ??? If I want to set up iPlanet4.0 to redirect JSP/Servlet requests to Tomcat do I follow the instructions provided in Netscape How-To document or are there other instructions that must be followed?? Anyone who actually has Tomcat running as the servlet engine for iPlanet please feel free to respond. Yes that means you. Don't just sit there. Send a reply. Thanks, Keith
RE: Tomcat-Startup in windows
I just have a shortcut to the startup.bat file in my C:\Documents and Settings\shlomi\Start Menu\Programs\Startup. It works fine for me. I don't have it running as an nt service. -Original Message- From: Elizabeth Riley [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 22, 2001 6:17 AM To: '[EMAIL PROTECTED]' Subject: RE: Tomcat-Startup in windows Does this mean that if I have started tomcat using the bat file and I have started the service, then I have tomcat running twice? -Original Message- From: shlomi sarfati [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 22, 2000 4:11 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat-Startup in windows look there are couple of options 1. make the tomcat as nt service (NT-Service-howto , i am attaching this document) in this way the tomcat will run as nt service , it will be loaded every time after the the computer starts before the login process 2. put your bat files in your startup directory (i am usint win 2000 : C:\Documents and Settings\shlomi\Start Menu\Programs\Startup) you can right click on your start menu button then choose open \ programs \ startup . in this way the server will start after the user log in . hope i can help -Original Message- From: venkatesan [mailto:[EMAIL PROTECTED]] Sent: Thu, March 22, 2001 10:54 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Tomcat-Startup in windows Hi shlomi sarfati, I tried but server is not starting while i started the system. Can you give the directory hierarchy so that i will past my *.bat files... Regards venkatesh... shlomi sarfati wrote: put tomcat as nt service -Original Message- From: venkatesan [mailto:[EMAIL PROTECTED]] Sent: Thu, March 22, 2001 10:36 AM To: tomcat Subject: Tomcat-Startup in windows Hi All, I have a tomcat server working fine with Apache in Windows-NT. I have a script which starts tomcat before Apache. Can anybody tell that where i have to put these script so that tomcat would be started automatically while my system restarts Thanks in advance Regards Venkatesh
RE: isapi_redirect.dll
go here for info and links: http://jakarta.apache.org/site/sourceindex.html and here for specifically the dll: http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/win32/i38 6/ -Original Message- From: Rahul Misra [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 21, 2001 12:35 PM To: [EMAIL PROTECTED] Subject: isapi_redirect.dll Hello : Could someone please tell me where I can find isapi_redirect.dll for connecting Tomcat w/IIS Regards. ___ Send a cool gift with your E-Card http://www.bluemountain.com/giftcenter/
RE: Help required
IIS and Tomcat do work together. Have you hooked up the isapi filter as isapi_redirect.dll? Followed all the steps in the "Tomcat IIS HowTo.htm"? I was having some problems and I just went back and carefully redid my steps and it was working last time I checked. I still don't know how to add contexts because no one will answer my question on it, but hey, I'm just doing minor stuff for now so I'm just pointing to the Tomcat examples directory for stuff and winging it. :) good luck! -Original Message-From: Rajesh Jumde [mailto:[EMAIL PROTECTED]]Sent: Monday, March 19, 2001 9:16 PMTo: [EMAIL PROTECTED]Subject: Help requiredHello there, In the document Tomcat IIs How To has a statement called The IIS redirector is not part of the "official" build of Jakarta, You can obtain the code and binaries needed for it by accessing http://jakarta.apache.org/builds/tomcat/release/v3.1_beta_1/bin/win32/i386/. The redirector related file is isapi_redirect.dll. in the INSTALLATION para. but when i tried the given url it gives me the error as HTTP 404 page not found. I want to test whether IIS works on Tomcat or not, so can you pls suggest me that what should be done to configure Tomcat to IIS. where from i will get all the installation files for Tomcat and how to configure it.. Thanx and Regards, Rajesh
RE: Please Help--can't set up
what url are you trying to hit? -Original Message-From: Yana [mailto:[EMAIL PROTECTED]]Sent: Tuesday, March 20, 2001 2:02 PMTo: [EMAIL PROTECTED]Subject: Please Help--can't set up I re-installed tomcat from scratch. tomcat_home and java_home are set up, keys in Apache Software Foundation\Jakarta Isapi Redirector\1.0 are as suggested in the IIS how-to. I am logging at c:\jakarta-tomcat\logs\isapi.log with error level. I get the 404 error but the part that completely puzzles me is the fact that the isapi.log file from above never gets created. Please give some advice--this is very frustrating and someone must have done it right, Also, how do I check that "the "/examples" context works correcly if you access Tomcat directly." Thanks I Do You Yahoo!?Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.
RE: Change path of the jakarta-tomcat on Windows NT
and you tried http://localhost:8080/examples/jsp/index.html? -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 2:15 PM To: [EMAIL PROTECTED] Subject: RES: Change path of the jakarta-tomcat on Windows NT Yes i installed tomcat at directory c:\jakarta-tomcat my context files where are e:\websites\mysite []'s Thanks -Mensagem original- De: Arif Tayebali [mailto:[EMAIL PROTECTED]] Enviada em: terça-feira, 20 de março de 2001 18:15 Para: '[EMAIL PROTECTED]' Assunto: RE: Change path of the jakarta-tomcat on Windows NT Prioridade: Alta where have u installed tomcat? where r u storing ur context (html, css, jsp) files? -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 11:44 AM To: [EMAIL PROTECTED] Subject: RES: Change path of the jakarta-tomcat on Windows NT i'm new in the list, can you aswer me how did you can solve the problem? -Mensagem original- De: Arif Tayebali [mailto:[EMAIL PROTECTED]] Enviada em: terça-feira, 20 de março de 2001 15:11 Para: '[EMAIL PROTECTED]' Assunto: RE: Change path of the jakarta-tomcat on Windows NT Prioridade: Alta I m having the same problem...look into the threads that have my name: "Arif Tayebali" for more info! -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 8:56 AM To: [EMAIL PROTECTED] Subject: Change path of the jakarta-tomcat on Windows NT I installed jakarta-tomcat in my windows NT server and i run the .JSP pages with the path http://localhost/examples/ I want to know how to i can run .JSP pages with another path, for example http://localhost/otherpath. Thanks Fabricio Costa Brazil.
RE: Change path of the jakarta-tomcat on Windows NT
excuse that last reply, I was referring to another problem... :) -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 2:15 PM To: [EMAIL PROTECTED] Subject: RES: Change path of the jakarta-tomcat on Windows NT Yes i installed tomcat at directory c:\jakarta-tomcat my context files where are e:\websites\mysite []'s Thanks -Mensagem original- De: Arif Tayebali [mailto:[EMAIL PROTECTED]] Enviada em: terça-feira, 20 de março de 2001 18:15 Para: '[EMAIL PROTECTED]' Assunto: RE: Change path of the jakarta-tomcat on Windows NT Prioridade: Alta where have u installed tomcat? where r u storing ur context (html, css, jsp) files? -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 11:44 AM To: [EMAIL PROTECTED] Subject: RES: Change path of the jakarta-tomcat on Windows NT i'm new in the list, can you aswer me how did you can solve the problem? -Mensagem original- De: Arif Tayebali [mailto:[EMAIL PROTECTED]] Enviada em: terça-feira, 20 de março de 2001 15:11 Para: '[EMAIL PROTECTED]' Assunto: RE: Change path of the jakarta-tomcat on Windows NT Prioridade: Alta I m having the same problem...look into the threads that have my name: "Arif Tayebali" for more info! -Original Message- From: Fabricio Costa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 8:56 AM To: [EMAIL PROTECTED] Subject: Change path of the jakarta-tomcat on Windows NT I installed jakarta-tomcat in my windows NT server and i run the .JSP pages with the path http://localhost/examples/ I want to know how to i can run .JSP pages with another path, for example http://localhost/otherpath. Thanks Fabricio Costa Brazil.
RE: Change path of the jakarta-tomcat on Windows NT
yes, if there's errors in your servlet you may not get many or any messages. -Original Message- From: Steve Ruby [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 3:03 PM To: [EMAIL PROTECTED] Subject: Re: Change path of the jakarta-tomcat on Windows NT Georges Boutros wrote: Hello Everyone, i have another question about the same subject i could access my jsp pages in http://localhost/examples/jsp/myFolder (No Problem) i could access my servlet in http://localhost/examples/servlet (No Problem) but if i want to access a servlet from a jsp page i could only do it by including my servlet in my jsp page .I can't forward or submit a form to a servlet. does anyone know why? or what should i change in the configuration file thanks If you are submiting a form to a servlet this has nothing to do with JSP servlet ineraction the client's browser is responsible for submiting to the correct location. Check the action on your form and make sure it is a valid URL to a working servlet..
RE: Windows 2000 and Tomcat
I had that happen once and I'm not sure why. I went back and basically rehooked it up. I went through all the steps again and looked for mistakes and then removed my isapi filter and then added it again. Mine's green now and usually stays that way (thank God). -Original Message- From: Elizabeth Riley [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 12:10 PM To: '[EMAIL PROTECTED]' Subject: RE: Windows 2000 and Tomcat Thank youI have made progress (I think)...now the filter doesn't have a 'green' status...argh! Any suggestions there? I have checked spellings on worker_file and worker_mount_file... -Original Message- From: Dianne Cree [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:03 PM To: [EMAIL PROTECTED] Subject: RE: Windows 2000 and Tomcat I read (and did) this: go into your IIS. I'm using 5.0, so you may see a little differently if you're using 4.0, I don't remember. Anyway, right click on the "default web site" and go into the properties. Click on the "home directory" tab and then on the "Configuration" button. The "Application Configuration" dialog box should appear. Under the "App Mappings" add .jsp and point to your isapi_redirect.dll file. I actually did the same thing for the .class files. Like I said, I read that you are supposed to do this but if anyone wants to correct me, GO FOR IT!! :) -Original Message- From: Elizabeth Riley [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 10:19 AM To: '[EMAIL PROTECTED]' Subject: RE: Windows 2000 and Tomcat Tell me where to lookplease. -Original Message- From: Darrell Porter [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 1:14 PM To: '[EMAIL PROTECTED]' Subject: RE: Windows 2000 and Tomcat is the mime type for .jsp set on the Windows 2000 server machine? -Original Message- From: Elizabeth Riley [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 5:45 AM To: '[EMAIL PROTECTED]' Subject: RE: Windows 2000 and Tomcat It says page cannot be found. (I tried both ways). However, if I type in the whole path to a specific jsp application that's in the examples directory (like numguess.jsp), I see the jsp code displayed. It makes me wonder if .jsp isn't being re-directed to tomcat. Also in my ISAPI.log file (when I enter the path name to numguess.jsp) it says ."numguess.jsp is not a servlet url. Check if numguess.jsp points to the web-inf directory. " Any clue as to what that is supposed to be telling me? -Original Message- From: Alejandro [mailto:[EMAIL PROTECTED]] Sent: Friday, March 16, 2001 1:39 PM To: [EMAIL PROTECTED] Subject: RE: Windows 2000 and Tomcat Hi Try in the other computer which is on the same network typing: "http://IPNUMBER/examples/jsp/index.html", where IPNUMBER is the ip of the computer where tomcat is running. If it doesn't work type: "IPNUMBER:8080" in place of "IPNUMBER" - Original Message - From: Elizabeth Riley [EMAIL PROTECTED] To: tomcat-user [EMAIL PROTECTED] Sent: Thursday, March 15, 2001 5:54 PM Subject: Windows 2000 and Tomcat I am installing tomcat to work in conjunction with Windows 2000 server. I believe I have done all the steps in the documentation for 'Tomcat IIS How To'. I have verified that things are working by going to the browser on the server and typing 'localhost/examples/jsp/index.html'. This works fine. However, if I go to another computer that is on the same network and type the IP address of the server followed by 'tomcat/webapps/examples/jsp/num/numguess.jsp', I get the html 'source' displayed in my browser. Any suggestions on where to find the solution to this? Have I missed a critical step? Elizabeth Riley Division of Information Technology Macon State College 100 College Station Dr. Macon, GA 31206 478-757-2582 _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Closing ResultSet and Statement?
rs.close, isn't it? -Original Message- From: Mick Sullivan [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 12:49 PM To: [EMAIL PROTECTED] Subject: Closing ResultSet and Statement? Hi Does anyone know how to close a ResultSet? Heres my code: public String getName() throws Exception { Statement statement = connection.createStatement(); int myInt = 1; ResultSet rs = statement.executeQuery("SELECT Name"+ " FROM nameAddress" + " WHERE ID = ("+ myInt + ")"); rs.next(); String myString = rs.getString("Name"); //change the resultSet to a string //so it can be used by the jsp page return myString; } Any help at all would be much appreciated Thanks in advance, Mick _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
RE: Can Tomcat3.2 run with IIS on Windows2000 Professional?
Title: Can Tomcat3.2 run with IIS on Windows2000 Professional? yes -Original Message-From: John Chen [mailto:[EMAIL PROTECTED]]Sent: Monday, March 19, 2001 1:11 PMTo: [EMAIL PROTECTED]Subject: Can Tomcat3.2 run with IIS on Windows2000 Professional? Hi, recently I have tried to run Tomcat3.2 on windows 2000 with IIS, I have configured the Tomcat but It seems don't run on windows2000, Can the Tomcat run on the windows2000 with IIS5.0? Thanks John Chen Software Engineer FreeBalance Inc. Government @ Web Speed - see the latest news at www.FreeBalance.com T(613)236-5150 ext.160 [EMAIL PROTECTED]
RE: Can Tomcat3.2 run with IIS on Windows2000 Professional?
Title: Can Tomcat3.2 run with IIS on Windows2000 Professional? oh, wait rs.close is asp. sorry bout that. I think the correct answer was a few mails ago. -Original Message-From: Dianne Cree [mailto:[EMAIL PROTECTED]]Sent: Monday, March 19, 2001 2:25 PMTo: [EMAIL PROTECTED]Subject: RE: Can Tomcat3.2 run with IIS on Windows2000 Professional? yes -Original Message-From: John Chen [mailto:[EMAIL PROTECTED]]Sent: Monday, March 19, 2001 1:11 PMTo: [EMAIL PROTECTED]Subject: Can Tomcat3.2 run with IIS on Windows2000 Professional? Hi, recently I have tried to run Tomcat3.2 on windows 2000 with IIS, I have configured the Tomcat but It seems don't run on windows2000, Can the Tomcat run on the windows2000 with IIS5.0? Thanks John Chen Software Engineer FreeBalance Inc. Government @ Web Speed - see the latest news at www.FreeBalance.com T(613)236-5150 ext.160 [EMAIL PROTECTED]
RE: Closing ResultSet and Statement?
sorry, rs.close is asp. the correct java code came a few mails ago -Original Message- From: Dianne Cree [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:25 PM To: [EMAIL PROTECTED] Subject: RE: Closing ResultSet and Statement? rs.close, isn't it? -Original Message- From: Mick Sullivan [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 12:49 PM To: [EMAIL PROTECTED] Subject: Closing ResultSet and Statement? Hi Does anyone know how to close a ResultSet? Heres my code: public String getName() throws Exception { Statement statement = connection.createStatement(); int myInt = 1; ResultSet rs = statement.executeQuery("SELECT Name"+ " FROM nameAddress" + " WHERE ID = ("+ myInt + ")"); rs.next(); String myString = rs.getString("Name"); //change the resultSet to a string //so it can be used by the jsp page return myString; } Any help at all would be much appreciated Thanks in advance, Mick _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
RE: first day with tomcat
http://localhost or your computer name. -Original Message- From: Azhar Khan [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 5:20 PM To: [EMAIL PROTECTED] Subject: re: first day with tomcat I have installed tomcat on my machine. And i run the startup.bat file when I wan't to run Tomcat. But, I was wondering if i can go ahead and write jsp / servlets. Also, if i do how do i check them on my computer. And what will be the address C:\...\HelloWorld.java or http://localhost... Thanks. -- Azhar Khan Software Development Engineer Intranet Technologies, Amazon.com 206-266-1188 http://www.amazon.com
RE: How do we add a context to Tomcat? and what is one...
I'm using IIS with Tomcat. I see in the "How To" guide it shows how to add one to the ISAPI redirector, and then it cruely admits that he/she won't be talking about adding the context to Tomcat. Don't we HAVE to do that to add another context? Why would that be left out of the instructions? Also, since I haven't run across the definition of a context and I am somewhat new to setting up web servers, what exactly is the definition of a "context"?
RE: Redirecting IIS to TomCat server
hi, we use IIS 5.0 and tomcat 3.0 on a windows 2000 pro. computer We try to use isapi_redirect.dll of Tomcat for tunelling IIS to the TomCat server through a specific port 80. we use the redirection with a get command and all works well. When we try to use the Post method. Unfortunately the parameters posted through the Post method are not viewed on the TomCat server side. Question : is it an IIS problem? Is it a redirection problem? If yes, is there a new version of the isapi_redirect.dll or a specific configuration to use? Is there an alternative strategy? Are you trying to post to a servelt? If so, make sure that you do this in your servlet code: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } Meaning add a doPost to handle the post and then have it call the doGet where all your code is. Chistophe DENIARD Kaidara 15, rue soufflot 75005 PARIS FRANCE tel: +33 (0) 1 56 24 22 00 fax:+33 (0) 1 56 24 22 66 [EMAIL PROTECTED] http://www.kaidara.com
RE: Post method not supported....
You need to make sure that you have both doGet and doPost included. If your code is all in doGet then just write doPost like below. It calls doGet. I had this same problem the first time I tried to POST. public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 4:40 PM To: [EMAIL PROTECTED] Subject: Post method not supported Hi, I have an unusual problem. I have a feeling that it has to do with either server.xml or web.xml configuration. I wrote a servlet that initializes both 'doGet' and 'doPost' method. The main page is called by the doGet method that prints out the HTML tags which has a Form Method=Post tag in it. When I press submit I get this message: 2001-03-14 07:34:06 - Ctx( /Root ): 400 R( /Root + /BulletinBoard/BulletinBoard + null) HTTP method POST is not supported by this URL It appears that the server is saying that it can't handle the Form Method=Post Post method. Why is it doing this? Anyone knows???
RE: MYSQL CONNECTION CLASS
here's a JDBC class: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.util.*; public class JDBCconn2 extends HttpServlet { int iNumCols; int iNumRows; PrintWriter out; Object value[]; String requestParam; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String url; Connection con; Statement stmt; ResultSet resultset; out = response.getWriter(); response.setContentType("text/html"); requestParam = request.getParameter("hidRandomNum"); //out.println("mstest2 db"); url = "jdbc:odbc:MSTest2"; /* String createString; createString = "create table COFFEES " + "(COF_NAME varchar(32), " + "SUP_ID int, " + "PRICE float, " + "SALES int, " + "TOTAL int)"; */ try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); out.println(e.getMessage()); } try { //con = DriverManager.getConnection(url,"Admin","duke1"); con = DriverManager.getConnection(url); stmt = con.createStatement(); //stmt.executeUpdate("SELECT * FROM TableRND"); //this would update the db if you were adding a table like from above. resultset = stmt.executeQuery("SELECT * FROM TableRND"); displayTheResults(resultset); stmt.close(); con.close(); } catch(SQLException ex) { System.err.println("SQLException: " + ex.getMessage()); } } private void displayTheResults(ResultSet rs) { String strDBNumber; try { //get some metadata: columns names, etc about the results ResultSetMetaData metadata = rs.getMetaData(); iNumCols = metadata.getColumnCount(); iNumRows=1; //keep track of row count //the arrays are NOT zero based /* for(int j=1;j=iNumCols;j++) { out.println(metadata.getColumnLabel(j)); out.println(metadata.getColumnDisplaySize(j)); } //out.println("\n"); */ out.println("!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN\n"); out.println("HTML"); out.println(" HEAD"); out.println(" /HEAD"); out.println(" BODY"); out.println("br"); out.println("the hidden field random number is: " + requestParam); out.println("br"); //out.println("the database number is: " + rs.getObject("iRandNum").toString().trim()); out.println("the database number is: "); rs.next(); strDBNumber = rs.getObject("iRandNum").toString().trim(); out.println(strDBNumber); out.println("br"); if(requestParam != null strDBNumber != null) try { if(Integer.parseInt(strDBNumber) == Integer.parseInt(requestParam)) out.println("The numbers match"); else out.println("The numbers don't match"); } catch(NumberFormatException e) { out.println("brThe argument you specify must be an integer."); } catch(Exception e) { out.println("brThe exception is: " + e); } else out.println("the requestParam or strDBNumber was null."); /* out.println(" TABLE BORDER=2"); //rows while(rs.next()) { out.println(" TR"); //columns for(int c=1;c=iNumCols;c++) { out.println("TD\n"); out.println(rs.getObject(c).toString().trim()); out.println("/TD"); } out.println(" /TR"); } out.println(" /TABLE"); */ } catch(SQLException ex) {
RE: .txt as plain text
do a: response.setContentType("text/plain"); that should do it. -Original Message- From: Boon Yeo [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 5:55 PM To: [EMAIL PROTECTED] Subject: .txt as plain text I don't know whether this is an Apache, Tomcat, or the browser issue. Whenever Apache/Tomcat serve a file with html tags embedded in it, one of them would translate these html tags. This happens with the jsp source examples that came with Tomcat. How do I make these examples with the .txt extension be served as plain text? Tomcat 3.2.1 running on Linux 6.2. Thanks. -Boon
How do we add a context to Tomcat? and what is one...
I'm using IIS with Tomcat. I see in the "How To" guide it shows how to add one to the ISAPI redirector, and then it cruely admits that he/she won't be talking about adding the context to Tomcat. Don't we HAVE to do that to add another context? Why would that be left out of the instructions? Also, since I haven't run across the definition of a context and I am somewhat new to setting up web servers, what exactly is the definition of a "context"?
My IIS isn't redirecting to Tomcat
How do I get any servlet or jsp page to load through IIS (redirecting to Tomcat, of course). I have spent an embarrassing amount of time trying to get this to work. What happened to the days when you just double click on a setup.exe and everything runs smoothly... I'm using Win 2000. Any takers for this question? desparate and getting nowhere fast, Dianne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: My IIS isn't redirecting to Tomcat
yes, I followed those instructions. Actually, Tomcat is working if I use the 8080 port number in the call. But i guess my question is kind of like a lot of the other questions: how can I put .class and .jsp files where I want, add new ones and get them to work through IIS redirection instead of directly through Tomcat. I'm checking out the users guide right now. Thanks for replying! Dianne -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 11:22 AM To: [EMAIL PROTECTED] Subject: RE: My IIS isn't redirecting to Tomcat Have you followed the steps in the Tomcat-IIS How To (available from the Tomcat CVS in src/docs, a link to the web interface is on the Tomcat homepage)? The reason that you can't run some setup.exe I believe is because you can't automate a number of the steps involved. (I've tried but haven't found a way to programatically add a filter or virtual directory, either by running a command or editing the registry. If someone knows, please let me know and I will be happy to build an installer to install Tomcat w/isapi_redirect.dll.) Randy -Original Message- From: Dianne Cree [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 14, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: My IIS isn't redirecting to Tomcat How do I get any servlet or jsp page to load through IIS (redirecting to Tomcat, of course). I have spent an embarrassing amount of time trying to get this to work. What happened to the days when you just double click on a setup.exe and everything runs smoothly... I'm using Win 2000. Any takers for this question? desparate and getting nowhere fast, Dianne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]