JSF resource versioning

If I do like this resources/js/1_0_0/mainscript.js It does not work. It says RESOURCE_NOT_FOUND This will work if you specify js as library name. <h:outputScript library=”js” name=”mainscript.js” /> However, this is not the proper usage of a resource library. Rather introduce one. resources/default/1_0_0/js/mainscript.js Then you can specify it as follows: <h:outputScript library=”default” name=”js/mainscript.js” /> They did … Read more

Enabling SSL on tomcat using pem file

While most answers concentrate on versions 7.0 and 8.0 of Tomcat that were supported at the time of the question, since version 8.5.2 (May 2016) it is possible to use PEM files directly without conversion to a PKCS12 file. You can either: put the PEM encoded private key and all certificates in the order from … Read more

Detect the URI encoding automatically in Tomcat

The complicated way to achieve my goal was indeed to write my own javax.servlet.Filter and to embed it into the filter chain. This solution complies with the Apache Tomcat suggestion provided in Tomcat Wiki – Character Encoding Issues. Update (2010-07-31): The first version of this filter interpreted the query string itself, which was a bad … Read more

Which technologies does Tomcat support?

Tomcat as being a barebones servletcontainer provides indeed only JSP, Servlet, EL and WS APIs out the box. You can however just provide JSF, JSTL, CDI, JPA, Hibernate, Spring, etc yourself along with the web application in flavor of JAR file(s) in the /WEB-INF/lib folder and some configuration files where necessary. EJB is only a … Read more

tomcat auto start servlet [duplicate]

you could use the servlet context listener. More specifically you could start your thread in the contextInitialized method: import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class MyListener implements ServletContextListener { public void contextInitialized(ServletContextEvent sce) { // start the thread } public void contextDestroyed(ServletContextEvent sce) { // stop the thread } } then add: <listener> <description>ServletContextListener</description> <listener-class>MyListener</listener-class> </listener> … Read more

How does server prioritize which type of web.xml error page to use?

This is not specific to Tomcat. This is specific to the Servlet API. How the error page is determined is specified in chapter 9.9.2 of Servlet API specification 2.5. Here’s an extract of relevance: SRV.9.9.2 Error Pages If no error-page declaration containing an exception-type fits using the class-hierarchy match, and the exception thrown is a … Read more