• Post Reply Bookmark Topic Watch Topic
  • New Topic

Will Struts 1.3 replace a form bean in scope?  RSS feed

Steve Dambrosio
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm seeing a behavior in Struts 1.3.10 and didn't happen in Struts 1.1. If I already have a form bean in scope (in my case session scope) and it is of a different type than what is defined in the <form-bean> definition in struts-config.xml, Struts will replace it! The user manual says:
Check for an instance of a bean of the appropriate class, under the appropriate key, in the appropriate scope (request or session).
If there is no such bean instance available, a new one is automatically created and added to the appropriate scope (request or session).

I suppose if I take the "of the appropriate class" phrase literally, then it seems to be the correct behavior, but then they go on to say "created and added" which is ambiguous. I'd feel better if I can find something that says explicitly that a form bean in session scope can be replaced. Can anyone confirm or deny this behavior? Thanks!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!