How to get Role and Password from JDBC Realm
Hello, I want to use the provided user_pass and user_role in the JDBCRealm-Database given in server.xml. What is the most elegant way to do this? Of cource I would be able to get it via request.getRemoteUser() and then make a select to the hardcoded database name with provided auth user and pass like it is given in server.xml. But there must be a better way since database name, username and driver url is already included in the Realm section? How to use it? I read the JDBCRealm code but I did not find out where it gets the connectionUrl a.s.o. Best Regards Thomas
RE:RE: How to get Role and Password from JDBC Realme -using 3.2.2
Thanks Jan, I have to apologize not to have explained the intended usage: I need username, userpassword and userrole since I will use it for DB-Authorization (GRANT to group, and user to tables and so on, connecting DB with username,userpass). I intend to synchronize username, password and role with the authDB of the specific Datebase (Interbase and isc4.gdb). Is there a methode like org.apache.catalina.realm.GenericPrincipal principal = request.getUserPrincipal() for Tomcat 3.2.2 and is there an elegant method for attaching password, too? Thank you for help Thomas "Pernica, Jan" wrote: >It depends what do you want: >to get user login = request.getRemoteUser() >to whether he/she have a role you can use >request.isUserInRole("myrole") > > Even you are able to get the list of roles > org.apache.catalina.realm.GenericPrincipal principal = >request.getUserPrincipal(); >principal.getRoles() > >Regards > >Jan On Monday, May 28, 2001 4:22 PM, [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] wrote: > Hello, > > I want to use the provided user_pass and user_role in the > JDBCRealm-Database given in server.xml. What is the most elegant way to do > this? Of cource I would be able to get it via request.getRemoteUser() and > then make a select to the hardcoded database name with provided auth user > and pass like it is given in server.xml. But there must be a better way > since database name, username and driver url is already included in the > Realm section? How to use it? I read the JDBCRealm code but I did not find > out where it gets the connectionUrl a.s.o. > > Best Regards >Thomas
RE: JavaBeans
Hi Kavi, JavaBeans must be placed in the Web-Inf/classes directory of your webapp as long as they don't belong to a package and you don't set a classpath. Else you must create a directory structure similar to your package name, i.e. package: yourpack.com --> web-inf/classes/com/yourpak. Hope this helps Thomas
Problem sun.misc solved - but why is authorization=null???? Please help (urgent!)
Hello, I solved the problem with sun.misc (was an error in directive). But now I had a strange error. When performing form login via JDBC and trying to read out AUTHORIZATION Header the string is NULL. Why? Does form login not write Authorization in HTTP Header? I do the following: <% String aut = request.getHeader("Authorization"); BASE64Decoder decoder = new BASE64Decoder(); if (aut == null) { out.println("NOTHING INSIDE"); } else { String userInfo = aut.substring(6).trim(); } %> Can anyone help please?? Thomas
authorization=null?? I use JDBC Realm?
Hi Jan, does it really work?? I am using Apache 1.3, Tomcat 3.2.2, Win NT 4.0 SP6, JDBC Realm, the page is under in a frame (the first subpage) and request.getRemoteUser() and request.getAuthType() are working, giving me FORM and USER. But request.getHeader always returns null. I am speechless ... Any further suggestions, please? Thanks Thomas
TWIMC: username and password in session and jdbc Realm
Finally it was easy: JDBCRealm stores the j_username and j_password as session variable and yout can get it via session.getAttribute either as JSP scriplet or as servlet. Just store it or get it through the first page after login. Sometimes it is worth studying the source code.. (here Securitytools.java). I do not know wether to store it as session variable is a slight security hole..maybe, but in Intranet environment the benefits of knowing the username and password - esp. for DB connections which are synchronized with the database access userids - is beyond security wholes. Regards Thomas
How to get userRole from Tomcat 3.2.3?
Hi, I am using JDBCRealm and need a convenient way to get the userRoles of the user. GetRemoteUser is not the right way. In the source code of JDBCRealm I found a getuserRoles method - how can I use it in my own servlets? Calling jedbcRealm = new JDBCRealm() and then jdbcRealm.getuserRoles do not work, of course... Best thanks in advance Thomas W. Richter
Custom Homepage
I installed tomcat yesterday and i am totally confused about its config files. i am trying to change the default homepage so that tomcat calls a servlet in the preconfigured servet directory instead of the index.jsp page. Is it possible Thanks in advance A tomcat newbie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Tomcat Book, Recommendations???
Well, everyone else is right. assuming that you have some experience with http servers in general, you dont need a big fat manual for tomcat. but in case, you are new to web techs altogether, probably Oreilly Tomcat will give you a helping hand good luck - Original Message - From: "John Turner" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, July 29, 2003 5:24 AM Subject: Re: Best Tomcat Book, Recommendations??? > > As a Wrox author, I have to tell you that your "overall impression" is > incorrect. Books are like anything else: sometimes you think they're > great, sometimes you think they're not. > > To make a sweeping generalization is, in my mind, illogical. > > John > > Tony LaPaso wrote: > > > Hi all, > > > > Can some of you recommend a good Tomcat book? In the archives I've read that > > the Wrox book, "Professional Apache Tomcat", is pretty good but my overall > > impression of Wrox books is that they're generally not worth the paper > > they're printed on. > > > > I know O'Reilly has a relatively new TC book that looks pretty good. I was > > also hoping to find something that covered TC 5, although this is a "nice to > > have". > > > > Any suggestions? > > > > Thanks. > > > > > > > > - > > 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 2 start tomcat from ms-dos command prompt without creating a new window ?
i have an question about how to start the tomcat servlet container as an windows-process from the ms-dos command prompt without getting a new cmd-window. Its that when i start my java server with STARTUP it makes a new command window and starts the new process in this new window. i know what in unix one can write nohup before calling the startscript too not to kill the process if u close ur telnet window, there has to be a way 2 do this, i hope u understand my question, thanx _ MSN Messenger http://www.msn.no/messenger - Den korteste veien mellom deg og dine venner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how 2 start tomcat from ms-dos command prompt without creating a new window?
Yes, but, would tomcat then start with the windows startup ? and every time i take down the server for a new deployment, would i then need to restart windows all over again for tomcat to start ? That ain't a very good solution, is there not any other way i can do this ? Thanx for ur response. From: John Turner <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]> To: Tomcat Users List <[EMAIL PROTECTED]> Subject: Re: how 2 start tomcat from ms-dos command prompt without creating a new window ? Date: Thu, 24 Jul 2003 15:26:42 -0400 Install Tomcat as a service. John Me myself wrote: i have an question about how to start the tomcat servlet container as an windows-process from the ms-dos command prompt without getting a new cmd-window. Its that when i start my java server with STARTUP it makes a new command window and starts the new process in this new window. i know what in unix one can write nohup before calling the startscript too not to kill the process if u close ur telnet window, there has to be a way 2 do this, i hope u understand my question, thanx _ MSN Messenger http://www.msn.no/messenger - Den korteste veien mellom deg og dine venner - 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] _ Hotmail snakker ditt språk! http://www.hotmail.msn.com/cgi-bin/sbox?rru=dasp/lang.asp - Få Hotmail på norsk i dag - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat as Windows service on Windows XP
How can i use tomcat as a windows service on XP ? I cant find any documentation about this in the tomcat documentation. Thanx. _ Hotmail snakker ditt språk! http://www.hotmail.msn.com/cgi-bin/sbox?rru=dasp/lang.asp - Få Hotmail på norsk i dag - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat 3.2.2 session already invalidated-serious problem
Hi, im usuing tomcat 3.2.1..when i invalidate my session im getting error.. this is my piece of code if(monitor.containsKey(uname)){ HttpSession oldSession = (HttpSession)monitor.get(uname); oldSession.invalidate(); } the error is Internal Servlet Error:javax.servlet.ServletException: setAttribute: Session already invalidated at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2.java:129) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.IllegalStateException: setAttribute: Session already invalidated at org.apache.tomcat.session.StandardSession.setAttribute(StandardSession.java:721) at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2.java:111) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) please help me..very urgentkarthikGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.