The Application scope
getting an object that was placed in application scope (done in Struts Action):
In your Struts Action Class (inherits from org.apache.struts.action.Action) , like was done here just create the following method:
protected Object getApplicationObject(String attrName) {
return servlet.getServletContext().getAttribute(attrName);
}
setting an object into application scope can be done by implementing a struts plugin.
Create a class that extend org.apache.struts.action.PlugIn:
public class myPlugin implements org.apache.struts.action.PlugIn {
public void init(org.apache.struts.action.ActionServlet servlet,
ModuleConfig applicationConfig) throws ServletException {
setApplicationObject(servlet, "object1", "YES");
}
protected void setApplicationObject(
org.apache.struts.action.ActionServlet servlet, String attrName,
Object obj) {
ServletContext context = servlet.getServletContext();
context.setAttribute(attrName, obj);
}
}
Don’t forget to define your plugin in struts config file:
< plug-in className="myPath.myPlugin"/>
Lastly, remember the application scope is multithreaded
AJAX Demos
Relevance has Demo from Ajax presentation at Java in Action .
link dump
How about UML
JBOSS has issues?
Java news
Need a conversion?
whats in that jar
lost that number
Yahoo! Podcasts
Link: Yahoo! Podcasts.