RE: what is url rewriting
I'd say make it work the other way around. If you want those URL's to be meaningful to the servlet (think search engines or referring to a specific call to your servlet), you'd have to do that anyway. So instead of trying to rewrite the URL in the addressbar, you make your servlet generate the URL's you want in your address bar and put those in the HREFs/ACTIONs on your form. Then (if neccesary, ) after the request you map the URL to your servlet parameters. JW -Original Message- From: Rum Pel [mailto:[EMAIL PROTECTED]] Sent: woensdag 14 augustus 2002 10:46 To: [EMAIL PROTECTED] Subject: what is url rewriting Can somebody tell me what is url rewriting? and does it solve my problem: I want to change the URL in the browser addressbar depending on what the servlet outputs. ie., is there any provision in the http spec for sending an url back to the client along with the content? Is this possible? thanks. --rp _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JDBC MySQL again
Hi, I searched the archives for a solution to my problem, but couldn't find any. Like many, I keep getting the following error: SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException) There's no stacktrace like some other people posted, I don't know why not. I think I got my sourcecode ok. I tried three different approaches: Class.forName(org.gjt.mm.mysql.Driver); Class.forName(org.gjt.mm.mysql.Driver).newInstance(); Thread.currentThread().getContextClassLoader().loadClass(org.gjt.mm.mys ql.Driver); I also got this other stuff in my error log when I start Tomcat, but I don't know if that's part of my problem or just the result of me ruining other files: Starting service Tomcat-Standalone Apache Tomcat/4.0.4 PARSE error at line 1 column 10 org.xml.sax.SAXParseException: Element type web-app must be declared. Server 1.6 is running Press [Ctrl]+[C] to abort Starting service Tomcat-Apache Apache Tomcat/4.0.4 SQLException: Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException) I got: Debian3.0/woody Tomcat4.0.4 j2sdk1.3 (BlackDown FCS) Mm.mysql-2.0.14 MySQL 3.23.49 JW Shapers p.s. I have the exact same servlet running fine on WindowsXP/Tomcat4.0.3/j2sdk14/mm.mysql-2.0.12/MySQL3.23.49. But I need Debian now. p.s.2 I have a deju-vu at this moment. Weird :) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JDBC MySQL again
generally, if you see this problem, your driver is loaded correctly; however, it is unable to connect to your mysql server. i would test this by trying to telnet to port 3306 on localhost and see if you get a connection. if you don't, you need to make sure your mysql is allowing connections over tcp/ip which, if i'm not mistaken, debian has turned off by default. look in the /etc/my.cnf or maybe /etc/mysql/my.cnf or some such for a skip-networking flag and comment it out if necessary. restart mysql, try the telnet again. if it works, restart tomcat and see if your app works. Very good! You're the 'winner' with the right answer! I was thinking my mysqld setup was ok, since it worked flawlessly with PHP. I guess PHP and MySQL have some sort of secret 'marriage', and don't connect over TCP/IP? [off-topic] Is that also the reason that php:mysql seems about twice as fast in executing queries in comparison to jdbc:mysql? I tested this on my Windows machine. [/off-topic] However, now I get the following exception: SQLException: Invalid authorization specification: Access denied for user: 'root@barrie' (Using password: YES) My guess is that I have to config mysqld in a way that it accepts this user (of which I'm pretty sure it has the correct login and password) from 'barrie' instead of 'localhost' (barrie and localhost essentially are the same Debian box). But that's not a question to ask to this list... Thanks Hoang! (and the rest of you who didn't give the right answer;). I tried your solutions, and at least I got rid of the parse error that also was in my catalina.out but that had a different cause). JW -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JDBC MySQL again
yay! do i get a medal or something? ;-) Yes you get a medal. Only thing is that it is so incredibly heavy that I can't send it by mail. You have to come pick it up at our office in Amsterdam :P O and I gave my thanks to Hoang, but I was mistaken. Thanks Peter! [off-topic] Is that also the reason that php:mysql seems about twice as fast in executing queries in comparison to jdbc:mysql? I tested this on my Windows machine. [/off-topic] yes. domain sockets leave out the whole tcp/ip stack and are much faster. Why on earth they invented JDBC for then? I am really dissappointed by the lack of performance compared to PHP. The processing of query results in Java is even worse (about 10 times slower). use mysql; grant all privileges on db.object(s) to root@barrie identified by 'some_password' [with grant option]; flush privileges; You get TWO medals now. minor nit - i wouldn't use the root user for these connections. if the password is somehow compromised, your *entire* server is compromised. if, however, you set up different users for each database only that particular database will be compromised. True. But at this stage it's not that important :) JW -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]