[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19748#action_19748
]
Martin Algesten commented on MAGNOLIA-2498:
-------------------------------------------
The Resource.getActivePage().getHandle() is to get the current URL to be able
to make relative links. Would perhaps the "correct" solution be to fall back on
getServletPath() if getActivePage() is null?
> NPE in <cms:out> (Out.java)
> ---------------------------
>
> Key: MAGNOLIA-2498
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2498
> Project: Magnolia
> Issue Type: Bug
> Components: taglibs
> Reporter: Martin Algesten
> Assignee: Fabrizio Giustina
>
> I've mapped up cms bypasses so that struts pages (*.do) are not handled by
> Magnolia. Note that my bypass is in "cms" in the filter chain, I do want all
> of the Magnolia chain, but not the actual content (since I'm generating
> navigation elements that depends on the Magnolia context being in place).
> So the below error occurs since we're currently looking at a URL and using
> <cms:out> on a jsp page that is not generated by Magnolia.
> The tag that fails is:
> <cms:out nodeDataName="title"/>
> 2008-12-08 09:19:14.078::WARN: /pbWebapp/common/welcome.do
> java.lang.NullPointerException
> at info.magnolia.cms.taglibs.Out.doEndTag(Out.java:374)
> at
> org.apache.jsp.common.welcome_jsp._jspx_meth_cms_out_2(org.apache.jsp.common.welcome_jsp:1938)
> at
> org.apache.jsp.common.welcome_jsp._jspx_meth_c_if_1(org.apache.jsp.common.welcome_jsp:1821)
> at
> org.apache.jsp.common.welcome_jsp.access$2(org.apache.jsp.common.welcome_jsp:1785)
> Since there is no current Magnolia page, Resource.getActivePage() returns
> null which means getHandle() is causing the NPE.
> I have implemented the obvious quick fix but I wonder if it's correct. It
> just bypasses the UUID resolving if Resource.getActivePage() is null. However
> I suspect one would really want the resolving to happen also when there is no
> current active page - thoughts?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
----------------------------------------------------------------