Here is my question. I am working on simple web application, there is a scenario, in the front end i will be displaying 2 drop downs(the values are from db) and the two drop downs will be displayed when the page is loaded. if the user selects any one of the drop down then the second drop down needs to be adjusted dynamically based on first drop down value. it is also working fine.
but the problem it is working only when i put the action form in session scope(in struts-config.xml) when i put the form in request scope my program ends up with an exception.. " Failed to obtain Specified Collection". but i seriously wanted the action form to be on request scope.
Then how to achieve this. Any help is greatly appreciated.
but i seriously wanted the action form to be on request scope
Please explain this. Why do you want the ActionForm to be in the Request scope?
Joined: Oct 10, 2008
This is the best practice to have the form to be in request scope, and also i heard that if the form is in session scope , when the app is moved to production ther will be some strange behavior(few times) i am not sure about that. may b i am wrong.. clarify me..
Joined: Apr 16, 2008
I don't think that the "best practice" that you mention is really a "best practice." Did you read about this on someone's web page?
There seem to be a bunch of things that you need to test for yourself.
There is no such thing as a single "production environment." There are hundreds of thousands of different "production environments" all around the world.
You should not base you software development practice on individual opinions and things you read on "web sites."
There is nothing wrong with putting an object reference is the session, if it works in your environment and meets your requirements effectively.