This week I’ve tried to upgrade from Weblets 0.4 to 1.0 while using the following technologies: JSF1.1, JDK1.4 and Weblogic 8.1.
Here are some of my experiences:
As noted in the documentation on https://weblets.dev.java.net/doc/longdoc/setup.html, the web.xml needs the following additions:
This in fact makes sure that the WebletsPhaseListener knows when to process a resource or not by looking at the url
For Weblogic 8.1 it also necessary to add the following listener to your web.xml:
I couldn’t get Weblets to work without it.
Last but not least you should add mime-mappings to your web.xml for all the different types of static resources you want Weblets to serve:
If you don’t do this, then a NullPointerException is thrown internally by Weblets and gives problems serving the static resources.
I don’t know about other servers, but on Weblogic doing a servletContext.getMimeType will return null when it was not defined in the web.xml
In fact, Weblets 1.0 also supports defining a <mime-mapping> in the weblets-config.xml. But adding the mime types only there didn’t work as in the Weblets source code there are few places where servletContext.getMimeType is called directly thus ignores any configuration done in the weblets-config.xml. For the next version of Weblets it would be interesting to fix this behaviour and document eg. that mime-mappings in weblets-config.xml take precedence. And if not defined there, Weblets will try to look for mime-mappings in the web.xml via the servlet context.