Re: Http Session Null issue
On 4/7/09 00:22, Konstantin Kolinko wrote: HttpSession session = request.getSession(); Is the request a legit one (that is, the one that is being served by Tomcat now)? Requests are recycled immediately after their processing is done, and it can result in null being returned by that method (though throwing an IllegalStateException would be better). (See partial stacktrace below.) The Settings object looks like it is the source of the NullPointerException and it looks like it is being statically initialised. I don't know what that object is, so I asked for more info - the OP is yet to respond, unless I missed that message? How it is being initialised, it seems to me, is the source of the problem. Does the initialisation depend on an HttpSession object or on some other parameters? p *root cause* java.lang.NullPointerException com.teradata.x2.context.Settings.getSettings(Settings.java:102) com.teradata.x2.context.ServletProcessContext.getSettings(ServletProcessContext.java:38) It's probably not that random. What is at Settings.java, line 102? p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Howto enable SSL/https for the tomcat-embedded version?
Hello, To do some development/testing I would like to enable SSL/https for my embedded tomcat version. The SSL tutorial suggests to modify server.xml, however this version of tomcat doesn't seem to have this file - instead all the configuration seems to be done by the ant build.xml file which is used to start it. I guess I would have to add another Connector, which accepts SSL. For now there'r only the plain non-ssl connector enabled: mbean name=${domain}:type=Connector,port=9080 code=org.apache.catalina.connector.Connector modeler=true attribute name=port value=9080 / /mbean Any idea howto alther the configuration to enable ssl? Thank you in advance, Clemens - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Howto enable SSL/https for the tomcat-embedded version?
On 4/7/09 11:34, Clemens Eisserer wrote: Hello, To do some development/testing I would like to enable SSL/https for my embedded tomcat version. The SSL tutorial suggests to modify server.xml, however this version of tomcat doesn't seem to have this file - instead all the configuration seems to be done by the ant build.xml file which is used to start it. I guess I would have to add another Connector, which accepts SSL. For now there'r only the plain non-ssl connector enabled: mbean name=${domain}:type=Connector,port=9080 code=org.apache.catalina.connector.Connector modeler=true attribute name=port value=9080 / /mbean Any idea howto alther the configuration to enable ssl? If this configures Connector attributes: attribute name=port value=9080 / I'd try adding the appropriate attributes from the Connector config docs. p Thank you in advance, Clemens - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSP when tag question
David, Thank you to 'pid' and yourself. I spent quite a few hours going over the source HTML from Firefox and fixed some problems (e.g. an tag with no closing tag) and fixed some inefficient code. I was getting very inconsistent results and went through a number of iterations. This was to follow pid's suggestion. Then started to respond to your suggestion about the tablib libraries, etc. I have a number of jsp files using include statements. Lo and behold, I did not have a taglib directive! I'm embarrassed to say this, since I know better. I really thought I had already done it, but I guess at the time I was going to add the directive, I got distracted and failed to do it. Having said that, I'm a bit surprised that there was not error message generate by tomcat about seeing a reference to c:choose and c:xxx with no definition available. Thanks, again. Jim David Smith wrote: Following up on what Pid suggested, when you look at the output (view source in the browser), can you see the c:choose and c:when tags still present? Can you offer us a little more info like what you have declared for taglibs at the top of this jsp and what's in your webapp's WEB-INF/lib folder? --David Jim Anderson wrote: 3 This is a JSP issue. I have unsuccessfully searched for a JSP 4 support forum so I figured I will start here since the Tomcat 5 container processes JSP. If this is question is inappropriate, 6 I apologize. If you can point me to a better forum, please do. 8 The environment is Tomcat 6.0.18 on Linux using Firefox 2.0. I'm writing my first JSP program and I'm having a problem with the c:when construct. I have a bean that contains a property named 'midContent'. When the program segment is entered, the bean, BFSInfo, has it's midContent property set to 'page2'. The when tag test evaluates to false, yet the code within the when tag is executed. Here is the code segment: 18 c:choose 19 c:when test=${BFSInfo.midContent == 'page1'} 20 T/F = ${BFSInfo.midContent == 'page1'} 21 br/br 22 INFO EL is ${BFSInfo.midContent} 23 /c:when 24 ... 25 /c:choose When run, the lines inside the 'when' construct print the following on the web page: 31 T/F = false 32 INFO EL is page2 The test expression of line 19 is evaluated again at line 20 and the result is 'false' as shown at line 31. The output produced by line 22 is shown at line 32 and confirms that the value of midContent is 'page2'. Can someone explain why the code inside the 'c:when' tag is executed when the test on line 19 appears to be evaluating to false? Thanks you in advance. Jim Anderson - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSP when tag question
Hi Jim A liitle OT, but I can recommend the HTML Validator plugin for Firefox (if you don't already have it). It puts a red light in the bottom right corner of the browser when you forget an import - the HTML is of course invalid. Has saved me many a time... Regards Ron - Original Message - From: Jim Anderson ez...@ieee.org To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, July 05, 2009 5:52 AM Subject: Re: JSP when tag question David, Thank you to 'pid' and yourself. I spent quite a few hours going over the source HTML from Firefox and fixed some problems (e.g. an tag with no closing tag) and fixed some inefficient code. I was getting very inconsistent results and went through a number of iterations. This was to follow pid's suggestion. Then started to respond to your suggestion about the tablib libraries, etc. I have a number of jsp files using include statements. Lo and behold, I did not have a taglib directive! I'm embarrassed to say this, since I know better. I really thought I had already done it, but I guess at the time I was going to add the directive, I got distracted and failed to do it. Having said that, I'm a bit surprised that there was not error message generate by tomcat about seeing a reference to c:choose and c:xxx with no definition available. Thanks, again. Jim David Smith wrote: Following up on what Pid suggested, when you look at the output (view source in the browser), can you see the c:choose and c:when tags still present? Can you offer us a little more info like what you have declared for taglibs at the top of this jsp and what's in your webapp's WEB-INF/lib folder? --David Jim Anderson wrote: 3 This is a JSP issue. I have unsuccessfully searched for a JSP 4 support forum so I figured I will start here since the Tomcat 5 container processes JSP. If this is question is inappropriate, 6 I apologize. If you can point me to a better forum, please do. 8 The environment is Tomcat 6.0.18 on Linux using Firefox 2.0. I'm writing my first JSP program and I'm having a problem with the c:when construct. I have a bean that contains a property named 'midContent'. When the program segment is entered, the bean, BFSInfo, has it's midContent property set to 'page2'. The when tag test evaluates to false, yet the code within the when tag is executed. Here is the code segment: 18 c:choose 19 c:when test=${BFSInfo.midContent == 'page1'} 20 T/F = ${BFSInfo.midContent == 'page1'} 21 br/br 22 INFO EL is ${BFSInfo.midContent} 23 /c:when 24 ... 25 /c:choose When run, the lines inside the 'when' construct print the following on the web page: 31 T/F = false 32 INFO EL is page2 The test expression of line 19 is evaluated again at line 20 and the result is 'false' as shown at line 31. The output produced by line 22 is shown at line 32 and confirms that the value of midContent is 'page2'. Can someone explain why the code inside the 'c:when' tag is executed when the test on line 19 appears to be evaluating to false? Thanks you in advance. Jim Anderson - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JSP when tag question
On Sat, Jul 4, 2009 at 13:52, Jim Andersonez...@ieee.org wrote: Having said that, I'm a bit surprised that there was not error message generate by tomcat about seeing a reference to c:choose and c:xxx with no definition available. I would guess that JSP processor allows unknown tags in case its output is to be processed by some other software that understands those tags. JSP can be used to create XML as well as HTML, and it can be used to create output that isn't a web page. -- Len - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat for serving only static files - how to prevent the likes of JSP execution
This might seem like a strange request, but I would like to use Tomcat to only serve static files, from a certain context anyway. I have an application I would like to allow users to upload files through, and then I want to be able to link to them and serve them from the server. If I do this, I run the risk of them uploading executable content (e.g. a JSP file) and then having it executed on the server, so I would like to stop this happening. Does anyone know how I could prevent any dynamic processing of files in a given Tomcat context. I appreciate I could just install Apache and do it that way but I'd rather just keep it simple with Tomcat. Thanks. -- View this message in context: http://www.nabble.com/Tomcat-for-serving-only-static-files---how-to-prevent-the-likes-of-JSP-execution-tp24338874p24338874.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat for serving only static files - how to prevent the likes of JSP execution
The default handling of JSP files is set in conf/web.xml: *.jsp and *.jspx are handled by JspServlet. In your special context, you could handle *.jsp and *.jspx files with a servlet that just returns an error. That should do the trick. -- Len 2009/7/4 Keith67 keithmatthewwat...@gmail.com: This might seem like a strange request, but I would like to use Tomcat to only serve static files, from a certain context anyway. I have an application I would like to allow users to upload files through, and then I want to be able to link to them and serve them from the server. If I do this, I run the risk of them uploading executable content (e.g. a JSP file) and then having it executed on the server, so I would like to stop this happening. Does anyone know how I could prevent any dynamic processing of files in a given Tomcat context. I appreciate I could just install Apache and do it that way but I'd rather just keep it simple with Tomcat. Thanks. -- View this message in context: http://www.nabble.com/Tomcat-for-serving-only-static-files---how-to-prevent-the-likes-of-JSP-execution-tp24338874p24338874.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org