RE: Tomcat SSL mutual authentication: Nobody's got a clue?
Joe, I've also been trying to do this for ages. I assume you import the client certificate into the server trustore. How does the server know where to look for this truststore ? Thanks Dave -Original Message- From: joe [mailto:[EMAIL PROTECTED] Sent: 26 March 2003 08:49 To: Tomcat Users List Subject: Re: Tomcat SSL mutual authentication: Nobody's got a clue? first of all: use jdk1.4.x !!! i found a bug in the old implementatin. if someone is interrested i can search in my archive to describe the bug. here is how to patch the tomcat 4.1.x to handle to make client authentication 'optional': in the java class: org.apache.tomcat.util.net.jsse.JSSESocketFactory you find 2 times this method call: .setNeedClientAuth(clientAuth); change this to: .setWantClientAuth(clientAuth); thats it! and don't forget to change your server.xml: !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- !--^M -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=true protocol=TLS keystoreFile=/root/certs/java.concrete-it.com.keystore keystorePass=changeit / /Connector here is my link collection for ssl: http://www-106.ibm.com/developerworks/java/library/j-customssl/sidebar.html http://developer.java.sun.com/developer/qow/archive/169/index.jsp http://www.catgen.com/developer/manual/ssl.html#jbosscatalina you can find a lot of howtos how to make your own CA , server cert and client certs. hope this helps, joe joe wrote: hi, it's true that there is no 'step-by-step' howto for tomcat, but there are many other ssl (and client auth) howtos which you can use for tomcat. the only thing is just a little bit of searching and reading about ssl, CA, X509 certificates, certification chains ... i have succesfully established ssl connections with (mutual) client certificates. i'll try to find the howto's i've used and post it here (i hope i'll find them again). i haven't used CRL's - i'm sure there are howtos 'out there'. and: it's true that tomcat does NOT support mutual client auth ! but i've read a little bit of the doc's and the source code and pathed my tomcat 4.1.x to change the ssl client auth behavior to mutual. cu, joe Mark Liu wrote: Hi, No, the Tomcat docs only says how to turn on the *server* authentication, i.e., how to run Tomcat in SSL mode. It does not mention how to have the client also pass over its certificate to the Web server. You have an idea about how to turn on client cert? --- Norris Shelton [EMAIL PROTECTED] wrote: That about sums it up. We are looking at client certs also. The Tomcat docs say how to turn on client authentication, but there is not much out there on hooking up to a CA and verifying against a CRL. All of that is beyond the scope of this list and dives deep into the realm of JCE. We are looking into going with a vendor (probably VeriSign). --- Mark Liu [EMAIL PROTECTED] wrote: For over 1 week, I've been exploring about this. So far, I got no reply. Is this so professional, so tough that nobody's got a clue? __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat can't do client certificate authentication
I've been trying to do this for the last two weeks. There is no documentation on it (the SSLHowto only describes HTTPS). So I have to conclude that Tomcat can't do client certs, so we can't use it. Is this correct ? Dave -Original Message- From: [EMAIL PROTECTED] Sent: Fri 07/03/2003 20:08 To: [EMAIL PROTECTED] Cc: Subject: Can Tomcat do client certificate authentication ? Within our company we've decided to use client certificates for security. I've spent all week trying to get this working on Tomcat. If the client and server are on the same machine it's easy. But how do I do it if the client is on a different machine ? I can get SSL working on HTTPS no problem, but client certificates ? No way. If we can't find an answer we'll have to ban the use of Tomcat in our company for any serious work. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat SSL question (Emergency)
Kevin, You might like to help Tomcat out by telling it the password. Try modifying the factory bit in server.xml to add the path to the keystore, and the password, something like this Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=true protocol=TLS keystoreFile=C:/Documents and Settings/Administrator/.keystore keypass=secret / Dave -Original Message- From: Kevin Hu [mailto:[EMAIL PROTECTED] Sent: 11 March 2003 08:13 To: [EMAIL PROTECTED] Subject:Tomcat SSL question (Emergency) Hi, I am currently implementing Verisign Server Certificate (128 bit) on Tomcat 4.0.3 at Windows 2000 Server platform with JDK 1.4.0 and do the following steps: 1. Create a local Certificate Signing Request (CSR) 2. Submit the CSR to Verisign and receive the certificate back 3. Import the Verisign Chain Certificate into you keystore 4. And import the new Certificate to keystore Note: I am creating different password for keystore and tomcat user other than the default one called changeit. (i.e. keystore password: secret1, key password for tomcat: secret2) 5. Stop tomcat 6. Modify the settings in server.xml file !-- Define an SSL HTTP/1.1 Connector on port 443 -- Connector className=org.apache.catalina.connector.http.HttpConnector port=443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 scheme=https secure=true Factory className=org.apache.catalina.net.SSLServerSocketFactory keystoreFile=C:\program files\Apache Tomcat 4.0\conf\.keystore keystorePass=secret1 clientAuth=false protocol=TLS/ /Connector 7. Start tomcat When I point to the secure website, I receive the following errors: Create Catalina server initProxy: java.security.UnrecoverableKeyException: Cannot recover key java.security.UnrecoverableKeyException: Cannot recover key at sun.security.provider.KeyProtector.recover(KeyProtector.java:301) at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:103) at java.security.KeyStore.getKey(KeyStore.java:289) at com.sun.net.ssl.internal.ssl.X509KeyManagerImpl.init(DashoA6275) at com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl.engineInit(DashoA6275 ) at javax.net.ssl.KeyManagerFactory.init(DashoA6275) at com.sun.net.ssl.KeyManagerFactorySpiWrapper.engineInit(DashoA6275) at com.sun.net.ssl.KeyManagerFactory.init(DashoA6275) at org.apache.catalina.net.SSLServerSocketFactory.initProxy(SSLServerSocket Factory.java:403) at org.apache.catalina.net.SSLServerSocketFactory.initialize(SSLServerSocke tFactory.java:334) at org.apache.catalina.net.SSLServerSocketFactory.createSocket(SSLServerSoc ketFactory.java:287) at org.apache.catalina.connector.http.HttpConnector.open(HttpConnector.java :948) at org.apache.catalina.connector.http.HttpConnector.initialize(HttpConnecto r.java:1128) at org.apache.catalina.core.StandardService.initialize(StandardService.java :454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:5 53) at org.apache.catalina.startup.CatalinaService.load(CatalinaService.java:23 9) at org.apache.catalina.startup.CatalinaService.execute(CatalinaService.java :171) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.BootstrapService.main(BootstrapService.java: 428) Catalina.start: LifecycleException: null.open: java.io.IOException: java.security.UnrecoverableKeyException: Cannot recover key LifecycleException: null.open: java.io.IOException: java.security.UnrecoverableKeyException: Cannot recover key at org.apache.catalina.connector.http.HttpConnector.initialize(HttpConnecto r.java:1130) at org.apache.catalina.core.StandardService.initialize(StandardService.java :454) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:5 53) at org.apache.catalina.startup.CatalinaService.load(CatalinaService.java:23 9) at org.apache.catalina.startup.CatalinaService.execute(CatalinaService.java :171) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
RE: Can Tomcat do client certificate authentication ?
I'm using Tomcat 4.1.18 standalone. We need client certificates to work across all our platforms. With Microsoft its easy, with Tomcat we just can't seem to do it. We've looked at many different methods of security. Basic Authentication is OK if we use it with HTTPS, but doesn't seem to be very interoperable. Dave -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] Sent: Sat 08/03/2003 07:07 To: [EMAIL PROTECTED] Cc: Subject: Re: Can Tomcat do client certificate authentication ? The choice of going to SSL-CERT auth puts a huge burden on your IT staff. You've got to collect all of your client's certs, and manage them (including renewals, revocations, et. al.). Except for small closed-groups, it is almost always not worth the trouble. Which headaches you want really depend on your configuration. The methods are different if you are using Apache/IIS/iPlanet in front of Tomcat, or if you are using Tomcat-Stand-Alone. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] news:[EMAIL PROTECTED] n et... Within our company we've decided to use client certificates for security. I've spent all week trying to get this working on Tomcat. If the client and server are on the same machine it's easy. But how do I do it if the client is on a different machine ? I can get SSL working on HTTPS no problem, but client certificates ? No way. If we can't find an answer we'll have to ban the use of Tomcat in our company for any serious work. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Client Authentication
How do you configure Tomcat to do client authentication at all ? How do use specify the truststore on the Tomcat server ? -Original Message- From: Mario Ivkovic [mailto:[EMAIL PROTECTED] Sent: Sat 08/03/2003 11:21 To: [EMAIL PROTECTED] Cc: Subject: Client Authentication Hi, how can i configure tomcat to get client authentication just for one specified context? Example: https://localhost/withClientAuth https://localhost/withClientAuth https://localhost/noClientAuth https://localhost/noClientAuth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Client Authentication
Have you got it working across more than one box, or is client and server on the same machine ? -Original Message- From: Mario Ivkovic [mailto:[EMAIL PROTECTED] Sent: Sat 08/03/2003 12:08 To: 'Tomcat Users List' Cc: Subject: AW: Client Authentication I just uncomment this in server.xml: Connector className=org.apache.catalina.connector.http.HttpConnector port=443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 scheme=https secure=true Factory className=org.apache.catalina.net.SSLServerSocketFactory clientAuth=true protocol=TLS / /Connector -Ursprngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Gesendet: Samstag, 8. Mrz 2003 12:32 An: [EMAIL PROTECTED] Betreff: RE: Client Authentication How do you configure Tomcat to do client authentication at all ? How do use specify the truststore on the Tomcat server ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can Tomcat do client certificate authentication ?
We can't use digest authentication, as we have to store our passwords encrypted. -Original Message- From: Tarun Ramakrishna Elankath [mailto:[EMAIL PROTECTED] Sent: Sat 08/03/2003 14:19 To: [EMAIL PROTECTED] Cc: Subject: RE: Can Tomcat do client certificate authentication ? How about Digest authentication ? On Sat, 2003-03-08 at 15:19, [EMAIL PROTECTED] wrote: I'm using Tomcat 4.1.18 standalone. We need client certificates to work across all our platforms. With Microsoft its easy, with Tomcat we just can't seem to do it. We've looked at many different methods of security. Basic Authentication is OK if we use it with HTTPS, but doesn't seem to be very interoperable. Dave -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Sat 08/03/2003 07:07 To: [EMAIL PROTECTED] Cc: Subject: Re: Can Tomcat do client certificate authentication ? The choice of going to SSL-CERT auth puts a huge burden on your IT staff. You've got to collect all of your client's certs, and manage them (including renewals, revocations, et. al.). Except for small closed-groups, it is almost always not worth the trouble. Which headaches you want really depend on your configuration. The methods are different if you are using Apache/IIS/iPlanet in front of Tomcat, or if you are using Tomcat-Stand-Alone. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] news:[EMAIL PROTECTED] n news:[EMAIL PROTECTED] n et... Within our company we've decided to use client certificates for security. I've spent all week trying to get this working on Tomcat. If the client and server are on the same machine it's easy. But how do I do it if the client is on a different machine ? I can get SSL working on HTTPS no problem, but client certificates ? No way. If we can't find an answer we'll have to ban the use of Tomcat in our company for any serious work. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I Authenticate Client Certificates ?
I can do this easily if the client is on the same box as the tomcat server, but I can't get it to work if the client is on a different box to the server. Dave UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can Tomcat do client certificate authentication ?
Within our company we've decided to use client certificates for security. I've spent all week trying to get this working on Tomcat. If the client and server are on the same machine it's easy. But how do I do it if the client is on a different machine ? I can get SSL working on HTTPS no problem, but client certificates ? No way. If we can't find an answer we'll have to ban the use of Tomcat in our company for any serious work. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent Re: Newbie: Servlet under Windows does not run
Have you got an entry for you servlet in the web.xml file in the WEB-INF folder ? Dave -Original Message- From: Chris Pheby [mailto:[EMAIL PROTECTED]] Sent: 18 March 2002 15:07 To: Tomcat Users List Subject: RE: Urgent Re: Newbie: Servlet under Windows does not run Do you have a web.xml??? Chris -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Jim Cobban Sent: 18 March 2002 14:51 To: Tomcat Users List Subject: Urgent Re: Newbie: Servlet under Windows does not run I am really desperate. I need to be able to demonstrate this servlet by Tuesday evening and Tomcat still refuses to run it. Essentially all that I have done is copy the examples from a book and change the names to protect the innocent. The first few lines of the .java file are: package Census; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; public class CensusQuery extends HttpServlet { I then compile this class and create the .war file with the following .bat file: set PATH=C:\jdk1.3.1\bin;%PATH% set CP=D:\jakarta-tomcat-3.3a\lib\common\servlet.jar;WEB-INF\classes;%CLASSPATH% javac -d WEB-INF/classes -classpath %CP% CensusQuery.java | more jar cf Census.war *.html WEB-INF When the .war file is deployed by Tomcat the class file is located at: D:\jakarta-tomcat-4.0.3\webapps\Census\WEB-INF\classes\Census\CensusQuery.cl ass All of this looks completely according to the documentation I have read. What am I doing wrong so that Tomcat cannot find the class? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Servlet mapping with /
Dr Evil, This is how I do it, a little perverse, but it works. In the root, have something like this in the web.xml servlet servlet-nameDefault Page/servlet-name jsp-file/mid.jsp/jsp-file /servlet servlet-mapping servlet-nameDefault Page/servlet-name url-pattern/url-pattern /servlet-mapping Thus ensuring that mid.jsp is called. mid.jsp just contains response.sendRedirect(mid/Index); i.e. redirect to a new conext called mid, and run servlet Index Servlet Index does this getServletConfig().getServletContext().getRequestDispatcher(/new.jsp).forw ard(req, res); More detials will be supplied in return for a brown papaer package Have fun Dave -Original Message- From: Dr. Evil [mailto:[EMAIL PROTECTED]] Sent: 24 October 2001 03:39 To: [EMAIL PROTECTED] Subject: Servlet mapping with / I'm trying to do something tricky with a servlet mapping for /. Basically, one machine will be serving a bunch of different hostnames from one IP address. For various reasons which I won't go into right now, it is an absolute impossibility to have separate IP addrs for these different machines, and also we can't configure them as virtual hosts in the server.xml file (trust me on this, it's an absolute impossibility). All the files that are served are in a few specific directories, like /statichtml, or /userhtml or whatever, which contain either static html or jsp pages. So here's what I did: I put this line in web.xml for the app: servlet-mapping servlet-name director /servlet-name url-pattern / /url-pattern /servlet-mapping I created a servlet called director.java, which would look at various parameters in the request, and then forwards it to the right place like this: RequestDispatcher rd = request.getRequestDispatcher(/staticpages/hello.html); rd.forward(request, response); or RequestDispatcher rd = request.getRequestDispatcher(/dynamic/hello.jsp); rd.forward(request, response); What happens is that when RequestDispatcher.forward() is called, it goes back through the mappings list, and sends the request straight back to director.java, which then looks at it and forwards it again, etc, in an endless loop. I understand what's going on, but is there a way to do it differently? I tried this also: RequestDispatcher rd = ServletContext.getNamedDispatcher(settings.corphtmlindex); but then I got this error: RequestDispatcher rd = ServletContext.getNamedDispatcher(/statichtml/hello.html); ^ director.java:159: non-static method getNamedDispatcher(java.lang.String) cannot be referenced from a static context I'm not sure what's going on here. One thought I had was this: in the mappings list, more specific mappings override less specific mappings, and / is the least specific mapping possible. Is there a way to put in mappings in web.xml to prevent the director servlet from being called? This seems like it would be a common thing to do under the MVC model, so there must be some solutions out there. Thanks
RE: Tomcat and firewalls...
Dave, Maybe I've got my ZoneAlarm seetings wrong. I use the basic version (not Pro), on my home pc, and run Tomcat/Java/MySql on that pc. My application doesn't seem to work when I have ZoneAlarm on. I'd like it to, as I hate leaving my home server wide open when I go to work. Dave -Original Message- From: David A. Fuess [mailto:[EMAIL PROTECTED]] Sent: 24 October 2001 03:17 To: [EMAIL PROTECTED] Subject: RE: Tomcat and firewalls... I use Zone Alarm and it doesn't bother Tomcat at all. Dave At 01:54 PM 10/23/2001 +0100, you wrote: I use ZoneAlarm and I've found that I have to turn it off in order to use Tomcat Dave -Original Message- From: Thomas Diamond [mailto:[EMAIL PROTECTED]] Sent: 23 October 2001 01:47 To: [EMAIL PROTECTED] Subject: Tomcat and firewalls... I think that something's wrong with Tomcat and firewalls As I've written in previous letters I had some problems with Win2K crashing inexplicably while running Tomcat. The system was rebooting on its own. After I disabled the atomatic reboot feature I got a Blue Screen saying something about vsdatant.sys ( a file installed with ZoneAlarm ). I also had some other problems with ZoneAlarm so I completely removed it from my system. OK, I said to myself, now you are safe. Today, while I was testing my JSPs locally I got a blue screen saying something about DRIVER_IRQL_NOT_LESS_OR_EQUAL and mentioning a file called nisdrv.sys. I searched a bit and found that this is a file installed with Norton Internet Security (I've got version Norton Internet Security 2001 version 2.5 installed). So what's goig on? Tomcat cannot run in a machine with a firewall or I 've done it again ? Tom. From the Desk of ... David A. Fuess [EMAIL PROTECTED], http://www.Fuess.Net
RE: Opinions on detecting browser type for WML vs. HTML
Dr. Evil, I use exactly the method you suggest. I have a servlet that checks the first four characters of the user-agent. If it is 'Mozi', I call a JSP to deal with an HTML request. If not then I assume WML and have different JSPs for 'MOT-', 'SIE-', 'R380', 'Noki', etc. Dave -Original Message- From: Dr. Evil [mailto:[EMAIL PROTECTED]] Sent: 23 October 2001 10:17 To: [EMAIL PROTECTED] Subject: Opinions on detecting browser type for WML vs. HTML I am working on a site where the same URL will be hit by both WML and HTML browsers. Fortunately, with Tomcat, it's very easy to have a controller servlet which takes all incoming requests and decides to forward them to various processors. The problem is, how should I make this servlet decide what to do? It looks to me like basically every ordinary web browser in use includes the string Mozilla somewhere in its browser type header. I believe this includes IE, Netscape, Konqueror, Galeon, Opera and almost all the others. My current thought is to check for the string mozilla. If it's there, you get HTML, and if it's not there, you get WML. Is this a reasonable approach? I like to do things in a way that is browser independent, but in this case I don't see how to do it. There really should be a header sent by the browser listing the MIME types it accepts, perhaps, but there isn't so I don't know any other alternative. Thanks
RE: Opinions on detecting browser type for WML vs. HTML
What do you mean by "The 'user-agent' header always contains the string "UP. Browser" I bet you 100 pounds that it doesn't. A Nokia phone on a Nokia or CMG Gateway will not have "UP" anywhere. Dave -Original Message- From: simon [mailto:[EMAIL PROTECTED]] Sent: 23 October 2001 10:37 To: tomcat-user Subject: Re: Opinions on detecting browser type for WML vs. HTML It's probably easier to spot the WAP browser rather than the other way around. They send all sorts of goodies in their headers. The 'user-agent' header always contains the string "UP.Browser" so you could search for that. WAP browsers usually send the 'accept' header as well so you could use that to look for 'text/vnd.wap.wml'. That's my opinion. (I personally use the user-agent) - Original Message - From: "Dr. Evil" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 23, 2001 6:16 PM Subject: Opinions on detecting browser type for WML vs. HTML I am working on a site where the same URL will be hit by both WML and HTML browsers. Fortunately, with Tomcat, it's very easy to have a controller servlet which takes all incoming requests and decides to forward them to various processors. The problem is, how should I make this servlet decide what to do? It looks to me like basically every ordinary web browser in use includes the string "Mozilla" somewhere in its browser type header. I believe this includes IE, Netscape, Konqueror, Galeon, Opera and almost all the others. My current thought is to check for the string "mozilla". If it's there, you get HTML, and if it's not there, you get WML. Is this a reasonable approach? I like to do things in a way that is browser independent, but in this case I don't see how to do it. There really should be a header sent by the browser listing the MIME types it accepts, perhaps, but there isn't so I don't know any other alternative. Thanks
RE: Tomcat and firewalls...
I use ZoneAlarm and I've found that I have to turn it off in order to use Tomcat Dave -Original Message- From: Thomas Diamond [mailto:[EMAIL PROTECTED]] Sent: 23 October 2001 01:47 To: [EMAIL PROTECTED] Subject: Tomcat and firewalls... I think that something's wrong with Tomcat and firewalls As I've written in previous letters I had some problems with Win2K crashing inexplicably while running Tomcat. The system was rebooting on its own. After I disabled the atomatic reboot feature I got a Blue Screen saying something about vsdatant.sys ( a file installed with ZoneAlarm ). I also had some other problems with ZoneAlarm so I completely removed it from my system. OK, I said to myself, now you are safe. Today, while I was testing my JSPs locally I got a blue screen saying something about DRIVER_IRQL_NOT_LESS_OR_EQUAL and mentioning a file called nisdrv.sys. I searched a bit and found that this is a file installed with Norton Internet Security (I've got version Norton Internet Security 2001 version 2.5 installed). So what's goig on? Tomcat cannot run in a machine with a firewall or I 've done it again ? Tom.
Handling apostrophes
Hi all, I'm developing an application which uses java servlets and JSPs and a MySQL database running on Tomcat 4.0. I take user input, store it on the db, then display it again. As soon as someone tried inputiing an apostrophe, it all fell over. It seems that I have to encode and decode every single text field. Is this correct, or is there a better way ? Thanks Dave
RE: Handling apostrophes
So what would the input statement look like ? Dave -Original Message- From: Deacon Marcus [mailto:[EMAIL PROTECTED]] Sent: 22 October 2001 10:23 To: tomcat-user Subject: RE: Handling apostrophes Hi, Try using prepared statements. They allow parameters, so basically you define a query with parameters, then set parameter values, and jdbc takes care of all char-quoting. Greetings, deacon Marcus -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 22, 2001 10:55 AM To: [EMAIL PROTECTED] Subject: Handling apostrophes Hi all, I'm developing an application which uses java servlets and JSPs and a MySQL database running on Tomcat 4.0. I take user input, store it on the db, then display it again. As soon as someone tried inputiing an apostrophe, it all fell over. It seems that I have to encode and decode every single text field. Is this correct, or is there a better way ? Thanks Dave
RE: Handling apostrophes
Sounds like a bigger overhead than encode Dave -Original Message- From: David Treves [mailto:[EMAIL PROTECTED]] Sent: 22 October 2001 10:09 To: tomcat-user Subject: Re: Handling apostrophes Hi there, you should simply duplicate in every input string the apostrophe. Meaning that if the input string is: eee'eee after manipulating it - BEFORE inserting it to the DB it will be: eee''eee ( ' twice, NOT A double quote) in the DB it will appear as SINGLE apostrophe. That will work! :o) David. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 10:55 AM Subject: Handling apostrophes Hi all, I'm developing an application which uses java servlets and JSPs and a MySQL database running on Tomcat 4.0. I take user input, store it on the db, then display it again. As soon as someone tried inputiing an apostrophe, it all fell over. It seems that I have to encode and decode every single text field. Is this correct, or is there a better way ? Thanks Dave
RE: Handling apostrophes
Thanks Michael Dave -Original Message- From: Michael Weissenbacher [mailto:[EMAIL PROTECTED]] Sent: 22 October 2001 10:51 To: '[EMAIL PROTECTED]' Subject: RE: Handling apostrophes call the following method like this String_Util.replace(value,',''); public static String replace(String oldString, String toReplace, String replaceWith) { if(toReplace==null || toReplace.equals() || oldString==null || oldString.equals() || replaceWith==null) return oldString; StringBuffer sb=new StringBuffer(); int oldIndex=0; int newIndex=0; while((newIndex=oldString.indexOf(toReplace,oldIndex))!=-1) { sb.append(oldString.substring(oldIndex,newIndex)); sb.append(replaceWith); oldIndex=newIndex=newIndex+toReplace.length(); } sb.append(oldString.substring(oldIndex,oldString.length())); return sb.toString(); } michael
I'm using Tomcat, do I also need Apache
Hi all, I'm using Tomcat 4.0 for my WebSite. Is there any point in also using Apache ? A lot of people seem to use both, but why ? Dave
'Object Moved - 302' returned from https connection from a servle t
Hi, I'm trying to do a remote log on. I've tried a couple of sites, including www.bt.com. I do the Https connect using a POST. The problem is that I get back conn.getResponseMessage() = Object moved and conn.getResponseCode() = 302. Does anyone know if there is any way to get round this. Is it something to do with sendRedirect and if so what is that ? David -Original Message- From: Steven Banks [SMTP:[EMAIL PROTECTED]] Sent: 25 May 2001 12:03 To: '[EMAIL PROTECTED]' Subject: RE: HTTPS connections from servlet We've managed to solve the problem. When I tried to create the URL object, a MalformedURLException was thrown complaining that https was an unknown protocol, even though we had set all of the relevant properties. The solution appeared to be to generate a key using keytool. Once that was safely stored in the keystore the problems stopped. It was just a matter of trawling documentation a little longer basically. Cheers, Steve -Original Message- From: Rams [mailto:[EMAIL PROTECTED]] Sent: 25 May 2001 05:54 To: [EMAIL PROTECTED] Subject: RE: HTTPS connections from servlet what exactly is ur problem? u need to connect to a server securely from ur servlet, right? or anything more? lf u want to connect thru https to another server, no need for ur tomcat to get ssl enabled. elaborate ur problem. rgrds --Rams -Original Message- From: Steven Banks [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 24, 2001 7:13 PM To: '[EMAIL PROTECTED]' Subject: HTTPS connections from servlet snip
RE: 'Object Moved - 302' returned from https connection from a se rvle t
How do I get that parameter ? -Original Message- From: Arnaud Dostes - NTI [SMTP:[EMAIL PROTECTED]] Sent: 25 May 2001 13:19 To: tomcat-user Subject: Re: 'Object Moved - 302' returned from https connection from a servle t response.sendRedirect returns a 302 HTTP code, with a Location parameter in the headers representing the destination URL - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 25, 2001 1:56 PM Subject: 'Object Moved - 302' returned from https connection from a servle t Hi, I'm trying to do a remote log on. I've tried a couple of sites, including www.bt.com. I do the Https connect using a POST. The problem is that I get back conn.getResponseMessage() = Object moved and conn.getResponseCode() = 302. Does anyone know if there is any way to get round this. Is it something to do with sendRedirect and if so what is that ? David -Original Message- From: Steven Banks [SMTP:[EMAIL PROTECTED]] Sent: 25 May 2001 12:03 To: '[EMAIL PROTECTED]' Subject: RE: HTTPS connections from servlet We've managed to solve the problem. When I tried to create the URL object, a MalformedURLException was thrown complaining that https was an unknown protocol, even though we had set all of the relevant properties. The solution appeared to be to generate a key using keytool. Once that was safely stored in the keystore the problems stopped. It was just a matter of trawling documentation a little longer basically. Cheers, Steve -Original Message- From: Rams [mailto:[EMAIL PROTECTED]] Sent: 25 May 2001 05:54 To: [EMAIL PROTECTED] Subject: RE: HTTPS connections from servlet what exactly is ur problem? u need to connect to a server securely from ur servlet, right? or anything more? lf u want to connect thru https to another server, no need for ur tomcat to get ssl enabled. elaborate ur problem. rgrds --Rams -Original Message- From: Steven Banks [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 24, 2001 7:13 PM To: '[EMAIL PROTECTED]' Subject: HTTPS connections from servlet snip
JSP Naming Standards ?
Are there recognised naming standards for JSP's ? If I have a customer login page for Company ABC should I call it. ABC_Customer_Login or abc_cutomer_login or abccustomerlogin or abcCustomerLogin or what ? Please could you give me a reference to the standard, as I only want to change everything once ! Thanks David
JSP Naming Standards ?
Are there recognised naming standards for JSP's ? If I have a customer login page for Company ABC should I call it. ABC_Customer_Login or abc_cutomer_login or abccustomerlogin or abcCustomerLogin or what ? Please could you give me a reference to the standard, as I only want to change everything once ! Thanks David
How do I do an SSL handshake from a Java Servlet ?
I've got to write a java servlet to Login to a website which uses SSL. When you look at the web page that does the log on, the form uses a post. I create the url url = (URL) new URL(https://www.nxtrains.co.uk/NASApp/Neg/RoutingControl;); then set up a connection HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setRequestMethod(POST); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestProperty(Content-Length, +postData.length()); Then do the connect conn.connect(); OutputStreamWriter os = new OutputStreamWriter(conn.getOutputStream()); os.write(postData, 0, postData.length()); os.flush(); os.close(); But it isn't returning the screen which confirms the log on. Do I need to do an SSL handshake first, and if so what does it look like ? Thanks David
RE: Trying to use https: in Tomcat
Pae, OK. Any suggestions for reading ? David -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 17:43 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Dave, I suggest you to invest some of your efforts by either researching, reading, etc, etc. It's is not fair for us to provide every line of problems you have. Pae My next problem is when I try to connect. HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); String postData = x; conn.setRequestMethod(POST); conn.setDoOutput(true); conn.setRequestProperty(Content-Length, +postData.length()); conn.connect(); I get a time-out on the connect. -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 16:32 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Dave, Of course, JSSE has three JARs that need to be recognized. Otherwise, we will get the error message like you have. It applies all other Java package. :-) They can be placed under different places, but recommeded to place them under the path, {java.home}{file.separater}lib{file.separater}ext{file.separater} :-) Pae I get a NoClassDefFoundError on the statement below. Do I have to make any run-time changes, i.e. add some JSSE jars to my Class Path or Tomcat ? -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 15:29 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Did you declared it in the java.securty file? If not, you may need to add the line, java.security.Provider provider = new com.sun.net.ssl.internal.ssl.Provider(); java.security.Security.addProvider(provider); Pae This made no difference at all ! -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Place the following line before the URL line as: java.lang.System.setProperty(java.protocol.handler.pkgs, com.sun.net.ssl.internal.www.protocol); Alternatively. we can declare it on the command line as well. Hope this help. Pae -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, May 10, 2001 6:40 AM Subject: Trying to use https: in Tomcat I'm trying to connect to an url using url = (URL) new URL(https://xx;); In Tomcat I get the error message unknown protocal: https Does anyone know how I get around this ?
RE: Trying to use https: in Tomcat
Tom, How do I do the handshake ? David -Original Message- From: Thomas Bezdicek [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 17:19 To: tomcat-user Subject: AW: Trying to use https: in Tomcat ae, https means you need a handshake to get the connection encrypted. so make the handshake first. regards, tom -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 10. Mai 2001 17:44 An: [EMAIL PROTECTED] Betreff: RE: Trying to use https: in Tomcat My next problem is when I try to connect. HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); String postData = x; conn.setRequestMethod(POST); conn.setDoOutput(true); conn.setRequestProperty(Content-Length, +postData.length()); conn.connect(); I get a time-out on the connect. -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 16:32 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Dave, Of course, JSSE has three JARs that need to be recognized. Otherwise, we will get the error message like you have. It applies all other Java package. :-) They can be placed under different places, but recommeded to place them under the path, {java.home}{file.separater}lib{file.separater}ext{file.separater} :-) Pae I get a NoClassDefFoundError on the statement below. Do I have to make any run-time changes, i.e. add some JSSE jars to my Class Path or Tomcat ? -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 15:29 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Did you declared it in the java.securty file? If not, you may need to add the line, java.security.Provider provider = new com.sun.net.ssl.internal.ssl.Provider(); java.security.Security.addProvider(provider); Pae This made no difference at all ! -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Place the following line before the URL line as: java.lang.System.setProperty(java.protocol.handler.pkgs, com.sun.net.ssl.internal.www.protocol); Alternatively. we can declare it on the command line as well. Hope this help. Pae -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, May 10, 2001 6:40 AM Subject: Trying to use https: in Tomcat I'm trying to connect to an url using url = (URL) new URL(https://xx;); In Tomcat I get the error message unknown protocal: https Does anyone know how I get around this ?
RE: Tomcat start error
Try putting C:\jdk13\lib\tools.jar in your Classpath -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: 11 May 2001 16:03 To: [EMAIL PROTECTED] Subject: Tomcat start error I installed the tomcat 3.2.1 with jdk 1.3 in Win98. The enviroment setup is PATH=%PATH%;c:\jdk13\bin set JAVA_HOME=C:\jdk13 set TOMCAT_HOME=C:\tomcat When I run tomcat run, i just get an error message, Exception in thread main java.lang.NoClassDefFoundError: org/apache/tomcat/startup/Tomcat If I run startup, it just say start a new window and the new window just a blinking and disappear, as follwing message displayed, Including all jars in C:\TOMCAT\lib in your CLASSPATH. Using CLASSPATH: C:\TOMCAT\classes;C:\TOMCAT\lib\ANT.JAR;C:\TOMCAT\lib\JAXP.JAR; C:\TOMCAT\lib\SERVLET.JAR;C:\TOMCAT\lib\PARSER.JAR;C:\TOMCAT\lib\ WEBSER~1.JAR;C: \TOMCAT\lib\JASPER.JAR;C:\TOMCAT\lib\webserver.jar;C:\JDK13 \lib\tools.jar; Starting Tomcat in new window Your help is greatly apreciated. Thanks, Peter
Trying to use https: in Tomcat
I'm trying to connect to an url using url = (URL) new URL(https://xx;); In Tomcat I get the error message unknown protocal: https Does anyone know how I get around this ?
RE: Trying to use https: in Tomcat
I get a NoClassDefFoundError on the statement below. Do I have to make any run-time changes, i.e. add some JSSE jars to my Class Path or Tomcat ? -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 15:29 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Did you declared it in the java.securty file? If not, you may need to add the line, java.security.Provider provider = new com.sun.net.ssl.internal.ssl.Provider(); java.security.Security.addProvider(provider); Pae This made no difference at all ! -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Place the following line before the URL line as: java.lang.System.setProperty(java.protocol.handler.pkgs, com.sun.net.ssl.internal.www.protocol); Alternatively. we can declare it on the command line as well. Hope this help. Pae -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, May 10, 2001 6:40 AM Subject: Trying to use https: in Tomcat I'm trying to connect to an url using url = (URL) new URL(https://xx;); In Tomcat I get the error message unknown protocal: https Does anyone know how I get around this ?
RE: Trying to use https: in Tomcat
My next problem is when I try to connect. HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); String postData = x; conn.setRequestMethod(POST); conn.setDoOutput(true); conn.setRequestProperty(Content-Length, +postData.length()); conn.connect(); I get a time-out on the connect. -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 16:32 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Dave, Of course, JSSE has three JARs that need to be recognized. Otherwise, we will get the error message like you have. It applies all other Java package. :-) They can be placed under different places, but recommeded to place them under the path, {java.home}{file.separater}lib{file.separater}ext{file.separater} :-) Pae I get a NoClassDefFoundError on the statement below. Do I have to make any run-time changes, i.e. add some JSSE jars to my Class Path or Tomcat ? -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 15:29 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Did you declared it in the java.securty file? If not, you may need to add the line, java.security.Provider provider = new com.sun.net.ssl.internal.ssl.Provider(); java.security.Security.addProvider(provider); Pae This made no difference at all ! -Original Message- From: Pae Choi [SMTP:[EMAIL PROTECTED]] Sent: 10 May 2001 14:58 To: tomcat-user Subject: Re: Trying to use https: in Tomcat Place the following line before the URL line as: java.lang.System.setProperty(java.protocol.handler.pkgs, com.sun.net.ssl.internal.www.protocol); Alternatively. we can declare it on the command line as well. Hope this help. Pae -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Thursday, May 10, 2001 6:40 AM Subject: Trying to use https: in Tomcat I'm trying to connect to an url using url = (URL) new URL(https://xx;); In Tomcat I get the error message unknown protocal: https Does anyone know how I get around this ?
RE: installing tomcat 3.2 on windows 98
I run tomcat on my Windows 98 pc at home. In autoexec.bat I also have JAVA_HOME=C:\Java and the Classpath should also contain tools.jar from Java (lib or bin). David -Original Message- From: Peter Choe [SMTP:[EMAIL PROTECTED]] Sent: 04 May 2001 13:20 To: [EMAIL PROTECTED] Subject: installing tomcat 3.2 on windows 98 is it possible to have tomcat run on windows 98? i downloaded the binaries for tomcat 3.2 for windows and tried to run the tomcat.bat file. but i get an exception saying that org.tomcat.startup.Tomcat can't be found. i have the autoexec.bat file with the following: TOMCAT_HOME=c:\tomcat CLASSPATH=c:\tomcat\lib\servlet.jar;c:\tomcat\lib\webserver.jar;...etc for each jar file in tomcat\lib apparantly the tomcat.bat file is setting the proper classpath. any suggestions? peter choe
RE: installing tomcat 3.2 on windows 98
Oh Yes You Can ! -Original Message- From: Hari Yellina [SMTP:[EMAIL PROTECTED]] Sent: 04 May 2001 13:46 To: tomcat-user Subject: Re: installing tomcat 3.2 on windows 98 u cannot, try on NT - Original Message - From: Peter Choe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 04, 2001 10:19 PM Subject: installing tomcat 3.2 on windows 98 is it possible to have tomcat run on windows 98? i downloaded the binaries for tomcat 3.2 for windows and tried to run the tomcat.bat file. but i get an exception saying that org.tomcat.startup.Tomcat can't be found. i have the autoexec.bat file with the following: TOMCAT_HOME=c:\tomcat CLASSPATH=c:\tomcat\lib\servlet.jar;c:\tomcat\lib\webserver.jar;...etc for each jar file in tomcat\lib apparantly the tomcat.bat file is setting the proper classpath. any suggestions? peter choe
RE: Tomcat on 98
Yes -Original Message- From: Hari Yellina [SMTP:[EMAIL PROTECTED]] Sent: 04 May 2001 14:21 To: tomcat-user Subject: Tomcat on 98 Did any one worked on 98 using Tomcat. If yes please mail me.
RE: installing tomcat 3.2 on windows 98
Yellina, I don't think there is any documentation other than that which comes with Tomcat. David -Original Message- From: Hari Yellina [SMTP:[EMAIL PROTECTED]] Sent: 04 May 2001 14:29 To: tomcat-user Subject: Re: installing tomcat 3.2 on windows 98 Hi Dave, Where can I find the documentation for installing tomcat on 98. Please help me. Regards, Yellina. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 04, 2001 10:52 PM Subject: RE: installing tomcat 3.2 on windows 98 Oh Yes You Can ! -Original Message- From: Hari Yellina [SMTP:[EMAIL PROTECTED]] Sent: 04 May 2001 13:46 To: tomcat-user Subject: Re: installing tomcat 3.2 on windows 98 u cannot, try on NT - Original Message - From: Peter Choe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 04, 2001 10:19 PM Subject: installing tomcat 3.2 on windows 98 is it possible to have tomcat run on windows 98? i downloaded the binaries for tomcat 3.2 for windows and tried to run the tomcat.bat file. but i get an exception saying that org.tomcat.startup.Tomcat can't be found. i have the autoexec.bat file with the following: TOMCAT_HOME=c:\tomcat CLASSPATH=c:\tomcat\lib\servlet.jar;c:\tomcat\lib\webserver.jar;...etc for each jar file in tomcat\lib apparantly the tomcat.bat file is setting the proper classpath. any suggestions? peter choe
RE: Tomcat and Access Database
what is the value of query ? -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 15:54 To: '[EMAIL PROTECTED]' Cc: Sridevi Kumar Subject: Tomcat and Access Database Hello, I am Using Access Database to connect with JDBC in Java and my program looks like this... public class ...{ .. ... try{ Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); con=DriverManager.getConnection(jdbc:odbc:shree); }catch(Exception e){ e.printStackTrace(); System.exit(1); } try{ stmt=con.createStatement(); ResultSet rs=stmt.executeQuery(query); ResultSetMetaData rsmd=rs.getMetaData(); System.out.println(); out.println(font color=gray); out.println(ub+The Developers with +level+ Skill level in +softwarename + is/are :+/b/u); out.println(/font); out.println(hr border=2 color=midnightblue); out.println(\n); out.println(br); int no_column=rsmd.getColumnCount(); for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnnames=rsmd.getColumnName(i); out.print(B+columnnames+\t\t+/b); } out.println(br); while(rs.next()) { for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnValue=rs.getString(i); out.print(columnValue+\t\t); } out.println(br); } stmt.close(); con.close(); }catch(java.sql.SQLException e){ System.out.println(e.toString()); } out.close(); } } Please help me to connect this program to Tomcat and work from tomcat server. It's very urgent... Thank You.
RE: Tomcat and Access Database
I didn't make any changes to web.xml for database access. I also developed on JSWDK and ported to Tomcat, but I had no problems, i.e. the Access Database sql ran just the same. David -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 16:51 To: '[EMAIL PROTECTED]' Subject: RE: Tomcat and Access Database Actually I am connecting to jdbc through servlets for retrieving information of employee skillsets. It is working coolly with jsdk but i don't know how to make it work with tomcat server. I want to know the configuration to set it in tomcat Server.xml file and web.xml file. -Original Message- From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 11:11 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat and Access Database what is the value of query ? -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 15:54 To: '[EMAIL PROTECTED]' Cc: Sridevi Kumar Subject: Tomcat and Access Database Hello, I am Using Access Database to connect with JDBC in Java and my program looks like this... public class ...{ .. ... try{ Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); con=DriverManager.getConnection(jdbc:odbc:shree); }catch(Exception e){ e.printStackTrace(); System.exit(1); } try{ stmt=con.createStatement(); ResultSet rs=stmt.executeQuery(query); ResultSetMetaData rsmd=rs.getMetaData(); System.out.println(); out.println(font color=gray); out.println(ub+The Developers with +level+ Skill level in +softwarename + is/are :+/b/u); out.println(/font); out.println(hr border=2 color=midnightblue); out.println(\n); out.println(br); int no_column=rsmd.getColumnCount(); for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnnames=rsmd.getColumnName(i); out.print(B+columnnames+\t\t+/b); } out.println(br); while(rs.next()) { for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnValue=rs.getString(i); out.print(columnValue+\t\t); } out.println(br); } stmt.close(); con.close(); }catch(java.sql.SQLException e){ System.out.println(e.toString()); } out.close(); } } Please help me to connect this program to Tomcat and work from tomcat server. It's very urgent... Thank You.
RE: Tomcat and Access Database
The same as jswdk -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 17:26 To: '[EMAIL PROTECTED]' Subject: RE: Tomcat and Access Database That's what i am asking ,Kindlt tell me the codes for accessing servlets with JDBC from tomcat. -Original Message- From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 12:23 PM To: [EMAIL PROTECTED] Subject: RE: Tomcat and Access Database I didn't make any changes to web.xml for database access. I also developed on JSWDK and ported to Tomcat, but I had no problems, i.e. the Access Database sql ran just the same. David -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 16:51 To: '[EMAIL PROTECTED]' Subject: RE: Tomcat and Access Database Actually I am connecting to jdbc through servlets for retrieving information of employee skillsets. It is working coolly with jsdk but i don't know how to make it work with tomcat server. I want to know the configuration to set it in tomcat Server.xml file and web.xml file. -Original Message- From: [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 11:11 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat and Access Database what is the value of query ? -Original Message- From: Sridevi Kumar [SMTP:[EMAIL PROTECTED]] Sent: 30 April 2001 15:54 To: '[EMAIL PROTECTED]' Cc: Sridevi Kumar Subject: Tomcat and Access Database Hello, I am Using Access Database to connect with JDBC in Java and my program looks like this... public class ...{ .. ... try{ Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); con=DriverManager.getConnection(jdbc:odbc:shree); }catch(Exception e){ e.printStackTrace(); System.exit(1); } try{ stmt=con.createStatement(); ResultSet rs=stmt.executeQuery(query); ResultSetMetaData rsmd=rs.getMetaData(); System.out.println(); out.println(font color=gray); out.println(ub+The Developers with +level+ Skill level in +softwarename + is/are :+/b/u); out.println(/font); out.println(hr border=2 color=midnightblue); out.println(\n); out.println(br); int no_column=rsmd.getColumnCount(); for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnnames=rsmd.getColumnName(i); out.print(B+columnnames+\t\t+/b); } out.println(br); while(rs.next()) { for(int i=1;i=no_column;i++){ if(i1) out.print(,); String columnValue=rs.getString(i); out.print(columnValue+\t\t); } out.println(br); } stmt.close(); con.close(); }catch(java.sql.SQLException e){ System.out.println(e.toString()); } out.close(); } } Please help me to connect this program to Tomcat and work from tomcat server. It's very urgent... Thank You.