Introduction Resource bundles are objects that are characterized by a specific ‘Local’, i.e. are specific to particular geographical areas in terms of language, date format and other standards. Usually they are represented by simple properties files in the classpath with a suffix that indicates the targeted local and the application can load the appropriate resource bundle … [Read more...] about How to dynamically load Resource Bundles in Struts 2
Archives for April 2015
How to customize the StrutsSpringObjectFactory
Introduction Spring can use its own MVC or integrate other MVC frameworks. It can for instance integrate with Struts2 by a specific plugin. The plugin overrides the Struts Object Factory providing a way to configure struts actions as beans in the Spring Context. Sometimes some customized behaviour is needed and the spring plugin as it is is not enough. In this case the … [Read more...] about How to customize the StrutsSpringObjectFactory
Thread scope and ThreadLocal
Introduction When we implement a java servlet web application we face the problem of choosing in which scope to put information in, depending on the needs. In the normal scenarios we have to cope essentially with Context (i.e. ServletContext), Session and Request scopes. A slightly different requirement comes out when one wants to store some object or information in the … [Read more...] about Thread scope and ThreadLocal
How to modify the servlet request
Introduction Dealing with http web frameworks, one day or the other one has to cope requirements that go beyond the standard features offered by the chosen platform. A common issue would be to change the request submitted by the client or the response content returned to it on the fly. Java Servlet technology deals with these issues basically with servlet filters and some … [Read more...] about How to modify the servlet request
How to transform the servlet response content
Introduction In the previous post How to modify the servlet request we explained how to change the servlet request on the fly, using the servlet filter mechanism and the class HttpServletResponseWrapper. In the following paragraphs we are going to show how to change the response content just before it is sent back to the client. How to tranform the http response content We … [Read more...] about How to transform the servlet response content