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

How to auto detect entities in JPA 2.0

You need add to the persistence.xml the next line: <exclude-unlisted-classes>false</exclude-unlisted-classes> e.g. <?xml version=”1.0″ encoding=”UTF-8″?> <persistence version=”2.0″ …> <persistence-unit name=”YourPU” …> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> <property name=”eclipselink.logging.level” value=”ALL”/> <property name=”eclipselink.ddl-generation” value=”drop-and-create-tables”/> </properties> </persistence-unit> </persistence>

how to share a jsf error page between multiple wars

You need to create a custom ResourceResolver which resolves resources from classpath, put it in the common JAR file and then declare it in web-fragment.xml of the JAR (or in web.xml of the WARs). Kickoff example: package com.example; import java.net.URL; import javax.faces.view.facelets.ResourceResolver; public class FaceletsResourceResolver extends ResourceResolver { private ResourceResolver parent; private String basePath; public … Read more

EAR vs separate EJB + WAR

There seems to be some confusion between 3 variants of deployment: An EAR that includes an EJB and WEB module Deploying a separate EJB module and a separate WEB module Deploying a WEB module that includes EJB classes or an EJB jar. In the first situation, you have logically one application, but one that is … Read more

AccessController.doPrivileged

It is just getting a system property. Retrieving system properties requires permissions which the calling code may not have. The doPrivileged asserts the privileges of the calling class irrespective of how it was called. Clearly, doPrivileged is something you need to be careful with. The code quoted is the equivalent of: String lineSeparator = java.security.AccessController.doPrivileged( … Read more

JAX-WS vs. JAX-RPC

You didn’t mention anything about the implementations you’re using so it’s hard to say anything about them 🙂 I don’t know if your benchmark is representative of anything, I’m not sure it allows to make any valid conclusion. JAX-WS is supposed to perform better in general than JAX-RPC, see the already mentioned article. JAX-RPC is … Read more