Search code examples
javaxsltstruts2

package org.apache.struts2.views.xslt does not exist in struts2 core 6.3.0.2 library


My application is built on struts2. I am extending the class org.apache.struts2.views.xslt.XSLTResult in the code. I am getting an error that this package does not exist.

The custom class is then used to define default result types in struts.xml like this-

<result-types>
    <result-type name="e5xsl" class="com.cedar.e5wui.webwork.views.XSLTResult"/>
</result-types>

I upgraded my struts2 library from 2.5.x to 6.3.0.2. I checked the api docs of struts and found out that this package is not present in 6.2.0 and higher. Which alternate package can be used for the same purpose?

The dependency upgrade is not major, struts released 6.x directly after 2.5.x. I read through all the release notes and api docs but could not find anything regarding this particular package


Solution

  • XSLTResult was moved into a plugin in Struts2 6.2.0. Its dependency is:

    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-xslt-plugin</artifactId>
        <version>${strust.version}</version>
    </dependency>