Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Complete
-
Affects Version/s: 1.2.1.RELEASE
-
Fix Version/s: 1.2.2.RELEASE
-
Component/s: WEB MVC
-
Environment:Mac OSX 10.7.3 (Lion), Apache Tomcat v6.0.35, STS 2.9.1.Release, Roo 1.2.1.Release
Description
I created a simple Roo Project from within STS and added several entities. I then enabled 'web mvc' and generated scaffolding for all of my entities. When launching the application in a local instance of Apache Tomcat v6, I then attempt to access the 'Create' form to create a new entity. The website shows an error message and a stack trace is visible in the log file with the message, "Neither BindingResult nor plain target object for bean name 'XXX' available as request attribute".
I did a little debugging and eventually discovered that the name assigned to the model object in my controller was different than the name referenced in the 'modelAttribute' attribute of the 'form:create' tag in create.jspx. Note that both the controller and the create.jspx were autocreated and untouched by me. I also noticed that this problem did not happen for every create.jspx/controller pair that existed for my different entities. I further noticed that entities that began with consecutive capital letters (in my case, "ININPhoneChannel") had this problem while entities that followed normal camel case rules (in my case, "NormalChannel") did not. I believe that it is this difference in character casing that is at the heart of the problem. For now I am able to work around this by choosing different names for my entities, but I would rather not, and ideally, I don't think I should have to.
See the attached log.roo file for the series of commands that will reproduce this issue. Remember, this project was created from within spring STS (File>New>Spring Roo Project). This issue is 100% reproduce-able.