Hi All, I have not fully explored Struts , though we have modified the required components as per our requirements and using it, I would like to know how to handle global parameters in Struts which are used for almost every other request/response . As per Struts,Request handlers are cached by Request processors when first created and subsequently made available to other incoming request.So is there a global configuration object which is polled and made available to the request handler when required.Would like inputs from people using it and Ted... Rishi Singh SCJP,SCWCD
posted 13 years ago
Generally, you would just tuck that away in the application (or servlet) context under a predetermined name. The Struts tags (and Velocity View tools) will check all the scopes for any object referenced in a presentation page. Within in an Action, you can access the object directly. The Controller servlet is provided as a member variable, so you have access to all the servlet methods. In Struts 1.0, a helper servlet was often used to load such parameters (though you could also subclass the ActionServlet if you wanted). In Struts 1.1, there is a PlugIn interface for Actions, which you can use to load global resources like this. HTH, Ted.
<a href="http://husted.com/struts/book.html" target="_blank" rel="nofollow">Struts in Action</a>