I have a list that is accessible to all user of my application.I am currently adding it to session of a particular user.But i want it to be in application scope rather than session scope.Please help also provide reference/link to any example
I am not sure how you want to use the list: you want to display that list to the screen or you just need it as configuration. To display it you could:
statically
in your Action, then display it in the JSPdynamically
from a database, then display it in the JSPTo use it as configuration: some data can be made available at application level at initialization, but those are configuration params. More info here:
Using the ServletContext
is the only way you can set parameters dynamically to the servlet from your code: servletContext.setAttribute()
. More info here: