try use request.getRemoteUser() // or String auth = request.getHeader("Authorization");
String userInfo =auth.substring(6).trim(); BASE64Decoder decoder = new BASE64Decoder(); String NameAndPassword =new String(decoder.decodeBuffer(userInfo)); StringTokenizer stk=new StringTokenizer(NameAndPassword,":"); String Name=stk.nextToken(); String Password=stk.nextToken(); ----- Original Message ----- From: "Softwareentwicklung Hauschel" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Tuesday, December 25, 2001 17:48 Subject: Intercepting AuthenticationFilter and dispatching need help ! > Hey all, > i want to check if the user is authenticated. > I've read that the Filters are the right place to do that. > If the User is not authenticated, so i want to dispatch him to a login page. > Does anybody knows how to do that ? > > I've tryed it in the Filter in this way: > > ((HTTPServletRequest)servletRequest).getRequestDispatcher( "pub/ueberweisung > .jsp" ).forward( servletRequest, servletResponse ); > > But there is always an Error compiling the jsp ?! > if I call this jsp (plain html) without a filter it works without any > problems ? > > Pleas help.... > Fredy > > > > -----Ursprüngliche Nachricht----- > Von: Alex Chaffee [mailto:[EMAIL PROTECTED]] > Gesendet: Samstag, 22. Dezember 2001 02:24 > An: [EMAIL PROTECTED] > Betreff: [FAQ] jGuru FAQ Update > > > jGuru maintains FAQs and Forums on Servlets, JSP, and Tomcat (as well as > many other Java topics). Here is an automated update on recent postings to > Tomcat-related FAQs. Please direct flames and feedback to [EMAIL PROTECTED] . > > - Alex > > > ++ JavaServer Pages (JSP) FAQ: http://www.jguru.com/faq/JSP > > Can I make a jsp custom tag to return a value in to a jsp variable.<p> > I want a jsp custom tag to evaluate some condition based on the parameters I > pass and return a boolean to the jsp page in a java variable (type > boolean).<p> Can anybody give some sample of the code using similar > functionality. <br>Can we some how use the get methods in the tagHandler in > our jsp to retrieve the values? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=593533 > > Is it possible to invoke customtags onEvents like onClick? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=592466 > > Here is what I have: > <P> > 1. My application is under /opt/tomcat/webapps/myApp > <br> > 2. My jsp file is : /opt/tomcat/webapps/myApp/web/test.jsp > <br> > It contains; > <br> > . . . > <br> > <% > <br> > String configFile=getInitParameter("configFile"); > <br> > System.out.println("configFIle="+configFile); > <br> > %> > <P> > 3. My web.xml is: /opt/tomcat/webapps/myApp/WEB-INF/web.xml > <br> > It contains: > <web-app> > <br> > <servlet> > <br> > <servlet-name>test</servlet-name> > <br> > <jsp-file>/web/test.jsp</jsp-file> > <br> > <init-parameter> > <br> > <param-name>configFile</param-name> > <br> > <param-value>TOTO</param-value> > <br> > </init-parameter> > <br> > </servlet> > <br> > <servlet-mapping> > <br> > <servlet-name>test</servlet-name> > <br> > <url-pattern>/web/test.jsp</url-pattern> > <br> > </servlet-mapping> > <br> > </web-app> > <P> > What am I doing wrong? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=592461 > > I'm working on the JSP - Tomcat model, I'm using JSPC to pre-compile my > JSPs, Is there a way to prevent any new (non pre-compiled) JSPs from being > executed (compiled) in tomcat? ie. I do not want any new JSPs , which have > not being pre-compiled to be executed via tomcat on the browser, Is there > any property/configuration file which I need to change in Tomcat?? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=592460 > > Why use JSP? All that we can do with scriptlets we can do with JavaScript as > well, I think. > Can somebody explain? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=590882 > > We are building a series of JSP pages, each of which is responsible for > producing a different area of the screen. > > Any given screen that the end user sees, therefore, is made up of a number > of "blocks", each of which has been generated by a single JSP. The top level > JSP calls in the "blocks" using a jsp:include. > > We are trying to use the JSP errorPage directive on every JSP to display an > error to the user if something goes wrong with any of the "blocks", but are > finding that we end up with the error page only taking up part of the screen > (for the block which had an error), whereas we would like the whole screen > to be filled up by the errorPage. > In other words - if something goes wrong with any of the blocks that > comprise a screen - we would like to display nothing but the error page. > > What is the best way to do this ? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=590880 > > ++ Servlets FAQ: http://www.jguru.com/faq/Servlets > > HttpUtils.parseQueryString is deprecated. What should we use instead ? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=587251 > > In some web.xml I find DOCTYPE reference of "web-app_2_2.dtd",(in Weblogic > 5.1 example) in others, of "web-app_2.2.dtd" (in java pet store). What is > the difference between the two DTDs? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=586710 > > What are the steps that I need to follow to deploy my servlet in WebLogic > 6.1? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=586701 > > How can I suppress the parameters from displaying in the URL? For instance, > if I pass in a password, I don't want it to show up in the address bar. > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=586493 > > ++ Tomcat FAQ: http://www.jguru.com/faq/Tomcat > > Why is Tomcat 4.0 so slow when connecting via a URLConnection? > http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=588390 > > > You can shut email notification off at the FAQ home > page(s) or: > > http://www.jguru.com/guru/notifyprefs.jsp > > > > -- > 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]>