Is anyone using SpringSource tc server as a Tomcat replacement?

As I see it, the primary advantage of tcServer is in managing large clusters of load-balanced tomcats. Aside from the management/monitoring layer (which is very cool, by the way), it also has a faster database connection pooling mechanism, and a generally tweaked configuration optimised for high volume. Other than that, it’s just Tomcat.

What is difference between @Resource UserTransaction and EntityManager.getTransaction()

EJB are transactional components. The transaction can be managed either by the applicaiton server itself (CMT – container-managed transaction), or manually by yourself within the EJB (BMT – bean-managed transaction). EJB supports distributed transaction through the JTA specification. The distributed transaction is controlled using UserTransaction, which has methods begin, commit, rollback. With CMT, the application … Read more

How exactly are the root context and the dispatcher servlet context into a Spring MVC web application?

Root Context The root-context in a Spring application is the ApplicationContext that is loaded by the ContextLoaderListener. This context should have globally available resources like services, repositories, infrastructure beans (DataSource, EntityManagerFactorys etc.) etc. The ContextLoaderListener registers this context in the ServletContext under the name org.springframework.web.context.WebApplicationContext.ROOT. If you load an ApplicationContext yourself and register it with … Read more

What exactly is the web-app version? What does it affect?

Web.xml is a central place where you define the configuration of your Web application. For instance you can specify there: servlet mapping, i.e. which URL path refers to which Java class (e.g. when user types http://something.com/Koray you can point that request to KorayServlet.java class where you keep the implementation of the servlet) authorization parameters, e.g. … Read more

JMX Defined [closed]

JMX is a way to view and manipulate the runtime state of your application. It’s somewhat similar in concept to SNMP, if that helps. IMO, it’s indispensable for monitoring and understanding server-type applications that might not have any other user interface besides writing to a log file. The basic approach is to create an interface … Read more

How to handle authentication/authorization with users in a database?

There are several options. Which to choose is fully up to you. Just objectively weigh the concrete advantages and disadvantages conform your own situation. 1. Use Java EE provided container managed authentication Just declare a <security-constraint> in web.xml which refers a security realm which is configured in servletcontainer. You can for your webapp specify URL … Read more

Why does getRealPath() return null when deployed with a .war file? [duplicate]

For a start, ServletRequest.getRealPath(String path) is deprecated. The appropriate replacement is: ServletContext context = session.getServletContext(); String realContextPath = context.getRealPath(request.getContextPath()); However, the API docs for ServletContext.getRealPath(String path) state: “This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made … Read more