How to run a JSP/Servlet Web App on a pc unconnected with internet
Hi, I try make a presentation to show a web application but should use a laptop without net connection. In Tomcat's Server.XML the DTD file is from: !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; Without this I can use Servlet mapping, and have to change all codes in JSP to the full path, right? Regards Leeson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic drop down menus
http://www.htmlcodetutorial.com/ - Original Message - From: Anson Zeall [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, September 12, 2003 5:41 PM Subject: Dynamic drop down menus Hi, I want to know if there are free guides in teaching you how to do dynamic drop-down menus? Regards, Anson - 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]
Simple question about JSP page
Hi, Maybe it's a stupid question. Built jsps for addingsearching with MySQL. First listing all existing records in db and then adding a new one into database, then listing all records again. Now the list is the same as previous. How to solve it? THX - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to cache the user's input in a jsp page?
Hi How to cache the user's input in a jsp page? The following is some code of my JSP: % int item_num = 5; int row_num = 1; if(request.getParameter(row_num)!=null){ String rowstr = (request.getParameter(row_num)); try{ row_num = Integer.parseInt(rowstr); } catch(NumberFormatException ne){} } % ... ... TR class=LGREY TD class=L align=right width=25% Subjectnbsp; : /TD TD class=L width=75% nbsp; INPUT tabIndex=1 maxLength=100 size=40 name=subject /TD /TR .. select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\AddQuotation.jsp?actionfrom=%=request_from%row_num=%=i%%if(row_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select ... %for(int ii=0;iirow_num;ii++){% tr td width=25% align=center %=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=100 size=25 name=project_detail_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=quantity_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=unit_price_%=ii+1%/td /tr %}% The choosing of select will refresh this jsp and create the rows as many as choosed. But how to cache the input of Subject? email: INPUT NAME=email onChange=checkEmail(this.value)BR Can I do this without using javascript?
Re: How to cache the user's input in a jsp page?
Thanks I know maybe I should use session, but when I choose select box, the jsp page will be reloaded. How do I save the value of INPUT tabIndex=1 maxLength=100 size=40 name=subject into session, that after reloaded the value should be the same as user input previously? - Original Message - From: Duncan Strang [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 4:15 PM Subject: RE: How to cache the user's input in a jsp page? Check out JSP's implicit object collection For example, if you are using user sessions you can put any Object onto the session, this will then be available whenever the user accesses the page. To use the session object simply use session.setAttribute(identifier, Object); So to save an Integer (Objects only, not primitives) for example Integer foo = new integer(10); session.setAttribute(fooint foo); To retrieve it next request use Integer foo2 = (Integer)session.getAttribute(fooint); There are other implicit Objects including application (the jsp view of the Servlet context) but this is globally visible so shouldn't be use to store session type variables (IMHO) Or you could write your own cache :) Cheers Duncan -Original Message- From: engp0510 [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 09:00 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: How to cache the user's input in a jsp page? Hi How to cache the user's input in a jsp page? The following is some code of my JSP: % int item_num = 5; int row_num = 1; if(request.getParameter(row_num)!=null){ String rowstr = (request.getParameter(row_num)); try{ row_num = Integer.parseInt(rowstr); } catch(NumberFormatException ne){} } % ... ... TR class=LGREY TD class=L align=right width=25% Subjectnbsp; : /TD TD class=L width=75% nbsp; INPUT tabIndex=1 maxLength=100 size=40 name=subject /TD /TR .. select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\AddQuotation.jsp?actionfrom=%=request_from%row_num=%=i%%i f(row_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select ... %for(int ii=0;iirow_num;ii++){% tr td width=25% align=center %=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=100 size=25 name=project_detail_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=quantity_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=unit_price_%=ii+1%/td /tr %}% The choosing of select will refresh this jsp and create the rows as many as choosed. But how to cache the input of Subject? email: INPUT NAME=email onChange=checkEmail(this.value)BR Can I do this without using javascript? This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.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]
Re: How to cache the user's input in a jsp page?
Thanks But it is nothing with form and request. Maybe I should make me more clear: For the first time this JSP loaded, it is not sure how many rows of a table needed by user. Then user choos a select_box to set the rows number and then JSP was reloaded with table contain the number of rows user selected. select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\AddQuotation.jsp?actionfrom=%=request_from%row_num=%=i%%if(ro w_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select But user may set other fields before setting the number of rows, so when the JSP was reloaded, all filled fields ahould be cached, is it possible? - Original Message - From: Kwok Peng Tuck [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 4:31 PM Subject: Re: How to cache the user's input in a jsp page? In the servlet or jsp you could do : String text = request.getParameter(subject) ; Then do whatever you want with it. engp0510 wrote: Thanks I know maybe I should use session, but when I choose select box, the jsp page will be reloaded. How do I save the value of INPUT tabIndex=1 maxLength=100 size=40 name=subject into session, that after reloaded the value should be the same as user input previously? - Original Message - From: Duncan Strang [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, September 04, 2003 4:15 PM Subject: RE: How to cache the user's input in a jsp page? Check out JSP's implicit object collection For example, if you are using user sessions you can put any Object onto the session, this will then be available whenever the user accesses the page. To use the session object simply use session.setAttribute(identifier, Object); So to save an Integer (Objects only, not primitives) for example Integer foo = new integer(10); session.setAttribute(fooint foo); To retrieve it next request use Integer foo2 = (Integer)session.getAttribute(fooint); There are other implicit Objects including application (the jsp view of the Servlet context) but this is globally visible so shouldn't be use to store session type variables (IMHO) Or you could write your own cache :) Cheers Duncan -Original Message- From: engp0510 [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 09:00 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: How to cache the user's input in a jsp page? Hi How to cache the user's input in a jsp page? The following is some code of my JSP: % int item_num = 5; int row_num = 1; if(request.getParameter(row_num)!=null){ String rowstr = (request.getParameter(row_num)); try{ row_num = Integer.parseInt(rowstr); } catch(NumberFormatException ne){} } % ... ... TR class=LGREY TD class=L align=right width=25% Subjectnbsp; : /TD TD class=L width=75% nbsp; INPUT tabIndex=1 maxLength=100 size=40 name=subject /TD /TR .. select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\AddQuotation.jsp?actionfrom=%=request_from%row_num=%=i%%i f(row_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select ... %for(int ii=0;iirow_num;ii++){% tr td width=25% align=center %=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=100 size=25 name=project_detail_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=quantity_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=unit_price_%=ii+1%/td /tr %}% The choosing of select will refresh this jsp and create the rows as many as choosed. But how to cache the input of Subject? email: INPUT NAME=email onChange=checkEmail(this.value)BR Can I do this without using javascript? This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service
Detail: How to cache the user's input in a jsp page?
Hi , ALL, The following is my jsp page, store it into a file named MyQUESTION.jsp , pay attention for the Subjuect while u choosing the select. % int item_num = 5; int row_num = 1; if(request.getParameter(_rows)!=null){ String rowstr = (request.getParameter(_rows)); try{ row_num = Integer.parseInt(rowstr); } catch(NumberFormatException ne){} } % !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head /head center body table border=0 cellpadding=0 width=100% cellspacing=0 bordercolor=#FF height=384 TRTD align=right height=279 FORM name=form1 action=/operator method=post TABLE cellSpacing=1 width=100% border=1 height=261 align=left TBODY TR class=LGREY TD class=L align=right width=25% Subjectnbsp; : /TD TD class=L width=75% nbsp; INPUT tabIndex=1 maxLength=100 size=40 name=subject /TD /TR TR class=LGREY TD class=L align=right width=100% colspan=2 table cellSpacing=0 width=100% border=1 align=left bordercolor=#cc tr td width=25% align=center select size=1 name=item_num ONCHANGE=location=this.options[this.selectedIndex].value; %for(int i=1;i=5;i++){% option value=\MyQUESTION.jsp?_rows=%=i%%if(row_num==i){out.print(SELECTED);}% -%=i%-/option %}% /select /td td width=25% align=centerbProject Detail/b/td td width=25% align=centerbQuantity/b/td td width=25% align=centerbUnit Price( S$)/b/td /tr %for(int ii=0;iirow_num;ii++){% tr td width=25% align=center %=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=100 size=25 name=project_detail_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=quantity_%=ii+1%/td td width=25% align=center nbsp;INPUT tabIndex=2 maxLength=20 size=10 name=unit_price_%=ii+1%/td /tr %}% /table /TD/TR /TBODY /TABLE/TD/TR TR TD class=L align=right height=25 P align=centerinput type=submit value= Create input type=submit value= Clear /P/TD/TR/TBODY/TABLE/FORM/CENTER /BODY /HTML
Re: Any contractors from HK, S.E.Asia or India in this forum ?
From PR. China studying in Singapore. - Original Message - From: Clive Luk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 9:32 AM Subject: RE: Any contractors from HK, S.E.Asia or India in this forum ? I am from HK but i am working in australia... but i am still after help i can be a hk team if you don't mind... Cheers, Clive -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 9:37 AM To: Tomcat Users List Subject: Re: Any contractors from HK, S.E.Asia or India in this forum ? Beacuse I'm trying t put together a dedicated team in HK Santos Jha wrote: dude/dudess Why are u asking this question. Yes I am from SE Asia .so? [EMAIL PROTECTED] wrote: C'mon There are 7+ million people in HK, x-number of multi-nationals from y-number of industry sectors. I can't believe no HK person is contributing to or listening in on this forum. Don't be shy. [EMAIL PROTECTED] wrote: Hiya, all. Any contractors in this forum specializing in java applet/servlet, a2s, jndi in an apache2/tc4 environment and are from HK/China, S.E.Asia or India ? Got a website? TIA :-) - 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]
Re: Question about Notify all online user
Thx ben, I do very areciate your help. - Original Message - From: Ben Souther [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, August 14, 2003 1:02 AM Subject: RE: Question about Notify all online user I'm not at liberty to give out any code but the implementation is pretty straight forward. An iframe (inline frame) is just an HTML tag that allows you to embed one webpage into another. A Google search will get you many examples of it's implementation. The IFrame is in a div that has it's visibility set to hidden. The page in the iframe meta refresh tag that causes it to reload every n seconds. I think we have it set to 60 seconds. Every time the frame refreshes, the servlet queries the database for unread messages. If it finds any, it rewrites page and adds a javascript function which is triggered from the body onload event that fires off a popup window telling the user how many unread messages they have. In our database, we have two attributes for this feature; is_new and is_read. The proc sets the is_new value to false every time it runs so that the user doesn't have to deal with a popup window every time the page refreshes (unless a new message shows up, of course). is_read is pretty self explanatory. When users first log in they are shown a list of unread messages. In our case the popup window is actually a hidden div with gets set to visible when it needs to pop up. This works nicely for us because we can put links to the messages right in the popup window. It's best to keep treads on the list. That way someone else will be able to read the answer and possibly avoid asking the same question. Hope this helps -Ben On Wednesday 13 August 2003 12:39 pm, you wrote: Ben! Wah! Great! Could you give me more information about your implementation? I am not clear with iFrame. - Original Message - From: Ben Souther [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, August 14, 2003 12:32 AM Subject: Re: Question about Notify all online user We're doing something like this with a hidden frame (an iFrame) that refreshes it self every n seconds (using the Meta refresh tag). The frame just points to a servlet which queries the database for new messages. If there is a new message, the iframe uses javascript to fire off a pop up. message. You're other option would be to use an applet that maintains a statefull connection to your server. A applet list would be a better place to discuss that approach though. On Wednesday 13 August 2003 12:07 pm, engp0510 wrote: Hi, all How to implement notifying all online user when the record in database has been changed? I am using Servlet and JSP to build a small Supply-Chain system running on Tomcat with MySQL. Thanks Zhidao -- Ben Souther F.W. Davison Company, Inc. -- Ben Souther F.W. Davison Company, Inc. REGISTER NOW FOR THE SCORPEO USER CONFERENCE! September 18-19, 2003 in Boston/Brookline, MA Additional Training Sessions held September 17, 2003 More info http://www.fwdco.com/services/Uconf03/default.shtm - 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]
Question about Notify all online user
Hi, all How to implement notifying all online user when the record in database has been changed? I am using Servlet and JSP to build a small Supply-Chain system running on Tomcat with MySQL. Thanks Zhidao
Re: Question about Notify all online user
Ben! Wah! Great! Could you give me more information about your implementation? I am not clear with iFrame. - Original Message - From: Ben Souther [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, August 14, 2003 12:32 AM Subject: Re: Question about Notify all online user We're doing something like this with a hidden frame (an iFrame) that refreshes it self every n seconds (using the Meta refresh tag). The frame just points to a servlet which queries the database for new messages. If there is a new message, the iframe uses javascript to fire off a pop up. message. You're other option would be to use an applet that maintains a statefull connection to your server. A applet list would be a better place to discuss that approach though. On Wednesday 13 August 2003 12:07 pm, engp0510 wrote: Hi, all How to implement notifying all online user when the record in database has been changed? I am using Servlet and JSP to build a small Supply-Chain system running on Tomcat with MySQL. Thanks Zhidao -- Ben Souther F.W. Davison Company, Inc. - 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: Run Windows' command in Java method
http://java.sun.com/docs/books/tutorial/native1.1/ - Original Message - From: Cui Xiaojing-a13339 [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 15, 2003 11:41 AM Subject: Run Windows' command in Java method Hello All, Do you know if windows' command could be executed in Java method? If yes, which API class method can be used to do it? Thanks a lot. Regards, Xiaojing - 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]
HELP!! TOMCAT and MYSQL
Hi, I am using Tomcat 4.0 and MySQL 4.0.14 on WIn2K Professional. In Server.XML of Tomcat, I use: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=leeson;password= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / In MySQL, I set all user must access database with password and grant user 'leeson' with all privileges @ localhost. I can use leeson and password to log into MySQL. All setting of MySQL will work well when I login MySQL using CMD on Win2K But when I start tomcat-standalone, there is always : Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorizatio n specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) ... So, it seem Parser regard user as leeson;password, not leeson. But if I grant leeson all privileges but without password, the tomcat could work.
Re: HELP!! TOMCAT and MYSQL
Thanks very much! Y, I have tried. But always throw org.xml.sax.SAXParseException said a ; is needed to end the quote of password. Any advice? - Original Message - From: Emmanuel G. Dialynas [EMAIL PROTECTED] To: engp0510 [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 03, 2003 6:07 PM Subject: Re: HELP!! TOMCAT and MYSQL Try: connectionURL=jdbc:mysql://localhost/authority?user=leesonpassword= At 04:32 ìì 03/08/03 +0800, engp0510 wrote: Hi, I am using Tomcat 4.0 and MySQL 4.0.14 on WIn2K Professional. In Server.XML of Tomcat, I use: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=leeson;password= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / In MySQL, I set all user must access database with password and grant user 'leeson' with all privileges @ localhost. I can use leeson and password to log into MySQL. All setting of MySQL will work well when I login MySQL using CMD on Win2K But when I start tomcat-standalone, there is always : Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorizatio n specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) ... So, it seem Parser regard user as leeson;password, not leeson. But if I grant leeson all privileges but without password, the tomcat could work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HELP!! TOMCAT and MYSQL
Thanks Stuart. I always do this when I use JDBC in normal application. But during configing the Tomcat Server.XML, there is no instruction about separated properties for this REALM. Regards - Original Message - From: Stuart MacPherson [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED]; [EMAIL PROTECTED]; 'Emmanuel G. Dialynas' [EMAIL PROTECTED] Sent: Sunday, August 03, 2003 7:12 PM Subject: RE: HELP!! TOMCAT and MYSQL Split the user and pass off of the URL, and into separate properties... stu -Original Message- From: engp0510 [mailto:[EMAIL PROTECTED] Sent: 03 August 2003 11:40 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Emmanuel G. Dialynas Subject: Re: HELP!! TOMCAT and MYSQL Thanks very much! Y, I have tried. But always throw org.xml.sax.SAXParseException said a ; is needed to end the quote of password. Any advice? - Original Message - From: Emmanuel G. Dialynas [EMAIL PROTECTED] To: engp0510 [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, August 03, 2003 6:07 PM Subject: Re: HELP!! TOMCAT and MYSQL Try: connectionURL=jdbc:mysql://localhost/authority?user=leesonpassword= At 04:32 ìì 03/08/03 +0800, engp0510 wrote: Hi, I am using Tomcat 4.0 and MySQL 4.0.14 on WIn2K Professional. In Server.XML of Tomcat, I use: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=leeson;password= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / In MySQL, I set all user must access database with password and grant user 'leeson' with all privileges @ localhost. I can use leeson and password to log into MySQL. All setting of MySQL will work well when I login MySQL using CMD on Win2K But when I start tomcat-standalone, there is always : Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorizatio n specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) ... So, it seem Parser regard user as leeson;password, not leeson. But if I grant leeson all privileges but without password, the tomcat could work. - 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]
Tomcat and MySQL
Hi, I am using Tomcat 4.0 and MySQL 4.0.14 on WIn2K Professional. In Server.XML of Tomcat, I use: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.gjt.mm.mysql.Driver connectionURL=jdbc:mysql://localhost/authority?user=leeson;password= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name / In MySQL, I set all user must access database with password and grant user 'leeson' with all privileges. I can use leeson and password to log into MySQL. But when I start tomcat-standalone, there is always : Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorizatio n specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) LifecycleException: Exception opening database connection: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using password: NO) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:505) at org.apache.catalina.startup.Catalina.start(Catalina.java:776) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218) - Root Cause - java.sql.SQLException: Invalid authorization specification: Access denied for user: 'leeson;[EMAIL PROTECTED]' (Using p assword: NO) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:659) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562) at com.mysql.jdbc.Connection.init(Connection.java:491) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346) at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:548) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:505) at org.apache.catalina.startup.Catalina.start(Catalina.java:776) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218) Can anyone help me? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]