3

I created my own regions which I can use without issues inside of a normal page.

However, once I try to use them in my included pages I get the following error:

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/Views/Toerisme/Region/Header.jsp at line 12

12:     <dxa:region name="Toerisme:Logo"/>
13: 
14:     <button class="sitemenu-trigger" aria-controls="mainnav" aria-expanded="false"><span
15:             class="vlbr-icon icon-menu"></span><span class="sr-only">Open menu</span></button>


Stacktrace:
    at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:584) [jasper.jar:8.5.5]
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481) [jasper.jar:8.5.5]
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) [jasper.jar:8.5.5]
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) [jasper.jar:8.5.5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:726) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:592) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:526) [catalina.jar:8.5.5]
    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:229) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [servlet-api.jar:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:726) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:592) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:526) [catalina.jar:8.5.5]
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:887) ~[jasper.jar:8.5.5]
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:647) ~[jasper.jar:8.5.5]
    at com.sdl.webapp.common.markup.AbstractMarkupTag.decorateInclude(AbstractMarkupTag.java:91) ~[dxa-common-api-1.5.0.jar:1.5.0]
    at com.sdl.webapp.common.impl.taglib.dxa.RegionTag.doStartTag(RegionTag.java:144) ~[dxa-common-impl-1.5.0.jar:1.5.0]
    at org.apache.jsp.WEB_002dINF.Views.Toerisme.Page.ToerismeHomePage_jsp._jspx_meth_dxa_005fregion_005f0(ToerismeHomePage_jsp.java:340) [ROOT/:na]
    at org.apache.jsp.WEB_002dINF.Views.Toerisme.Page.ToerismeHomePage_jsp._jspService(ToerismeHomePage_jsp.java:208) [ROOT/:na]
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jasper.jar:8.5.5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443) [jasper.jar:8.5.5]
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) [jasper.jar:8.5.5]
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) [jasper.jar:8.5.5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:726) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:394) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311) [catalina.jar:8.5.5]
    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) [spring-webmvc-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [servlet-api.jar:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:286) [web-ambient-client-8.2.0-1005.jar:8.2.0-1005]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:8.5.5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:8.5.5]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [catalina.jar:8.5.5]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) [catalina.jar:8.5.5]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:8.5.5]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.5]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.5.5]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) [catalina.jar:8.5.5]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.5]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [catalina.jar:8.5.5]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784) [tomcat-coyote.jar:8.5.5]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.5]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802) [tomcat-coyote.jar:8.5.5]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410) [tomcat-coyote.jar:8.5.5]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.5]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.5]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.NullPointerException: null
    at com.sdl.webapp.common.impl.taglib.dxa.RegionTag.doStartTag(RegionTag.java:113) ~[dxa-common-impl-1.5.0.jar:1.5.0]
    at org.apache.jsp.WEB_002dINF.Views.Toerisme.Region.Header_jsp._jspx_meth_dxa_005fregion_005f0(Header_jsp.java:258) ~[ROOT/:na]
    at org.apache.jsp.WEB_002dINF.Views.Toerisme.Region.Header_jsp._jspService(Header_jsp.java:141) ~[ROOT/:na]
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jasper.jar:8.5.5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443) [jasper.jar:8.5.5]
    ... 81 common frames omitted

My page is included in the following manner:

Page Template: enter image description here Main Page: enter image description here Included Header Page enter image description here The Header is accessed in the following manner from the main Page (which works, when the Logo region is not added to the Header)

<dxa:region name="Toerisme:Header"/>

Inside the Included Header page, the logo region is loaded as follows:

<dxa:region name="Logo"/>

The Logo Region is Composed as follows: enter image description here enter image description here

4

Region names are normally unqualified (e.g. just "Header" instead of "Toerisme:Header").

Furthermore, for include Pages, the (unqualified) Region Name and (qualified) Region View Name is derived from the Page Title.

I see you're using qualified Region names in the dxa:regiom tag and in the PT metadata. Furthermore, you're predefining the Toerisme:Header Region in PT metadata.

You didn't mention what the title is of your Header include Page, but I guess you have two Regions in your Page Model: Header representing the include Page and Toerisme:Header representing your predefined Region. The latter will be empty, but that one gets rendered by the <dxa:region name="Toerisme:Header"/> tag.

A nice debugging technique which you can use to (dis)prove this theory is to request the Page with ?format=json in the URL. That returns a JSON representation of the Page Model (so it doesn't get rendered using Views).

| improve this answer | |
  • I was indeed loading 2 Regions: Header and Toerisme:Header – CodeFinity Oct 19 '16 at 9:11
  • The include is loading the correct Header region now, including the Logo. I am wondering though, how does it know that it needs to load the Header from the 'Toerisme' Module and not from Core? How would you specify that using the Header page title? – CodeFinity Oct 19 '16 at 9:25
  • Looked more into it and the wrong Header (from Core instead of Toerisme Module) is indeed being loaded now. How do I specify the Module from which to load the Header inside the Page title? – CodeFinity Oct 19 '16 at 12:25
  • Changed the page title to be Toerisme:Header. Accessing by <dxa:region name="Header"/>. This loads Header from the correct module so I'm assuming this is the correct way to do it? – CodeFinity Oct 19 '16 at 12:47
  • 1
    Yes, that is indeed the way to do it: let the include Page title be the qualified Region View Name; the Region Name becomes the same, but unqualified (i.e. excluding the Module/Area name). – Rick Pannekoek Oct 19 '16 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.