in web.xml
JSPConfiguration<
this code should work:
JspConfigDescriptor j = new JspConfigDescriptor()
{
@Override
public Collection<TaglibDescriptor> getTaglibs()
{
// TODO Auto-generated method stub
return null;
}
@Override
public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups()
{
Collection<JspPropertyGroupDescriptor> c = new ArrayList<JspPropertyGroupDescriptor>();
JspPropertyGroupDescriptorImpl pgDescriptor = new JspPropertyGroupDescriptorImpl();
pgDescriptor.setIsXml(Boolean.TRUE.toString());
pgDescriptor.getUrlPattern().add("/js/generated/*");
pgDescriptor.setElIgnored(Boolean.FALSE.toString());
pgDescriptor.setPageEncoding("UTF-8");
c.add(pgDescriptor);
return null;
}
};
servletContext.setJspConfigDescriptor(j);
But last statement will be available since Tomcat 8
You have access to it with
servletContext.getJspConfigDescriptor().getJspPropertyGroups();
returning a
Collection<JspPropertyGroupDescriptor>
which has anadd(JspPropertyGroupDescriptor)
method.JspPropertyGroupDescriptor
is an interface which you have to implement. You're probably better off having a partialweb.xml
and partial java configuration.Sotirios Delimanolis Apr 24 at 16:07