FastCommonAccessLogValve to log the bytes gzipped
(Already posted once on tomcat-user) Hi, I'm trying to use an AccessLogValve to log the bytes send over the network, but I have gzip compression actived while in the log goes the bytes count before compression (I've checked it with a sniffer): 192.168.0.64 - - [22/Jul/2008:14:01:15 +0200] GET /standard-atlante-plus/ HTTP/1.1 200 2481 Content-encoded entity body (gzip): 1163 bytes - 2481 bytes 192.168.0.64 - - [22/Jul/2008:14:01:15 +0200] GET /standard-atlante-plus/servlet/serLogin HTTP/1.1 200 4106 Content-encoded entity body (gzip): 1348 bytes - 4106 bytes Is there a way to log the compressed bytes count ? Many thanks in advance, Best regards - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Coyote connector and documentation..
Ok thats great, I think i came across the 4.1 connector docs by googling and wasnt able to navigate to that page easily! Thanks. Dan - Original Message From: Tomcat Users List users@tomcat.apache.org To: Tomcat Users List users@tomcat.apache.org Subject: RE: Coyote connector and documentation.. Date: 28/07/08 16:52 gt; From: Dan Keeley [mailto:[EMAIL PROTECTED] gt; Subject: Coyote connector and documentation.. gt; gt; The tomcat documentation talks about parameters such as gt; maxProcessors rather than maxThreads which seems to gt; be the term used everywhere else. Which Tomcat doc still talks about maxProcessors? This is the link to the http connector doc for 5.5: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html gt; Also; The documentation on the http connector is linked in gt; with the tomcat 4.1 docs. Again, where do see that? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message sent using UebiMiau 2.7.10 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Hosting
On Sun, 2008-07-27 at 19:12 -0700, Kerry Jacabson wrote: Having been burnt a number of times, I was wondering if anyone knew of a reliable host that specializes in Java Hosting for Tomcat. Especially if they offer some sort of trial service, so I can evaluate the service without making any commitments. I've been pleased with Rimu Hosting http://rimuhosting.com/ Not sure if they offer a trial period though. Cheers, Ben - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Hosting
Hii, RimuHosting is best and hostjava.net is also best On Mon, Jul 28, 2008 at 7:42 AM, Kerry Jacabson [EMAIL PROTECTED]wrote: Having been burnt a number of times, I was wondering if anyone knew of a reliable host that specializes in Java Hosting for Tomcat. Especially if they offer some sort of trial service, so I can evaluate the service without making any commitments. Thanks, Kerry
Embedding custom metadata in a jsp page; access generated Class via reflection?
Hi, I need to associate some custom metadata with JSP pages, and access it *before* the page is rendered. The current implementation uses an xml with the same name as the jsp, eg foo.jsp foo.xml so that when I'm about to forward to foo.jsp I first look for a foo.xml file and if present parse it to extract the metadata. I'd really like to embed that metadata within the jsp page itself - but need access to that info *before* the jsp page executes. (a) Is it possible to obtain the name of the Class that is generated for a jsp, so that I could do introspection on it? It would then be possible to embed something like this into the page: %! private static MyMetaData metaData = new MetaData(); public static MyMetaData getMetaData() { return metaData; } % and look for/invoke the getMetaData method *before* forwarding to the page. Of course, this also requires that the servlet-class for the jsp has actually been generated. Is there a way to guarantee this is done for any particular jsp before actually doing a forward? Note that requiring pre-compilation of all jsps is not an option. This metadata stuff is needed for an open-source framework, and it is not reasonable to tell every possible user of this framework to precompile their jsps. (b) If the above is possible, is there a way to generate those static members from a custom JSP tag? It would be nicer to be able to do: myns:declareMetaData / and have that define the static members listed above. Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Thanks, Simon - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
Simon Kitching wrote: Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Please provide as with more details, at this point your requirement is a little bit strange. Have you considered using filters? -- Mikolaj Rydzewski [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [programmazione] Embedding custom metadata in a jsp page; access generated Class via reflection?
I would use the Model-View-Control pattern. First it must be defined a Controller, which is simply Servlet mapped to catch all the request. This servlet can read the XML and append your metadata to the request and forward it to the correct jsp (which will handle your metadata i suppose) Regards Luca -- From: Simon Kitching [EMAIL PROTECTED] Sent: Tuesday, July 29, 2008 11:04 AM To: users@tomcat.apache.org Subject: [programmazione] Embedding custom metadata in a jsp page; access generated Class via reflection? Hi, I need to associate some custom metadata with JSP pages, and access it *before* the page is rendered. The current implementation uses an xml with the same name as the jsp, eg foo.jsp foo.xml so that when I'm about to forward to foo.jsp I first look for a foo.xml file and if present parse it to extract the metadata. I'd really like to embed that metadata within the jsp page itself - but need access to that info *before* the jsp page executes. (a) Is it possible to obtain the name of the Class that is generated for a jsp, so that I could do introspection on it? It would then be possible to embed something like this into the page: %! private static MyMetaData metaData = new MetaData(); public static MyMetaData getMetaData() { return metaData; } % and look for/invoke the getMetaData method *before* forwarding to the page. Of course, this also requires that the servlet-class for the jsp has actually been generated. Is there a way to guarantee this is done for any particular jsp before actually doing a forward? Note that requiring pre-compilation of all jsps is not an option. This metadata stuff is needed for an open-source framework, and it is not reasonable to tell every possible user of this framework to precompile their jsps. (b) If the above is possible, is there a way to generate those static members from a custom JSP tag? It would be nicer to be able to do: myns:declareMetaData / and have that define the static members listed above. Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Thanks, Simon - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Committing sendRedirect()
Tore Your code below is written as though the 'out' was like writing data to a console. The processing in a servlet is part of a request/response cycle, where the 'request' tells it what to do and the response is the reply. Because of the nature of the request/response cycle you only get one chance at the reply. The javadocs for HttpServletResponse.sendRedirect make this clear. If the response has already been committed, this method throws an IllegalStateException. After using this method the response should be considered to be committed and should not be written to. In other words, in one servlet request/response cycle you get exactly one chance to issue a 'sendRedirect'. If you think this through you'll see that this is how it has to be: Browser sends request to servlet Servlet process request and sendsRedirect Browser display response. Your problem is that you are trying to generate a second response without a correspondng request. The first response is for the 'top 25' and the second is for 'all the rest', but by then you've already committed the response. To achieve what I think you are trying to achieve would require you to create some mechanism where the lucene query results are processed in a separate thread and your application makes TWO requests - one for the first set of results and then one for the final set of results. There are far too many different ways to do this to detail here - I hope this helps Regards Alan Chaney Tore Eriksson wrote: Hi everybody, I have a problem with redirects in Tomcat 5.5.25. I am doing a Lucene search and would like to send a redirect after finding the top 25 hits, commit this response, and then continue processing the remaining hits. The relevant parts of the doPost() code are as below: final int PARTIAL_HITS = 25; for (int i = 0; i hits.length(); i++) { Document doc = hits.doc(i); String citation = doc.get(citation); /** Insert into table */ try { insertId.setInt(1, java.lang.Integer.parseInt(citation)); insertId.executeUpdate(); } catch (SQLException e) { out.sendError(500, Bad SQL insert: + e); } catch (Exception e) {} if (i == PARTIAL_HITS) { // Intermittant redirect out.sendRedirect(resultUrl); } } insertId.close(); if (!out.isCommitted()) { // Final redirect out.sendRedirect(resultUrl); } My problem is that the intermittant redirect is not committed until the function returns, which will take quite some time for some queries. I have tried HttpServletResponse.flushBuffer() and other possible variations. Any pointers would be most appreciated. Tore ___ Tore Eriksson [tore.eriksson ad po.rd.taisho.co.jp] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] !DSPAM:488e7ade203691909011899! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
Mikolaj Rydzewski schrieb: Simon Kitching wrote: Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Please provide as with more details, at this point your requirement is a little bit strange. Have you considered using filters? Ok, here are some more details. I'm working on the myfaces orchestra flow project (for JavaServer Faces, aka JSF). It allows one JSF page to call another JSF page like a subroutine, passing parameters and allows the called page(s) to simply return to the page that called them, passing back results. This makes navigation between pages easier, makes the data passing explicit, and avoids any potential variablename collisions by setting up a completely clean scope for the called page to run in, with only the passed variables visible. When a call to a page is done, the page from which the call is made must declare metadata about what the parameters to be passed are, and what logical service the called page provides. The called page also needs to declare what input parameters it expects, and what logical service it provides. Think of this like a Java method prototype (which is also metadata, and can be queried via java reflection). The code where this metadata is needed is in a JSF ViewHandler, which is indirectly called from the JSF FacesServlet class, after the user has submitted a form. The metadata is used for sanity-checking of the call and setting up of the passed parameters (rearrangement of variables in the http session scope etc). Then a forward to the called page is done. As described in the original email, this is currently done by looking for a .xml file sitting beside each .jsp. It works ok, and for any JSF view mechanism (jsp, facelets, clay, etc). But some people might find embedding the information in the actual page to be nicer to work with. Doing this with Facelets isn't too hard, but embedding the necessary info into a jsp page is straining my jsp knowledge considerably :-) However I think the issue is a generic one, not anything specific to this particular case: I want to add metadata to a jsp page, just like java annotations provide static metadata about a class without needing to create an instance and execute it. I would think that being able to annotate a jsp would be useful for many purposes. Regards, Simon - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
Simon Kitching wrote: As described in the original email, this is currently done by looking for a .xml file sitting beside each .jsp. It works ok, and for any JSF view mechanism (jsp, facelets, clay, etc). But some people might find embedding the information in the actual page to be nicer to work with. Doing this with Facelets isn't too hard, but embedding the necessary info into a jsp page is straining my jsp knowledge considerably :-) However I think the issue is a generic one, not anything specific to this particular case: I want to add metadata to a jsp page, just like java annotations provide static metadata about a class without needing to create an instance and execute it. I would think that being able to annotate a jsp would be useful for many purposes. Interesting reading. Unfortunately I have no expierience with JSF. Since JSP compilation is container dependant, I'm afraid it is hard to find any generic solution. I'd rather go with the rule: if it ain't broke, don't fix it ;-) -- Mikolaj Rydzewski [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Hosting
RimuHosting is expensive. Just clicked a server together and ended up with twice of what I'm paying now with less included traffic. Leon On Tue, Jul 29, 2008 at 10:32 AM, Nikunj [EMAIL PROTECTED] wrote: Hii, RimuHosting is best and hostjava.net is also best On Mon, Jul 28, 2008 at 7:42 AM, Kerry Jacabson [EMAIL PROTECTED]wrote: Having been burnt a number of times, I was wondering if anyone knew of a reliable host that specializes in Java Hosting for Tomcat. Especially if they offer some sort of trial service, so I can evaluate the service without making any commitments. Thanks, Kerry - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
- Original Message - From: Simon Kitching [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 29, 2008 12:07 PM Subject: Re: Embedding custom metadata in a jsp page; access generated Class via reflection? Mikolaj Rydzewski schrieb: Simon Kitching wrote: Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Please provide as with more details, at this point your requirement is a little bit strange. Have you considered using filters? Ok, here are some more details. I'm working on the myfaces orchestra flow project (for JavaServer Faces, aka JSF). It allows one JSF page to call another JSF page like a subroutine, passing parameters and allows the called page(s) to simply return to the page that called them, passing back results. This makes navigation between pages easier, makes the data passing explicit, and avoids any potential variablename collisions by setting up a completely clean scope for the called page to run in, with only the passed variables visible. When a call to a page is done, the page from which the call is made must declare metadata about what the parameters to be passed are, and what logical service the called page provides. The called page also needs to declare what input parameters it expects, and what logical service it provides. Think of this like a Java method prototype (which is also metadata, and can be queried via java reflection). The code where this metadata is needed is in a JSF ViewHandler, which is indirectly called from the JSF FacesServlet class, after the user has submitted a form. The metadata is used for sanity-checking of the call and setting up of the passed parameters (rearrangement of variables in the http session scope etc). Then a forward to the called page is done. As described in the original email, this is currently done by looking for a .xml file sitting beside each .jsp. It works ok, and for any JSF view mechanism (jsp, facelets, clay, etc). But some people might find embedding the information in the actual page to be nicer to work with. Doing this with Facelets isn't too hard, but embedding the necessary info into a jsp page is straining my jsp knowledge considerably :-) However I think the issue is a generic one, not anything specific to this particular case: I want to add metadata to a jsp page, just like java annotations provide static metadata about a class without needing to create an instance and execute it. I would think that being able to annotate a jsp would be useful for many purposes. Regards, Simon Ok... you on a mission ;) Some guesses 4 u... What about something like... The JSP is well formed XML so !-- This is Simons meta data MyBean=org.wada.wada var=Title/ var=Date/ var=Date/ varArray=TableOfTels/ /MyBean -- html Yada Yada Its in a comment so its not compiled... you parse the comment then stick your stuff thru your XML digester factory... A bean pops out... your servlet populates it and forwards it Idea... normal JSP mechanics ignore your meta data... You take that idea a little further and make a tag Simons:IgnoreThisTag The stuff Now the tag engine makes the bean and puts it in the pages session Request... The calling program just has to get the bean from the session introspect and populate You put an event handler in the bean and you on your way to building your own Netbeans VWP system (swing for the web) ... probably a good place to steal from ;) I dont use JSF... but I get the feeling that if you did dig around in VWP you'd probably find the tags that do it... ie Tag libs are meta data (I think)... it gets compiled... it makes beans... then its Java again... I think ;) I think the whole reason for XHTML and all the rest is so HTML pages can hold meta data... in theory your external XML should drop in... but you just have to make sure the JSP compiler ignores it, or processes it (I think) Anyway its nice to see people throwing idea's around best of luck --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Writing to NFS
Chris, You were right in the pathlength has nothing to do with the problem. When I put the code in the execute method of a servlet it works with the expect response times. The logic to create the file is running as a JMS client within Tomcat, so basically there is a JMS MessageListener (on a separate thread) within tomcat, making the I/O calls. You mentioned thread scheduling in your response mail, how could thread scheduling affect a file write (within Tomcat). - Kevin -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 4:32 PM To: Tomcat Users List Subject: Re: Tomcat Writing to NFS -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevin, Kevin Daly (kedaly) wrote: | I have a Web Application running on Tomcat that writes to NFS. Since the same JVM and same standard classes are being used to write to the file, there should be no difference between your webapp and a standalone Java app. | So for example creating the same 1.5K file takes | | 14 msecs to /nfshome/transcripts/tmp.xml | | 19 msecs to /nfshome/transcripts/dialogid/tmp.xml | | 28 msecs to /nfshome/transcripts/sessionid/dialogid/tmp.xml | | 37 msecs to /nfshome/transcripts/sessionid/dialogid/day/tmp.xml 1.5k isn't very big. What if you try writing, say, 1MiB to the same file. Does the entire file write scale linearly with path length, or does this just look like noise in your timing data? | Reason I am posting to tomcat mailer is when I try the above from a | standalone Java App, I don't see this behaviour - all file writes take | about 14 msecs. I am running Tomcat Version 5.5.17 - Linux platform. | Any ideas why the above might be happening. Something else you might try is putting this code into a ServletContextListener's contextInitialized() method -- one that will run before any requests are handled. If the timing is similar to your standalone Java app, then the problem is likely to be simple thread scheduling and just a fluke that the timings appear to be related to the path length. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkiHTtsACgkQ9CaO5/Lv0PC3agCgi5Ka1pZA8dtawz5y0tOGv8fE yNQAn0eOuFvlzLq6i7XATTeDh4SI0qlU =JBdv -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
Johnny Kewl wrote: The JSP is well formed XML so It's not true. IMO it's worse to force users to model JSPs as well formed XML documents rather than using additional XML metadata files. -- Mikolaj Rydzewski [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting up Comet on Tomcat 6
Hello! I apologize if this question has been asked many times before. I've searched quite a bit for concrete answers on how to setup Comet but I'm having no luck. From what I understand, all that is needed to successfully set it up is to replace the default connector with either NIO or APR. My connector looks like: Connector port=8080 protocol=org.apache.coyote.http11.Http11AprProtocol maxThreads=2000 connectionTimeout=6 redirectPort=8443/ The Tomcat logs show APR initializing without error, however my CometProcessor implementation doesn't receive event() calls. It does receive service() calls which I use to bump an error. Without service() throwing an error, doGet() is being called in my tests. What can I do to resolve this issue? Better yet, is there a flag I can set somewhere which would allow me to debug the issue further? Your help is greatly appreciated! T. Anthony Rabaa Senior Programmer Analyst Emergis Product Development Kanata, Ontario, Canada (613) 287-3134, Extension 266 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Committing sendRedirect()
Maybe a solution could be to use AJAX client side to make the multiple requests. The client make the first request, when the server answers the client make the following request and so on. So the desired effect should be reached. Regards Luca -- From: Tore Eriksson [EMAIL PROTECTED] Sent: Tuesday, July 29, 2008 4:00 AM To: users@tomcat.apache.org Subject: [programmazione] Committing sendRedirect() Hi everybody, I have a problem with redirects in Tomcat 5.5.25. I am doing a Lucene search and would like to send a redirect after finding the top 25 hits, commit this response, and then continue processing the remaining hits. The relevant parts of the doPost() code are as below: final int PARTIAL_HITS = 25; for (int i = 0; i hits.length(); i++) { Document doc = hits.doc(i); String citation = doc.get(citation); /** Insert into table */ try { insertId.setInt(1, java.lang.Integer.parseInt(citation)); insertId.executeUpdate(); } catch (SQLException e) { out.sendError(500, Bad SQL insert: + e); } catch (Exception e) {} if (i == PARTIAL_HITS) { // Intermittant redirect out.sendRedirect(resultUrl); } } insertId.close(); if (!out.isCommitted()) { // Final redirect out.sendRedirect(resultUrl); } My problem is that the intermittant redirect is not committed until the function returns, which will take quite some time for some queries. I have tried HttpServletResponse.flushBuffer() and other possible variations. Any pointers would be most appreciated. Tore ___ Tore Eriksson [tore.eriksson ad po.rd.taisho.co.jp] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
receiving 404 page not found from godaddy.com
I have a small jsp application which I packaged as a war file and deployed to my godaddy user account. The war exploded as expected. In my webapp, under the newly exploded context root, I am able to hit the html files, however, the jsp's are giving me a 404 not found. I have tested this locally using tomcat 5.5 and it works like a charm. I've contacted godaddy.com to find out what may be the reason for the 404 error and all the rep said was that my account is not showing any errors and that's all he could do for me. He said they could not help with deployment issues. If I wanted better diagnostics, I needed to upgrade to a dedicated server. I do have java/jsp enabled for the site so it should work. I chose to deploy as a war because it's much easier to deploy, however, I'm wondering if I should deploy the file individually. Has anyone had this same experience with deploying war files to godaddy.com. I'm considering using another host as I've had nothing but problems with this company. -- View this message in context: http://www.nabble.com/receiving-404-page-not-found-from-godaddy.com-tp18712493p18712493.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
- Original Message - From: Mikolaj Rydzewski [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 29, 2008 2:50 PM Subject: Re: Embedding custom metadata in a jsp page; access generated Class via reflection? Johnny Kewl wrote: The JSP is well formed XML so It's not true. True... its a choice, jsp or jspx, the user can choose if well formed or not, the advantage being that if they do the can check the whole doc for validity but doesnt really matter, within the tag or comment its XML. Dont know about other ide's but in NB you got that right click check XML thing going... only reason I mentioned it also have choice of choosing JSP or JSPX I definitely dont think % @MyAnnotation Yada Some Java % would work I dont think JSP compiler is there, maybe wrong IMO it's worse to force users to model JSPs as well formed XML documents rather than using additional XML metadata files. Maybe... but its what Simon wants, and I think that in the end he may just end up making a tag lib... Its fun stuff, and who knows maybe he makes a VWP tool that does work on a large site ;) Another framework... yummy ;) Its nice to just see someone exploring an idea... instead of... I got a problem... where the *** is Chuck ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Log4J logging from server not working
I've been stuck with this problem for about a week now. I am trying to get the Log4J working in my servlet. I have tried it on Tomcat 6.0.16 as well as Tomcat 5.5.26. I have followed all the directions in the logging section for both versions. The internal logging works fine in both cases. However, my servlet does not produce any log at all. I must be doing something incorrectly, although I have rechecked everything 100 times over. If anyone can help me I would really appreciate it. Are the instructions for setting up logging complete? Here is the description of my environment: Windows environment (have superuser access). JDK 1.6.0_07 Log4J 1.2.15 Here is also my log4j.properties that lives in WEB-INF/classes log4j.rootLogger=DEBUG, R, stdout # - # # Appenders # # - # log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # WARNING: the %M specifier which generates the method name # is apparently very slow. log4j.appender.stdout.layout.conversionPattern=%d %-5p [%t] %c{5}.%M: %m%n # New appender # log4j.appender.R=org.apache.log4j.RollingFileAppender # Put the file in the tomcat instance log dir. log4j.appender.R.File=${catalina.home}/logs/sms.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] %c{5}.%M: %m%n - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: address bar shows ip instead of domain name
Thanks. I have placed the files/codes in the right spots and when I do localhost:8080/mywebapp/rewrite-status I get the urlrewrite page. But what i need is when a user types in the browser www.mydomain.com, it should go to http://00.00.00.00:8080/mywebapp/welcome.action but still display http://www.mydomain.com and when I click on a link, it should take my to ex. http://00.00.00.00:8080/mywebapp/register.action but in the address bar show http://www.mydomain.com/register.action. Can you use this example for the urlrewrite and where to place the codes? Thanks. Ken Bowen wrote: I don't know of any tutorial -- I found the documentation gave me enough guidance. It's really pretty straight-forward. Drop a filter definition like this in your web.xml: filter filter-nameUrlRewriteFilter/filter-name filter-classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/ filter-class !-- init-param param-namelogLevel/param-name param-valuesysout:DEBUG/param-value /init-param -- /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping Then add a file urlrewrite.xml in your WEB-INF containing mappings in the following spirit: rule from^/PrivacyPolicy$/from to type=forward/PrivacyPolicy.do/to /rule outbound-rule from^/PrivacyPolicy.do$/from to/PrivacyPolicy/to /outbound-rule The outbound-rule describes how to map something going from the server to the browser, and the (inbound) rule describes how to map what you mapped on output (now coming back from the browser) back into what you need to see on input. If you removed the comment symbols in the filter element, you get detailed debugging ouptut. Hope this helps. Ken On Jul 28, 2008, at 6:16 PM, nilanthan wrote: Thanks. I have looked at that before but am a bit confused about the instructions. Is there a good tutorial for this urlrewrite? Ken Bowen wrote: Apply a rewrite filter (http://tuckey.org/urlrewrite/) to map the ip expression to what you want. ken On Jul 28, 2008, at 5:36 PM, nilanthan wrote: So what Can I do so that that domain goes to that address but shows the domain in the address bar? Yuval Perlov wrote: Where ever you forward, that's what the address bar shows On Jul 28, 2008, at 7:45 PM, nilanthan wrote: Hi, I have a website hosted on netfirms. I have a domain,exmaple, mydomain.com and it forwards to an address http:/xx.xx.xxx.xx:8080/folder1/ welcome.action where xx is the ip of the server. Im runningTomcat 5.5 alone without apache. The problem is that when a users goes to www.mydomain.com, it takes them to the site but in the address bar it shows http:/xx.xx.xxx.xx:8080/folder1/welcome.action instead of mydomain.com. Is this an issue with DNS or something in Tomcat? I will have multiple sites running in the future so I cannot place the site folder in the ROOT directory. Thanks. -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18694567.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p1863.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18700955.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18713361.html Sent from the Tomcat - User mailing list archive at
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
Since you have a well-formed (XML) jsp and well-formed XML metadata, you could run an (pre-runtime) XSL transformation that combines the two however you need. In other words, instead of combining known metadata at runtime, pre-generate the JSPX in some prior stage. With JSP 2.0, EL and the standard taglib it is really easy to work with JSP as XML so you can get the benefits of many different ways to transform it (XSL, XQuery, SAX filter, some DOMish manipulation, etc and you don't even need to use java) best, -Rob On Tue, 2008-07-29 at 15:48 +0200, Johnny Kewl wrote: - Original Message - From: Mikolaj Rydzewski [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 29, 2008 2:50 PM Subject: Re: Embedding custom metadata in a jsp page; access generated Class via reflection? Johnny Kewl wrote: The JSP is well formed XML so It's not true. True... its a choice, jsp or jspx, the user can choose if well formed or not, the advantage being that if they do the can check the whole doc for validity but doesnt really matter, within the tag or comment its XML. Dont know about other ide's but in NB you got that right click check XML thing going... only reason I mentioned it also have choice of choosing JSP or JSPX I definitely dont think % @MyAnnotation Yada Some Java % would work I dont think JSP compiler is there, maybe wrong IMO it's worse to force users to model JSPs as well formed XML documents rather than using additional XML metadata files. Maybe... but its what Simon wants, and I think that in the end he may just end up making a tag lib... Its fun stuff, and who knows maybe he makes a VWP tool that does work on a large site ;) Another framework... yummy ;) Its nice to just see someone exploring an idea... instead of... I got a problem... where the *** is Chuck ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting up Tomcat as a service
My environment: Windows XP-Pro Tomcat 6.0.16 I'm trying to set up Tomcat as a service so that I can use my computer as a server for dev/test purposes. Hoping to drop a .war file into \webapps, and make it available that way. I can't start Tomcat using startup.bat because my JAVA_HOME variable is not recognized even though I have set it to point to the jdk folder. I have been able to set JAVA_HOME only under User Variables - permissions do not allow me to set System Variables - is this the problem? All input much appreciated. Many thanks! -bob
RE: Setting up Tomcat as a service
Chances are if permissions are preventing you from setting system variables, they will also prevent you from installing services. Running as an ordinary user rather than an admin will work fine but you'll need to get JAVA_HOME set correctly and start it using the startup.bat script or wrap it in your own script that sets JAVA_HOME manually. -Original Message- From: Riaz, Bob [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 17:25 To: Tomcat Users List Subject: Setting up Tomcat as a service My environment: Windows XP-Pro Tomcat 6.0.16 I'm trying to set up Tomcat as a service so that I can use my computer as a server for dev/test purposes. Hoping to drop a .war file into \webapps, and make it available that way. I can't start Tomcat using startup.bat because my JAVA_HOME variable is not recognized even though I have set it to point to the jdk folder. I have been able to set JAVA_HOME only under User Variables - permissions do not allow me to set System Variables - is this the problem? All input much appreciated. Many thanks! -bob ___ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. ___ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting up Tomcat as a service
Thanks! Running as an ordinary user, I have set JAVA_HOME to the path where the jdk folder is located; I've also appended this path in the PATH variables - all under User Variables. Do I need to do something else to set JAVA_HOME? -bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2008 11:29 AM To: users@tomcat.apache.org Subject: RE: Setting up Tomcat as a service Chances are if permissions are preventing you from setting system variables, they will also prevent you from installing services. Running as an ordinary user rather than an admin will work fine but you'll need to get JAVA_HOME set correctly and start it using the startup.bat script or wrap it in your own script that sets JAVA_HOME manually. -Original Message- From: Riaz, Bob [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 17:25 To: Tomcat Users List Subject: Setting up Tomcat as a service My environment: Windows XP-Pro Tomcat 6.0.16 I'm trying to set up Tomcat as a service so that I can use my computer as a server for dev/test purposes. Hoping to drop a .war file into \webapps, and make it available that way. I can't start Tomcat using startup.bat because my JAVA_HOME variable is not recognized even though I have set it to point to the jdk folder. I have been able to set JAVA_HOME only under User Variables - permissions do not allow me to set System Variables - is this the problem? All input much appreciated. Many thanks! -bob ___ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. ___ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log4J logging from server not working
Does anybody has any idea what might be causing the problem with Log4J? I've googled for the longest time and there are no leads I found. Denis - Original Message From: Denis Kezerashvili [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, July 29, 2008 9:49:08 AM Subject: Log4J logging from server not working I've been stuck with this problem for about a week now. I am trying to get the Log4J working in my servlet. I have tried it on Tomcat 6.0.16 as well as Tomcat 5.5.26. I have followed all the directions in the logging section for both versions. The internal logging works fine in both cases. However, my servlet does not produce any log at all. I must be doing something incorrectly, although I have rechecked everything 100 times over. If anyone can help me I would really appreciate it. Are the instructions for setting up logging complete? Here is the description of my environment: Windows environment (have superuser access). JDK 1.6.0_07 Log4J 1.2.15 Here is also my log4j.properties that lives in WEB-INF/classes log4j.rootLogger=DEBUG, R, stdout # - # # Appenders # # - # log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # WARNING: the %M specifier which generates the method name # is apparently very slow. log4j.appender.stdout.layout.conversionPattern=%d %-5p [%t] %c{5}.%M: %m%n # New appender # log4j.appender.R=org.apache.log4j.RollingFileAppender # Put the file in the tomcat instance log dir. log4j.appender.R.File=${catalina.home}/logs/sms.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] %c{5}.%M: %m%n - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: address bar shows ip instead of domain name
In rule, map /mydomain.com to /mywebapp/welcome.action in outbound-rule, map /mywebapp/welcome.action to /mydomain.com Do that for welcome, register, and every other page. Depending on the rules you need, you can make some use of regular expressions. On Jul 29, 2008, at 10:25 AM, nilanthan wrote: Thanks. I have placed the files/codes in the right spots and when I do localhost:8080/mywebapp/rewrite-status I get the urlrewrite page. But what i need is when a user types in the browser www.mydomain.com, it should go to http://00.00.00.00:8080/mywebapp/welcome.action but still display http://www.mydomain.com and when I click on a link, it should take my to ex. http://00.00.00.00:8080/mywebapp/register.action but in the address bar show http://www.mydomain.com/register.action. Can you use this example for the urlrewrite and where to place the codes? Thanks. Ken Bowen wrote: I don't know of any tutorial -- I found the documentation gave me enough guidance. It's really pretty straight-forward. Drop a filter definition like this in your web.xml: filter filter-nameUrlRewriteFilter/filter-name filter- classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/ filter-class !-- init-param param-namelogLevel/param-name param-valuesysout:DEBUG/param-value /init-param -- /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping Then add a file urlrewrite.xml in your WEB-INF containing mappings in the following spirit: rule from^/PrivacyPolicy$/from to type=forward/PrivacyPolicy.do/to /rule outbound-rule from^/PrivacyPolicy.do$/from to/PrivacyPolicy/to /outbound-rule The outbound-rule describes how to map something going from the server to the browser, and the (inbound) rule describes how to map what you mapped on output (now coming back from the browser) back into what you need to see on input. If you removed the comment symbols in the filter element, you get detailed debugging ouptut. Hope this helps. Ken On Jul 28, 2008, at 6:16 PM, nilanthan wrote: Thanks. I have looked at that before but am a bit confused about the instructions. Is there a good tutorial for this urlrewrite? Ken Bowen wrote: Apply a rewrite filter (http://tuckey.org/urlrewrite/) to map the ip expression to what you want. ken On Jul 28, 2008, at 5:36 PM, nilanthan wrote: So what Can I do so that that domain goes to that address but shows the domain in the address bar? Yuval Perlov wrote: Where ever you forward, that's what the address bar shows On Jul 28, 2008, at 7:45 PM, nilanthan wrote: Hi, I have a website hosted on netfirms. I have a domain,exmaple, mydomain.com and it forwards to an address http:/xx.xx.xxx.xx:8080/folder1/ welcome.action where xx is the ip of the server. Im runningTomcat 5.5 alone without apache. The problem is that when a users goes to www.mydomain.com, it takes them to the site but in the address bar it shows http:/xx.xx.xxx.xx:8080/folder1/welcome.action instead of mydomain.com. Is this an issue with DNS or something in Tomcat? I will have multiple sites running in the future so I cannot place the site folder in the ROOT directory. Thanks. -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18694567.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p1863.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18700955.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
RE: Setting up Tomcat as a service
Try prepending rather than appending JAVA_HOME\bin to the PATH (bin directory is where java.exe is located and must be on the path). If there is another JVM already on the system path, you'll need to override it so prepending should do this. Also, be careful if there are spaces in JAVA_HOME path - make sure they are quoted or not if necessary. -Original Message- From: Riaz, Bob [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 17:33 To: Tomcat Users List Subject: RE: Setting up Tomcat as a service Thanks! Running as an ordinary user, I have set JAVA_HOME to the path where the jdk folder is located; I've also appended this path in the PATH variables - all under User Variables. Do I need to do something else to set JAVA_HOME? -bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2008 11:29 AM To: users@tomcat.apache.org Subject: RE: Setting up Tomcat as a service Chances are if permissions are preventing you from setting system variables, they will also prevent you from installing services. Running as an ordinary user rather than an admin will work fine but you'll need to get JAVA_HOME set correctly and start it using the startup.bat script or wrap it in your own script that sets JAVA_HOME manually. -Original Message- From: Riaz, Bob [mailto:[EMAIL PROTECTED] Sent: 29 July 2008 17:25 To: Tomcat Users List Subject: Setting up Tomcat as a service My environment: Windows XP-Pro Tomcat 6.0.16 I'm trying to set up Tomcat as a service so that I can use my computer as a server for dev/test purposes. Hoping to drop a .war file into \webapps, and make it available that way. I can't start Tomcat using startup.bat because my JAVA_HOME variable is not recognized even though I have set it to point to the jdk folder. I have been able to set JAVA_HOME only under User Variables - permissions do not allow me to set System Variables - is this the problem? All input much appreciated. Many thanks! -bob ___ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. ___ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing. Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP. This email may relate to or be sent from other members of the Barclays Group. ___ - To start a new topic, e-mail:
Re: Auth incorrectly redirects to img file
OK, a bit more info. I might have set up my tomcat incorrectly, tho I'm not entirely sure why. In my login.jsp file, I have a simple image div id=logoimg src=c:url value='/img/logo.gif' / //div which when I try to login, the source is: div id=logoimg src=/myapp/img/logo.gif //div which is what I expect. The problem is, I can't actually view the logo.gif file this is a basic login page: [code] html xmlns=http://www.w3.org/1999/xhtml; head title PAC - Applications /title /head body div id=header div id=logoimg src=c:url value='/img/logo.gif'///div div form method=POST action=j_security_check input type=text name=j_username input type=password name=j_password input type=submit name=login value=login /form /body /html [/code] again, like before, I can login sucessfully, but it redirects me to whatever the image that doesn't show up (so the logo.gif file). When I redirect myself manually to a correct url, i have all the correct permissions. Is there something Im missing here? Even more weird? - say I remove the offending line. But say I replay it with a link rel=stylesheet href=c:url value=/css/site.css / type=text/css / at the top of my head. When I attempt to login, the site.css file is not loaded. But when I login, it attempts to redirect and dumps the actual site.css file to the browser. config problem?? Junos On Mon, Jul 28, 2008 at 5:14 PM, Jerry Atrick [EMAIL PROTECTED] wrote: When attempting to log into a standard form-based login field, I'm always redirected to an image folder. My folder layout: /img /web-inf/ /web-inf/web.xml /index.jsp /login.jsp /error.jsp setup: Spring2.5/tiles2/tomcat5.5 in my web.xml: [code] security-constraint display-nameSecurity Constraint/display-name web-resource-collection web-resource-nameProtected Pages/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method /web-resource-collection auth-constraint role-namemyAdmin/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config [/code] pretty standard stuff. If you want to see any of the other code, just ask... What happens: 1. I attempt to go to a url 2. It properly stops me and asks me to login 3. I enter user credentials and hit login 4. It sucessfully logins. 5. It redirects me to /img/myimage.gif every time. I know that the login works fine, as when I fix my url to the url i was originally at, everything is correctly authenticated. Is there a way to set a default url when you attempt to login? Anyone else get a similar problem before?
tomcat security and window open js
all, we are having issues with IE(?) - javascript - window.open function and tomcat. When we deploy tomcat with basic authentication security enabled and in our jsp when ever we call window.open(url,.), it asks for username / password (authetication) again. how do we over come this? is this issue with IE or this is how http basic authentication works? if we try new window (ctrl + N) and paste the new jsp url, it works fine. i don't think its relavant to this, i tried setting up valve and it didn't work. https://issues.apache.org/bugzilla/show_bug.cgi?id=44527 thanks dan
Re: Auth incorrectly redirects to img file
Am Dienstag, den 29.07.2008, 13:44 -0400 schrieb Jerry Atrick: OK, a bit more info. I might have set up my tomcat incorrectly, tho I'm not entirely sure why. In my login.jsp file, I have a simple image div id=logoimg src=c:url value='/img/logo.gif' / //div which when I try to login, the source is: div id=logoimg src=/myapp/img/logo.gif //div which is what I expect. The problem is, I can't actually view the logo.gif file You have configured your aplication to protect everything (url-pattern/*/url-pattern). That will include /img/logo.gif and /css/site.css. Maybe you could protect an admin or non public area only? HTH Felix this is a basic login page: [code] html xmlns=http://www.w3.org/1999/xhtml; head title PAC - Applications /title /head body div id=header div id=logoimg src=c:url value='/img/logo.gif'///div div form method=POST action=j_security_check input type=text name=j_username input type=password name=j_password input type=submit name=login value=login /form /body /html [/code] again, like before, I can login sucessfully, but it redirects me to whatever the image that doesn't show up (so the logo.gif file). When I redirect myself manually to a correct url, i have all the correct permissions. Is there something Im missing here? Even more weird? - say I remove the offending line. But say I replay it with a link rel=stylesheet href=c:url value=/css/site.css / type=text/css / at the top of my head. When I attempt to login, the site.css file is not loaded. But when I login, it attempts to redirect and dumps the actual site.css file to the browser. config problem?? Junos On Mon, Jul 28, 2008 at 5:14 PM, Jerry Atrick [EMAIL PROTECTED] wrote: When attempting to log into a standard form-based login field, I'm always redirected to an image folder. My folder layout: /img /web-inf/ /web-inf/web.xml /index.jsp /login.jsp /error.jsp setup: Spring2.5/tiles2/tomcat5.5 in my web.xml: [code] security-constraint display-nameSecurity Constraint/display-name web-resource-collection web-resource-nameProtected Pages/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method /web-resource-collection auth-constraint role-namemyAdmin/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config [/code] pretty standard stuff. If you want to see any of the other code, just ask... What happens: 1. I attempt to go to a url 2. It properly stops me and asks me to login 3. I enter user credentials and hit login 4. It sucessfully logins. 5. It redirects me to /img/myimage.gif every time. I know that the login works fine, as when I fix my url to the url i was originally at, everything is correctly authenticated. Is there a way to set a default url when you attempt to login? Anyone else get a similar problem before? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: address bar shows ip instead of domain name
Thanks Ken for all your help! Ken Bowen wrote: In rule, map /mydomain.com to /mywebapp/welcome.action in outbound-rule, map /mywebapp/welcome.action to /mydomain.com Do that for welcome, register, and every other page. Depending on the rules you need, you can make some use of regular expressions. On Jul 29, 2008, at 10:25 AM, nilanthan wrote: Thanks. I have placed the files/codes in the right spots and when I do localhost:8080/mywebapp/rewrite-status I get the urlrewrite page. But what i need is when a user types in the browser www.mydomain.com, it should go to http://00.00.00.00:8080/mywebapp/welcome.action but still display http://www.mydomain.com and when I click on a link, it should take my to ex. http://00.00.00.00:8080/mywebapp/register.action but in the address bar show http://www.mydomain.com/register.action. Can you use this example for the urlrewrite and where to place the codes? Thanks. Ken Bowen wrote: I don't know of any tutorial -- I found the documentation gave me enough guidance. It's really pretty straight-forward. Drop a filter definition like this in your web.xml: filter filter-nameUrlRewriteFilter/filter-name filter- classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/ filter-class !-- init-param param-namelogLevel/param-name param-valuesysout:DEBUG/param-value /init-param -- /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern dispatcherFORWARD/dispatcher dispatcherREQUEST/dispatcher /filter-mapping Then add a file urlrewrite.xml in your WEB-INF containing mappings in the following spirit: rule from^/PrivacyPolicy$/from to type=forward/PrivacyPolicy.do/to /rule outbound-rule from^/PrivacyPolicy.do$/from to/PrivacyPolicy/to /outbound-rule The outbound-rule describes how to map something going from the server to the browser, and the (inbound) rule describes how to map what you mapped on output (now coming back from the browser) back into what you need to see on input. If you removed the comment symbols in the filter element, you get detailed debugging ouptut. Hope this helps. Ken On Jul 28, 2008, at 6:16 PM, nilanthan wrote: Thanks. I have looked at that before but am a bit confused about the instructions. Is there a good tutorial for this urlrewrite? Ken Bowen wrote: Apply a rewrite filter (http://tuckey.org/urlrewrite/) to map the ip expression to what you want. ken On Jul 28, 2008, at 5:36 PM, nilanthan wrote: So what Can I do so that that domain goes to that address but shows the domain in the address bar? Yuval Perlov wrote: Where ever you forward, that's what the address bar shows On Jul 28, 2008, at 7:45 PM, nilanthan wrote: Hi, I have a website hosted on netfirms. I have a domain,exmaple, mydomain.com and it forwards to an address http:/xx.xx.xxx.xx:8080/folder1/ welcome.action where xx is the ip of the server. Im runningTomcat 5.5 alone without apache. The problem is that when a users goes to www.mydomain.com, it takes them to the site but in the address bar it shows http:/xx.xx.xxx.xx:8080/folder1/welcome.action instead of mydomain.com. Is this an issue with DNS or something in Tomcat? I will have multiple sites running in the future so I cannot place the site folder in the ROOT directory. Thanks. -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18694567.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p1863.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/address-bar-shows-ip-instead-of-domain-name-tp18694567p18700955.html Sent from the Tomcat - User mailing list archive at Nabble.com.
Problem with Custom Access Log Format
Hi all, I'm using AccessLogValves to log access to contexts and I'm using the combined pattern documented here: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access%20Log%20Valve However, I would like to define a custom pattern for logging this information. The problem is that I don't see a pattern code that corresponds to the User-Agent or to the Referrer. These values are automagically included when using the combined pattern, but I have a sneaky feeling that these values are accessible directly. Or perhaps I'm mis-reading the documentation. Anyways, any help in uncovering the User-Agent and Referrer values would be appreciated. Thanks Tomcat 5.5 Java 1.4.2
Re: Auth incorrectly redirects to img file
Ah, you are 100% correct! I guess perhaps I've set my directory structure incorrect then. Currently, i have /img/ /css/ /js/ /web-inf/ /web-inf/tld /web-inf/jsp /web-inf/classes /web-inf/lib etc. but since no one could reach anything in the web-inf, i figure that would do. Is there a way to do an exclusion? or should i modify my jsp directory? thanks for your help! Junos On Tue, Jul 29, 2008 at 2:49 PM, Felix Schumacher [EMAIL PROTECTED] wrote: Am Dienstag, den 29.07.2008, 13:44 -0400 schrieb Jerry Atrick: OK, a bit more info. I might have set up my tomcat incorrectly, tho I'm not entirely sure why. In my login.jsp file, I have a simple image div id=logoimg src=c:url value='/img/logo.gif' / //div which when I try to login, the source is: div id=logoimg src=/myapp/img/logo.gif //div which is what I expect. The problem is, I can't actually view the logo.gif file You have configured your aplication to protect everything (url-pattern/*/url-pattern). That will include /img/logo.gif and /css/site.css. Maybe you could protect an admin or non public area only? HTH Felix this is a basic login page: [code] html xmlns=http://www.w3.org/1999/xhtml; head title PAC - Applications /title /head body div id=header div id=logoimg src=c:url value='/img/logo.gif'///div div form method=POST action=j_security_check input type=text name=j_username input type=password name=j_password input type=submit name=login value=login /form /body /html [/code] again, like before, I can login sucessfully, but it redirects me to whatever the image that doesn't show up (so the logo.gif file). When I redirect myself manually to a correct url, i have all the correct permissions. Is there something Im missing here? Even more weird? - say I remove the offending line. But say I replay it with a link rel=stylesheet href=c:url value=/css/site.css / type=text/css / at the top of my head. When I attempt to login, the site.css file is not loaded. But when I login, it attempts to redirect and dumps the actual site.css file to the browser. config problem?? Junos On Mon, Jul 28, 2008 at 5:14 PM, Jerry Atrick [EMAIL PROTECTED] wrote: When attempting to log into a standard form-based login field, I'm always redirected to an image folder. My folder layout: /img /web-inf/ /web-inf/web.xml /index.jsp /login.jsp /error.jsp setup: Spring2.5/tiles2/tomcat5.5 in my web.xml: [code] security-constraint display-nameSecurity Constraint/display-name web-resource-collection web-resource-nameProtected Pages/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method /web-resource-collection auth-constraint role-namemyAdmin/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config [/code] pretty standard stuff. If you want to see any of the other code, just ask... What happens: 1. I attempt to go to a url 2. It properly stops me and asks me to login 3. I enter user credentials and hit login 4. It sucessfully logins. 5. It redirects me to /img/myimage.gif every time. I know that the login works fine, as when I fix my url to the url i was originally at, everything is correctly authenticated. Is there a way to set a default url when you attempt to login? Anyone else get a similar problem before? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request parameters mishandle utf-8 encoding
hi, i think there is a bug at handling utf-8 encoded request parameters sent by a html form with get method. i created a simple jsp page: === encTest.jsp === [EMAIL PROTECTED] contentType=text/html pageEncoding=UTF-8% % String query = request.getQueryString(); String queryDecoded = -; if (query != null) { queryDecoded = java.net.URLDecoder.decode(query,utf-8); } request.setCharacterEncoding(UTF-8); String reqParam = request.getParameter(param); % br query = %= query % br queryDecoded = %= queryDecoded % br reqParam = %= reqParam % form action=encTest.jsp method=get input name=param / input type=submit value=send / /form === end of jsp === When i fill out the form with some non US characters (in this case with a hungarian name), the browser urlencodes it correctly which i can see from the url: http://localhost:8080/struts/encTest.jsp?param=b%C3%A9la when i decode the query string by hand: queryDecoded = java.net.URLDecoder.decode(query,utf-8); i get the correct string, but when i call the getParameter() method on the request: request.setCharacterEncoding(UTF-8); String reqParam = request.getParameter(param); i get a miscoded string as the request.setCharacterEncoding(UTF-8) wouldn't be there. i checked the sourcecode of tomcat 6.0.16 and found that the Parameters.handleQueryParameters() does the real job, which is called by Request. parseParameters() the request has the correct encoding (utf-8) but the parameter has 2 different properties which store information about encoding: encoding and queryStringEncoding. in case of a GET the useBodyEncodingForURI is false, and therefore only parameters.setEncoding(utf-8) is called but parameters.setQueryStringEncoding(utf-8) isn't. so when request.parseParameters() calls parameters.handleQueryParameters() than queryStringEncoding is still null, and of course will return miscoded paramter. Do you agree that it's a bug, or i miss something? cheers, lajos === org.apache.catalina.connector.Request === protected void parseParameters() { ... String enc = getCharacterEncoding(); boolean useBodyEncodingForURI = connector.getUseBodyEncodingForURI(); if (enc != null) { parameters.setEncoding(enc); if (useBodyEncodingForURI) { parameters.setQueryStringEncoding(enc); } } ... parameters.handleQueryParameters(); ... if (!getMethod().equalsIgnoreCase(POST)) return; === org.apache.tomcat.util.http.Parameters === public void handleQueryParameters() { ... handleQueryParameters(decodedQuery, queryStringEncoding); } - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Custom Access Log Format
From: Jonathan Mast Subject: Problem with Custom Access Log Format However, I would like to define a custom pattern for logging this information. The problem is that I don't see a pattern code that corresponds to the User-Agent or to the Referrer. Your reference (http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access%20Log%20Val ve) lists the pattern codes you can use. %a - Remote IP address %A - Local IP address %b - Bytes sent, excluding HTTP headers, or '-' if zero %B - Bytes sent, excluding HTTP headers %h - Remote host name (or IP address if resolveHosts is false) %H - Request protocol %l - Remote logical username from identd (always returns '-') %m - Request method (GET, POST, etc.) %p - Local port on which this request was received %q - Query string (prepended with a '?' if it exists) %r - First line of the request (method and request URI) %s - HTTP status code of the response %S - User session ID %t - Date and time, in Common Log Format %u - Remote user that was authenticated (if any), else '-' %U - Requested URL path %v - Local server name %D - Time taken to process the request, in millis %T - Time taken to process the request, in seconds %I - current request thread name (can compare later with stacktraces) If you want anything not listed above, use one of the following pattern codes, replacing xxx with a header name: %{xxx}i for incoming request headers %{xxx}o for outgoing response headers %{xxx}c for a specific request cookie %{xxx}r xxx is an attribute in the ServletRequest %{xxx}s xxx is an attribute in the HttpSession but I have a sneaky feeling that these values are accessible directly. You are correct. They are accessible directly. To pull values of the User-Agent and Referer headers from the request, you would add the following codes to your pattern %{User-Agent}i %{Referer}i As a reference the 'common' pattern is '%h %l %u %t %r %s %b'. The 'combined' pattern is '%h %l %u %t %r %s %b %{Referer}i %{User-Agent}i' Compare the two patterns. 'combined' is effectively 'common' with the addition of '%{Referer}i %{User-Agent}i'. For anyone interested, the pattern codes listed above are the same ones used by Apache for configuring its access logs. - Bill - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jsp compile question
How can I simulate the way tomcat builds a jsp file? I need to debug a .jsp that fails to build when requested. Thanks.
Re: jsp compile question
On Tue, Jul 29, 2008 at 5:05 PM, Jq [EMAIL PROTECTED] wrote: How can I simulate the way tomcat builds a jsp file? I need to debug a .jsp that fails to build when requested. Thanks. If you mean debugging why JSP compilation fails, you can look at the generated servlet code (the .java file) in Tomcat's work directory (on my setup /usr/local/tomcat/work/...).
Re: jsp compile question
That would be great. I'll have to find where this is set up on the target site. Thanks.
Re: jsp compile question
download TC-5.5.20 src distro inside $TOMCAT_HOME\src\apache-tomcat-5.5.2x-src\jasper\src\bin http://tomcat.apache.org/download-55.cgi look for jspc.bat Martin - Original Message - From: Jq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 29, 2008 5:25 PM Subject: Re: jsp compile question That would be great. I'll have to find where this is set up on the target site. Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp compile question
I would recommend making the jsp compilation part of your build cycle using jspc (jspc mojo plugin if using maven or just standard invocation of jasper's jspc.bat/sh if using ant Signed, Alessandro Ferrucci :) On Tue, Jul 29, 2008 at 5:47 PM, Martin [EMAIL PROTECTED] wrote: download TC-5.5.20 src distro inside $TOMCAT_HOME\src\apache-tomcat-5.5.2x-src\jasper\src\bin http://tomcat.apache.org/download-55.cgi look for jspc.bat Martin - Original Message - From: Jq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, July 29, 2008 5:25 PM Subject: Re: jsp compile question That would be great. I'll have to find where this is set up on the target site. Thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Hosting
Hi, Thanks all for your suggestion. I have decided to go with webappcabaret. I was impressed with the free on demand load-balancing trial. Like you said I was up in a couple minutes. I chose the LB-I plan on their production servers. I am able to scale up or down on the fly if needed. Kerry - Original Message From: M T [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, July 27, 2008 8:09:08 PM Subject: RE: Tomcat Hosting If you are looking for a reliable host that specializes in Java and also offer a free trial check out Webappcabaret. The URL for provisioning the trial account is http://www.webappcabaret.com/wac/30daytrial.zul You should be setup in a couple minutes. Subject: Re: Tomcat Hosting From: [EMAIL PROTECTED] To: users@tomcat.apache.org Date: Sun, 27 Jul 2008 21:20:25 -0500 On Sun, 2008-07-27 at 19:12 -0700, Kerry Jacabson wrote: Having been burnt a number of times, Is Rackspace one of those that burnt you? I have a customer that is satisfied with the hosting service. They may have a weak spot in acquiring certificates. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay in touch when you're away with Windows Live Messenger. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_messenger2_072008
Re: Committing sendRedirect()
Hello again, Thanks for the response, but it seems like my phrasing was a bit unclear. The problem is not the second redirect - in fact there will be no multiple redirects. The second redirect is only there for the case when less than 25 hits are found and the first redirect is not called. The if clause will prevent the program for trying to redirect twice. My problem is rather that the redirect is only commited - the response is sent to the client - until the doPost method/thread finishes. I expected to be able to redirect (once) in the middle of the loop. What I am trying to accomplish is to do a query, enter the hits into a temporary table, and redirect to another program that displays a paged list of hits by reading from the table - in effect using the table as a queue. Since the paged display only shows the top 25 hits, there is no need to wait for all the query results. So once more, my problem is that the redirect is not committed until the function returns. Any help much appreciated. Tore Alan Chaney wrote: Tore Your code below is written as though the 'out' was like writing data to a console. The processing in a servlet is part of a request/response cycle, where the 'request' tells it what to do and the response is the reply. Because of the nature of the request/response cycle you only get one chance at the reply. The javadocs for HttpServletResponse.sendRedirect make this clear. If the response has already been committed, this method throws an IllegalStateException. After using this method the response should be considered to be committed and should not be written to. In other words, in one servlet request/response cycle you get exactly one chance to issue a 'sendRedirect'. If you think this through you'll see that this is how it has to be: Browser sends request to servlet Servlet process request and sendsRedirect Browser display response. Your problem is that you are trying to generate a second response without a correspondng request. The first response is for the 'top 25' and the second is for 'all the rest', but by then you've already committed the response. To achieve what I think you are trying to achieve would require you to create some mechanism where the lucene query results are processed in a separate thread and your application makes TWO requests - one for the first set of results and then one for the final set of results. There are far too many different ways to do this to detail here - I hope this helps Regards Alan Chaney Tore Eriksson wrote: Hi everybody, I have a problem with redirects in Tomcat 5.5.25. I am doing a Lucene search and would like to send a redirect after finding the top 25 hits, commit this response, and then continue processing the remaining hits. The relevant parts of the doPost() code are as below: final int PARTIAL_HITS = 25; for (int i = 0; i hits.length(); i++) { Document doc = hits.doc(i); String citation = doc.get(citation); /** Insert into table */ try { insertId.setInt(1, java.lang.Integer.parseInt(citation)); insertId.executeUpdate(); } catch (SQLException e) { out.sendError(500, Bad SQL insert: + e); } catch (Exception e) {} if (i == PARTIAL_HITS) { // Intermittant redirect out.sendRedirect(resultUrl); } } insertId.close(); if (!out.isCommitted()) { // Final redirect out.sendRedirect(resultUrl); } My problem is that the intermittant redirect is not committed until the function returns, which will take quite some time for some queries. I have tried HttpServletResponse.flushBuffer() and other possible variations. Any pointers would be most appreciated. Tore ___ Tore Eriksson [tore.eriksson ad po.rd.taisho.co.jp] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log4J logging from server not working
Hi Denis What do you mean by the internal logging works fine in both cases? Does the call from the servlet produce an error in the tomcat logs? Do you call an initializer servlet (load-on-startup) to load the log4j.properties file? Tom On 30/07/2008, at 12:34 AM, Denis Kezerashvili wrote: Does anybody has any idea what might be causing the problem with Log4J? I've googled for the longest time and there are no leads I found. Denis - Original Message From: Denis Kezerashvili [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, July 29, 2008 9:49:08 AM Subject: Log4J logging from server not working I've been stuck with this problem for about a week now. I am trying to get the Log4J working in my servlet. I have tried it on Tomcat 6.0.16 as well as Tomcat 5.5.26. I have followed all the directions in the logging section for both versions. The internal logging works fine in both cases. However, my servlet does not produce any log at all. I must be doing something incorrectly, although I have rechecked everything 100 times over. If anyone can help me I would really appreciate it. Are the instructions for setting up logging complete? Here is the description of my environment: Windows environment (have superuser access). JDK 1.6.0_07 Log4J 1.2.15 Here is also my log4j.properties that lives in WEB-INF/classes log4j.rootLogger=DEBUG, R, stdout # - # # Appenders # # - # log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # WARNING: the %M specifier which generates the method name # is apparently very slow. log4j.appender.stdout.layout.conversionPattern=%d %-5p [%t] %c{5}. %M: %m%n # New appender # log4j.appender.R=org.apache.log4j.RollingFileAppender # Put the file in the tomcat instance log dir. log4j.appender.R.File=${catalina.home}/logs/sms.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] %c{5}.%M: %m%n - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Embedding custom metadata in a jsp page; access generated Class via reflection?
As Mikolaj pointed out, there is absolutely no way to do this that will be compatible across containers. And, even for Tomcat only, this isn't going to be easy. Tomcat (or, more correctly Jasper) doesn't publish this information in any form that can be reliably read (e.g. JMX). Partially this is because the class name may change if you are running in developement mode (where it re-compiles changed JSP pages on the fly). I can think of various sordid container-specific hacks based on getClassLoader().getResources(...), but I'm sure that you can think of them too ;). If this was for one webapp, then I'd just pre-compile all the JSP pages before deploying, and have a catalog that maps servlet-path to classname. For a framework, I can't think of anything better than a ResponseWrapper that handles requests with reserved query-strings. But this is ugly enough, that personally I'd just stick with the separate .xml file. Simon Kitching [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Mikolaj Rydzewski schrieb: Simon Kitching wrote: Or perhaps someone can suggest an alternate approach to embedding metadata that can be accessed before the page renders? Please provide as with more details, at this point your requirement is a little bit strange. Have you considered using filters? Ok, here are some more details. I'm working on the myfaces orchestra flow project (for JavaServer Faces, aka JSF). It allows one JSF page to call another JSF page like a subroutine, passing parameters and allows the called page(s) to simply return to the page that called them, passing back results. This makes navigation between pages easier, makes the data passing explicit, and avoids any potential variablename collisions by setting up a completely clean scope for the called page to run in, with only the passed variables visible. When a call to a page is done, the page from which the call is made must declare metadata about what the parameters to be passed are, and what logical service the called page provides. The called page also needs to declare what input parameters it expects, and what logical service it provides. Think of this like a Java method prototype (which is also metadata, and can be queried via java reflection). The code where this metadata is needed is in a JSF ViewHandler, which is indirectly called from the JSF FacesServlet class, after the user has submitted a form. The metadata is used for sanity-checking of the call and setting up of the passed parameters (rearrangement of variables in the http session scope etc). Then a forward to the called page is done. As described in the original email, this is currently done by looking for a .xml file sitting beside each .jsp. It works ok, and for any JSF view mechanism (jsp, facelets, clay, etc). But some people might find embedding the information in the actual page to be nicer to work with. Doing this with Facelets isn't too hard, but embedding the necessary info into a jsp page is straining my jsp knowledge considerably :-) However I think the issue is a generic one, not anything specific to this particular case: I want to add metadata to a jsp page, just like java annotations provide static metadata about a class without needing to create an instance and execute it. I would think that being able to annotate a jsp would be useful for many purposes. Regards, Simon - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request parameters mishandle utf-8 encoding
It's not a bug, it's a feature ;). Seriously, if you open a bug report for this, it will be closed quickly as either INVALID or as DUPLICATE to a bug that was closed as INVALID. The HTTP spec specifies that header information is encoded in iso-latin-1, so this is what Tomcat uses by default when parsing the query-string. If you want the non-default behavior, then simply set useBodyEncodingForURI=true in the Connector ... / element of server.xml. Lajos Papp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, i think there is a bug at handling utf-8 encoded request parameters sent by a html form with get method. i created a simple jsp page: === encTest.jsp === [EMAIL PROTECTED] contentType=text/html pageEncoding=UTF-8% % String query = request.getQueryString(); String queryDecoded = -; if (query != null) { queryDecoded = java.net.URLDecoder.decode(query,utf-8); } request.setCharacterEncoding(UTF-8); String reqParam = request.getParameter(param); % br query = %= query % br queryDecoded = %= queryDecoded % br reqParam = %= reqParam % form action=encTest.jsp method=get input name=param / input type=submit value=send / /form === end of jsp === When i fill out the form with some non US characters (in this case with a hungarian name), the browser urlencodes it correctly which i can see from the url: http://localhost:8080/struts/encTest.jsp?param=b%C3%A9la when i decode the query string by hand: queryDecoded = java.net.URLDecoder.decode(query,utf-8); i get the correct string, but when i call the getParameter() method on the request: request.setCharacterEncoding(UTF-8); String reqParam = request.getParameter(param); i get a miscoded string as the request.setCharacterEncoding(UTF-8) wouldn't be there. i checked the sourcecode of tomcat 6.0.16 and found that the Parameters.handleQueryParameters() does the real job, which is called by Request. parseParameters() the request has the correct encoding (utf-8) but the parameter has 2 different properties which store information about encoding: encoding and queryStringEncoding. in case of a GET the useBodyEncodingForURI is false, and therefore only parameters.setEncoding(utf-8) is called but parameters.setQueryStringEncoding(utf-8) isn't. so when request.parseParameters() calls parameters.handleQueryParameters() than queryStringEncoding is still null, and of course will return miscoded paramter. Do you agree that it's a bug, or i miss something? cheers, lajos === org.apache.catalina.connector.Request === protected void parseParameters() { ... String enc = getCharacterEncoding(); boolean useBodyEncodingForURI = connector.getUseBodyEncodingForURI(); if (enc != null) { parameters.setEncoding(enc); if (useBodyEncodingForURI) { parameters.setQueryStringEncoding(enc); } } ... parameters.handleQueryParameters(); ... if (!getMethod().equalsIgnoreCase(POST)) return; === org.apache.tomcat.util.http.Parameters === public void handleQueryParameters() { ... handleQueryParameters(decodedQuery, queryStringEncoding); } - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]