0

I have successfully running my application in Java 6 and Jboss 6.1 and Spring 2.3

Now, Am Migrating My Application to Java 8 and WildFly 8.2 and Spring 4.2

Everything looks fine but, for an application there is a issue,

that the decorators are not working as it configured below.

sitemesh.xml file is :

<sitemesh>
    <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
    <excludes file="${decorators-file}"/> 
    <page-parsers>
        <parser default="true" 
            class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
        <parser content-type="text/html" 
            class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
        <parser content-type="text/html;charset=ISO-8859-1"
            class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>
    </page-parsers>

    <decorator-mappers>
        <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
            <param name="config" value="${decorators-file}"/> 
        </mapper>
    </decorator-mappers>
</sitemesh>

dispatcher-servlet is :

 <!-- View Resolver for JSPs -->
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="prefix"> <value>/WEB-INF/view/</value></property>
        <property name="suffix"> <value>.jsp</value></property>
    </bean>

And decorators.xml file is :

<decorators defaultdir="/decorators">
    <excludes>
        <pattern>/pages/*</pattern>
    </excludes>
    <decorator name="ajax" page="ajax.jsp">
    <pattern>/ajax/*</pattern>
    </decorator>
    <decorator name="thanks" page="thanks.jsp">
    <pattern>/thanks.*</pattern>
    <pattern>/session-expired.*</pattern>
    </decorator>
    <decorator name="default" page="default.jsp">
        <pattern>/*</pattern>
    </decorator>
      <decorator name="errlayout" page="errlayout.jsp">
        <pattern>/error*</pattern>
        <pattern>/404*</pattern>
        <pattern>/500*</pattern>
        <pattern>/403*</pattern>
        <pattern>/dataAccessFailure*</pattern>
    </decorator>
</decorators>

web.xml is :

<filter>
    <filter-name>sitemesh</filter-name>
    <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
  </filter>
 <filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>

Directory Structure

-WebContent
     |-decorators
     |-images,css,scripts,..etc
     |-WEB-INF
           |-lib
           |-view
                |-ajax
                |  |-.jsp Files
                |.jsp Files

What can be the issue or do i need to change any thing in configuration ?

Raj Kumar Samala
  • 561
  • 12
  • 31
  • You are aware that Spring 4.2 isn't final yet, there is only a release candidate? Also SiteMesh is pretty old and not maintained anymore so it might break on newer java(ee) versions. Could you specify a bit more on what isn't working anymore? Errors? – M. Deinum Jun 03 '15 at 06:24
  • HI, the same sitemesh config is working other application where all my .jsp files are in Webcontent folder, but in this application all my .jsp files are added in WEB-INF/View folder, we have InternalResourceViewResolver to notify the path, but still it's not loading the page properly ? – Raj Kumar Samala Jun 03 '15 at 11:05
  • Nice that site mesh works but you are using old technology with not even final releases of frameworks... Also if your files are somewhere else then your decoraters.xml needs to point to those files i.e. `/WEB-INF/view/ajax.jsp`. Sitemesh doesn't know about spring or its view resolvers. – M. Deinum Jun 03 '15 at 11:19
  • i Have added Spring 4.1, but the same problem occurs ? any solution ? – Raj Kumar Samala Jun 04 '15 at 09:22
  • Have you read my full comment? You seem to have only read the first part... – M. Deinum Jun 04 '15 at 09:23

0 Answers0