In my project I want to use the Sitemesh, for each page there will be a menu template. Previously, he worked when he was in web.xml. But now i deleted web.xml and I want to implement it without web.xml. correctly implemented the site mesh, it just does not work for me
package adil.java.schoolmaven.config;
import org.sitemesh.builder.SiteMeshFilterBuilder;
import org.sitemesh.config.ConfigurableSiteMeshFilter;
public class MySiteMeshFilter extends ConfigurableSiteMeshFilter {
@Override
protected void applyCustomConfiguration(SiteMeshFilterBuilder builder) {
builder.addDecoratorPath("/*", "/WEB-INF/decorators/homeDecorator.jsp")
.addDecoratorPath("/allStudents", "/WEB-INF/decorators/homeDecorator.jsp")
.addDecoratorPath("/addStudents.jsp", "/WEB-INF/decorators/addStudentDecorator.jsp");
}
}
Code in web.xml which i delete
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>