Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
Looking at that line here: http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_6/core/src/main/java/org/apache/struts2/views/jsp/ComponentTagSupport.java?annotate=509057 Container container = Dispatcher.getInstance().getContainer(); it seems like Dispatcher.getInstance() is returning null, which I don't know how could happen. If you remove the s:head tag everything else works? musachy On 3/18/07, Jason Thurston [EMAIL PROTECTED] wrote: This application uses sitemesh 2.2.1 spring 2.0.3 struts 2.0.6 struts 1.2.9 struts-menu 2.4.2.1 If I put s:head theme=ajax/ in my header.jsp file I get a Nullpointer exception. I found this link http://forum.springframework.org/showthread.php?t=33874 talking about the same error message which says the fix is in spring 2.0.3. However, I am using spring 2.0.3 and I'm not using the spring RequestContextListener.The problem only occurs when I put the s:head theme=ajax/ in the header.jsp page, it does not happen if I put it in the same page as the struts2 action is mapped to. Any ideas how to fix this or track it down further. 2007-03-18 15:14:26 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag( ComponentTagSupport.java:50) at org.apache.jsp.hosp.layouts.header_jsp._jspx_meth_s_head_0 (header_jsp.java:177) at org.apache.jsp.hosp.layouts.header_jsp._jspService (header_jsp.java:68) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
Musachy -- I have given up on the AJAX theme and moved exclusively to Prototype.js for asynch behaviors. There is no mystery prototype.js and it is very clear to code/read. I had been using XHR directly and thought S2's tags would make my life simpler. However, even coding with XmlHttpRequest and having to wrestle the DOM was more intuitive than the S2 tags and scripts! I know the S2 sound bites sound great about how you can do AJAX with simple custom tags, but after days became weeks of weirness, I honestly think you are barking up the wrong tree using S2 for Ajaxy UI. Scott On 3/19/07, Musachy Barroso [EMAIL PROTECTED] wrote: Looking at that line here: http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_6/core/src/main/java/org/apache/struts2/views/jsp/ComponentTagSupport.java?annotate=509057 Container container = Dispatcher.getInstance().getContainer(); it seems like Dispatcher.getInstance() is returning null, which I don't know how could happen. If you remove the s:head tag everything else works? musachy On 3/18/07, Jason Thurston [EMAIL PROTECTED] wrote: This application uses sitemesh 2.2.1 spring 2.0.3 struts 2.0.6 struts 1.2.9 struts-menu 2.4.2.1 If I put s:head theme=ajax/ in my header.jsp file I get a Nullpointer exception. I found this link http://forum.springframework.org/showthread.php?t=33874 talking about the same error message which says the fix is in spring 2.0.3. However, I am using spring 2.0.3 and I'm not using the spring RequestContextListener.The problem only occurs when I put the s:head theme=ajax/ in the header.jsp page, it does not happen if I put it in the same page as the struts2 action is mapped to. Any ideas how to fix this or track it down further. 2007-03-18 15:14:26 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag( ComponentTagSupport.java:50) at org.apache.jsp.hosp.layouts.header_jsp._jspx_meth_s_head_0 (header_jsp.java:177) at org.apache.jsp.hosp.layouts.header_jsp._jspService (header_jsp.java:68) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd -- Scott [EMAIL PROTECTED]
Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
How exactly does your comment help the OP? musachy On 3/19/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Musachy -- I have given up on the AJAX theme and moved exclusively to Prototype.jsfor asynch behaviors. There is no mystery prototype.js and it is very clear to code/read. I had been using XHR directly and thought S2's tags would make my life simpler. However, even coding with XmlHttpRequest and having to wrestle the DOM was more intuitive than the S2 tags and scripts! I know the S2 sound bites sound great about how you can do AJAX with simple custom tags, but after days became weeks of weirness, I honestly think you are barking up the wrong tree using S2 for Ajaxy UI. Scott On 3/19/07, Musachy Barroso [EMAIL PROTECTED] wrote: Looking at that line here: http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_6/core/src/main/java/org/apache/struts2/views/jsp/ComponentTagSupport.java?annotate=509057 Container container = Dispatcher.getInstance().getContainer(); it seems like Dispatcher.getInstance() is returning null, which I don't know how could happen. If you remove the s:head tag everything else works? musachy On 3/18/07, Jason Thurston [EMAIL PROTECTED] wrote: This application uses sitemesh 2.2.1 spring 2.0.3 struts 2.0.6 struts 1.2.9 struts-menu 2.4.2.1 If I put s:head theme=ajax/ in my header.jsp file I get a Nullpointer exception. I found this link http://forum.springframework.org/showthread.php?t=33874 talking about the same error message which says the fix is in spring 2.0.3. However, I am using spring 2.0.3 and I'm not using the spring RequestContextListener.The problem only occurs when I put the s:head theme=ajax/ in the header.jsp page, it does not happen if I put it in the same page as the struts2 action is mapped to. Any ideas how to fix this or track it down further. 2007-03-18 15:14:26 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag ( ComponentTagSupport.java:50) at org.apache.jsp.hosp.layouts.header_jsp._jspx_meth_s_head_0 (header_jsp.java:177) at org.apache.jsp.hosp.layouts.header_jsp._jspService (header_jsp.java:68) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd -- Scott [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
--- [EMAIL PROTECTED] wrote: I honestly think you are barking up the wrong tree using S2 for Ajaxy UI. Just to provide a counter-example, I am using many of the S2 tags in multiple applications to provide a fair amount of Ajaxification very successfully. There are definitely many use-cases that the S2 tags do not address (at least for now) but for lots of simple things they're a lot easier than writing the JavaScript by hand. d. Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
Musachy -- Not exactly sure what an OP is, but I am trying to save my brother from banging his head on the keyboard. I have found S2's Ajax support to be harder to actually write than the docs would otherwise suggest. Understand this comment does not apply generally to S2, but rather a slice of it's documented functionality. Scott On 3/19/07, Musachy Barroso [EMAIL PROTECTED] wrote: How exactly does your comment help the OP? musachy On 3/19/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Musachy -- I have given up on the AJAX theme and moved exclusively to Prototype.jsfor asynch behaviors. There is no mystery prototype.js and it is very clear to code/read. I had been using XHR directly and thought S2's tags would make my life simpler. However, even coding with XmlHttpRequest and having to wrestle the DOM was more intuitive than the S2 tags and scripts! I know the S2 sound bites sound great about how you can do AJAX with simple custom tags, but after days became weeks of weirness, I honestly think you are barking up the wrong tree using S2 for Ajaxy UI. Scott On 3/19/07, Musachy Barroso [EMAIL PROTECTED] wrote: Looking at that line here: http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_6/core/src/main/java/org/apache/struts2/views/jsp/ComponentTagSupport.java?annotate=509057 Container container = Dispatcher.getInstance().getContainer(); it seems like Dispatcher.getInstance() is returning null, which I don't know how could happen. If you remove the s:head tag everything else works? musachy On 3/18/07, Jason Thurston [EMAIL PROTECTED] wrote: This application uses sitemesh 2.2.1 spring 2.0.3 struts 2.0.6 struts 1.2.9 struts-menu 2.4.2.1 If I put s:head theme=ajax/ in my header.jsp file I get a Nullpointer exception. I found this link http://forum.springframework.org/showthread.php?t=33874 talking about the same error message which says the fix is in spring 2.0.3. However, I am using spring 2.0.3 and I'm not using the spring RequestContextListener.The problem only occurs when I put the s:head theme=ajax/ in the header.jsp page, it does not happen if I put it in the same page as the struts2 action is mapped to. Any ideas how to fix this or track it down further. 2007-03-18 15:14:26 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.lang.NullPointerException at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag ( ComponentTagSupport.java:50) at org.apache.jsp.hosp.layouts.header_jsp._jspx_meth_s_head_0 (header_jsp.java:177) at org.apache.jsp.hosp.layouts.header_jsp._jspService (header_jsp.java:68) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd -- Scott [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd -- Scott [EMAIL PROTECTED]
Re: NullPointerException when using s:head theme=ajax/ in my header.jsp file
Musachi, I like that src link you included. I looked at it then found the Dispatcher.java class to look at the getInstance() method. It's getting a threadlocal of struts2 instance. So I realized sitemesh must be calling that header.jsp page before struts2 get's a chance to put it's instance in the thread. So that meant that my filter ordering in web.xml wasn't right. I need the struts2 filter before sitemesh. I'm sure that's the fix but when I changed the order I still had problems. So I found this link http://struts.apache.org/2.0.6/docs/sitemesh-plugin.html reqarding getting sitemesh and struts2 to play nice together. Of course implementing what the link says to do is causing other problems. So I've just got for mess around for a few hours or days until I get it working with the struts2-sitemesh-filter instead of the standard sitemesh filter I was using. Then back to the ajax stuff... Thanks for the help folks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]