Re: JSP, sessions: how to notify bean about the session end?
Any examples or resources for this? William Brogden wrote: "Sergey V. Udaltsov" wrote: Hello all My JSPs uses some session-scoped bean. This bean, among other duties, is responsible for logging in and out of some app server. I would like the bean to perform autologout on the session end. Is it possible? How? AFAIK usual finalize can be called ages after the object is really free - so I do not like this way. Any ideas? Regards, Sergey Take a look at the HttpSessionBindingListener interface. If your Bean implements this class, you can get a notification when the session times out or is otherwise invalidate. -- Tony Keith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Help on j_security_check -- not found
Hello all, I have seen your various posting regarding JDBCRealm, IMHO you seem to be an expert in this topic. I have configured my server.xml and web.xml properly to throw me to login.jsp page whenever I try to access a protected page. But the problem is that when I submit log in on jsp page it does not do anything, it shows me the login page again. And the httpd.log file shows me an error saying /var/tomcat/webapps/example/jsp/security/login/null not found my server.xml entries are as follows RequestInterceptor className="org.apache.tomcat.request.JDBCRealm" debug="99" driverName="com.sybase.jdbc.SybDriver" connectionURL="jdbc:sybase:Tds:/testdb" connectionName="test" connectionPassword="test01" userTable="t_user_profile" userNameCol="usernames" userCredCol="userpasswd" userRoleTable="t_roles" roleNameCol="roles" / The database is set up exactly as shown my web.xml has following entries security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- url-pattern//jsp/security/protected//*/url-pattern url-pattern/secure/checkMerchant.cgi/url-pattern !-- If you list http methods, only those methods are protected -- http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint !-- Anyone with one of the listed roles may access this area -- role-nameallok/role-name role-namereadonly/role-name /auth-constraint /security-constraint !-- Default login configuration uses BASIC authentication -- !-- login-config auth-methodBASIC/auth-method realm-nameExample Basic Authentication Area/realm-name /login-config -- !-- Form-based login is enabled by default. If you wish to try Basic authentication, comment out the login-config section below and uncomment the one above. -- login-config auth-methodFORM/auth-method realm-nameJDBC/realm-name form-login-config form-login-page/examples/jsp/security/login/login.jsp/form-login-page form-error-page/examples/jsp/security/login/error.jsp/form-error-page /form-login-config /login-config What else I need to do to make JDBCRealm working. I made the JkMount entry in mod_jk.conf file Thanks and Regards -- Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Bean problem...
Hello, I have a strange problem with beans. I can run my bean just fine if it is in a package. For example: package foo; public class testBean { ... } and it is located in a foo directory under classes directory: /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes/foo but if I remove the package from the class public class testBean { ... } and move the class to the classes directory: /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes The bean gets produces the following errors: org.apache.jasper.JasperException: Unable to compile class for JSP/usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps/_0002fjsp_0002fforms_0002fsignup_0002ejspsignup_jsp_9.java:63: Class jsp.f_00025rms.testBean not found. testBean initHandler = null; ^ //usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps//_0002fjsp_0002fforms_0002fsignup_0002ejspsignup_jsp_9.java:66: Class jsp.f_00025rms.testBean not found. initHandler= (testBean) ^ //usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps//_0002fjsp_0002fforms_0002fsignup_0002ejspsignup_jsp_9.java:71: Class jsp.f_00025rms.testBean not found. initHandler = (testBean) Beans.instantiate(this.getClass().getClassLoader(), "testBean"); This is on RH7.0 apache tomcat 3.2.1 mod_jk Any ideas why the bean has to be in a package to work? The /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes is in the $CLASSPATH... TIA -- Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Bean problem...
Is this a specification of JSP? Vikramjit Singh wrote: there is a need for a package to make a bean. the bean has always to be written in a package. otherwise the JSP cannot acces the bean bye -Original Message- From: Tony Keith [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 5:48 PM To: tomcat-user Subject: Bean problem... Hello, I have a strange problem with beans. I can run my bean just fine if it is in a package. For example: package foo; public class testBean { ... } and it is located in a foo directory under classes directory: /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes/foo but if I remove the package from the class public class testBean { ... } and move the class to the classes directory: /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes The bean gets produces the following errors: org.apache.jasper.JasperException: Unable to compile class for JSP/usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps/_0002fjsp_00 02fforms_0002fsignup_0002ejspsignup_jsp_9.java:63: Class jsp.f_00025rms.testBean not found. testBean initHandler = null; ^ //usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps//_0002fjsp_000 2fforms_0002fsignup_0002ejspsignup_jsp_9.java:66: Class jsp.f_00025rms.testBean not found. initHandler= (testBean) ^ //usr/local/src/jakarta-tomcat/work/localhost_8080%2Fmyapps//_0002fjsp_000 2fforms_0002fsignup_0002ejspsignup_jsp_9.java:71: Class jsp.f_00025rms.testBean not found. initHandler = (testBean) Beans.instantiate(this.getClass().getClassLoader(), "testBean"); This is on RH7.0 apache tomcat 3.2.1 mod_jk Any ideas why the bean has to be in a package to work? The /usr/local/src/jakarta-tomcat/webapps/myapps/WEB-INF/classes is in the $CLASSPATH... TIA -- Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] TIA Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Apache/Tomcat port configuration
In tomcat/apache configuration...I have aliases, and mapping working fine. When calling upon the page with http://192.168.1.10:8080/mypath/script.cgi the servlet is executed properly and there is no problem. However the same address typed as http://192.168.1.10/mypath/script.cgi fails to work. Where do I need to change my configuration so that apache knows to send the page request to tomcat? Also, what is the configuration to enable SSL so that the above address could also be accessed via https? Does apache need to have a virtual host for this IP/host? Thanks Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: passing parameters to a Servlet
Christoph Kukulies wrote: I have some strings with blanks that I have to pass to a Servlet in the URL. How can I do that? -- Chris Christoph P. U. Kukulies [EMAIL PROTECTED] If you are trying to test your servlet by passing information through a URL, then try the following. servletnameparameter1=this%20and%20 that where a '%20' is a URL encoded space. Hope this helps -- Tony Keith
Re: How to configure Mysql with Tomcat.
Zebadiah Kimmel wrote: The following code should work if your database's root password is empty: Class.forName(dbDriver).newInstance(); My problem is the driver isn't being loaded. Configuration problems, I believe... connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db Login); As for connecting with a non-empty password, I don't know how to do that. If you figure it out, please let me know. --Zeba At 09:58 AM 11/16/00 -0800, Tony Keith wrote: >Hello, > >I wrote a simple servlet to insert a row into a mysql database table. >I'm running Tomcat 3.2b7. > >What are the steps to configure Tomcat to work with this servlet? >The problem I'm having now is the driver isn't found. > >Where do I place the driver? In the lib directory? > >How do I reference a new instance of the driver? >This is how I reference it now: >Class.forName("org.mm.mysql.Driver").newInstance(); > >Will the connection information remain the same? >Here is the connection information I currently use: >con = DriverManager.getConnection("jdbc:mysql://localhost/webdata", >"user", "password"); > >TIA >-- >Tony Keith -- Tony Keith Director of Information Technology Paycom.net 4215 Glencoe Avenue, First Floor Marina Del Rey, CA 90292 TEL: (310) 827-5880 ext. 304 FAX: (310) 827-5519
Re: How to configure Mysql with Tomcat.
Noel Morgan wrote: For Tomcat 3.2b6 I used: my setup: Apache 1.3.12 RH 6.2 Linux 2.2.14-5.0 Class.forName("org.gjt.mm.mysql.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/DatabaseName?user=dbuserpassword=dbpassword"); put the jdbc drivers in the classes folder of your app like: cp -Rf $JDBC_HOME/org $MYAPP_HOME/WEB-INF/classes I tried this but I still get the same error... Is there any other configuration to the web.xml? That should do it, but I have noticed serious performance degradation in switching from JServ 1.1.2 to Tomcat 3.2b6. I am not sure if I am missing something in the docs, but JServ 1.1.2/GNUJsp 1.0 is IMHO much faster (at least with the mm.mysql JDBC driver apps I have written) If someone could point me to some tuning tips/parameters I may have missed in the standard docs I would really appreciate it. Noel - Original Message - >From : Zebadiah Kimmel [EMAIL PROTECTED]> Sent : Thu, 16 Nov 2000 13:49:07 -0500 To : [EMAIL PROTECTED],[EMAIL PROTECTED] Subject : Re: How to configure Mysql with Tomcat. The following code should work if your database's rootpassword is empty: Class.forName(dbDriver).newInstance(); connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db Login); As for connecting with a non-empty password, I don'tknow how to do that. If you figure it out, please let me know. --Zeba At 09:58 AM 11/16/00 -0800, Tony Keith wrote: >Hello, > >I wrote a simple servlet to insert a row into a mysqldatabase table. >I'm running Tomcat > >What are the steps to configure Tomcat to work withthis servlet? >The problem I'm having now is the driver isn't found. > >Where do I place the driver? In the lib directory? > >How do I reference a new instance of the driver? >This is how I reference it now: >Class.forName("org.mm.mysql.Driver").newInstance(); > >Will the connection information remain the same? >Here is the connection information I currently use: >con =DriverManager.getConnection("jdbc:mysql://localhost/webdata", >"user", "password"); > >TIA >-- >Tony Keith ______ Move your email to a better address. Over 1,000 domains to choose from! FREE! PRIVATE! http://www.MailSpace.com -- Tony Keith Director of Information Technology Paycom.net 4215 Glencoe Avenue, First Floor Marina Del Rey, CA 90292 TEL: (310) 827-5880 ext. 304 FAX: (310) 827-5519
Re: How to configure Mysql with Tomcat. (problem Fixed!)
Tony Keith wrote: Once I copied the Mysql classes to the /WEB-INF/classes directory it worked. I also was specifying the wrong path for the driver. I had org.mm.mysql.Driver instead of org.gjt.mm.mysql.Driver. Thanks for everyone's help. Noel Morgan wrote: For Tomcat 3.2b6 I used: my setup: Apache 1.3.12 RH 6.2 Linux 2.2.14-5.0 Class.forName("org.gjt.mm.mysql.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/DatabaseName?user=dbuserpassword=dbpassword"); put the jdbc drivers in the classes folder of your app like: cp -Rf $JDBC_HOME/org $MYAPP_HOME/WEB-INF/classes I tried this but I still get the same error... Is there any other configuration to the web.xml? That should do it, but I have noticed serious performance degradation in switching from JServ 1.1.2 to Tomcat 3.2b6. I am not sure if I am missing something in the docs, but JServ 1.1.2/GNUJsp 1.0 is IMHO much faster (at least with the mm.mysql JDBC driver apps I have written) If someone could point me to some tuning tips/parameters I may have missed in the standard docs I would really appreciate it. Noel - Original Message - >From : Zebadiah Kimmel [EMAIL PROTECTED]> Sent : Thu, 16 Nov 2000 13:49:07 -0500 To : [EMAIL PROTECTED],[EMAIL PROTECTED] Subject : Re: How to configure Mysql with Tomcat. The following code should work if your database's rootpassword is empty: Class.forName(dbDriver).newInstance(); connPool[i]=DriverManager.getConnection("jdbc:mysql://"+dbServer+"?user="+db Login); As for connecting with a non-empty password, I don'tknow how to do that. If you figure it out, please let me know. --Zeba At 09:58 AM 11/16/00 -0800, Tony Keith wrote: >Hello, > >I wrote a simple servlet to insert a row into a mysqldatabase table. >I'm running Tomcat > >What are the steps to configure Tomcat to work withthis servlet? >The problem I'm having now is the driver isn't found. > >Where do I place the driver? In the lib directory? > >How do I reference a new instance of the driver? >This is how I reference it now: >Class.forName("org.mm.mysql.Driver").newInstance(); > >Will the connection information remain the same? >Here is the connection information I currently use: >con =DriverManager.getConnection("jdbc:mysql://localhost/webdata", >"user", "password"); > >TIA >-- >Tony Keith ______ Move your email to a better address. Over 1,000 domains to choose from! FREE! PRIVATE! http://www.MailSpace.com -- Tony Keith Director of Information Technology Paycom.net 4215 Glencoe Avenue, First Floor Marina Del Rey, CA 90292 TEL: (310) 827-5880 ext. 304 FAX: (310) 827-5519 -- Tony Keith Director of Information Technology Paycom.net 4215 Glencoe Avenue, First Floor Marina Del Rey, CA 90292 TEL: (310) 827-5880 ext. 304 FAX: (310) 827-5519