Author | Message |
---|---|
abhishek_sharma
Posts: 79
|
Posted 10:08 May 07, 2009 |
If I am not wrong formBackingObject forward us to the mapped .JSP, do we need to set any attribute for an object or just return that object in order to print the values of tht object ? Because
System.out.println(blogentry.getBlog().getIntBlogId()) is giving me the desire output but ${blogentry.blog.intBlogId} is neither printing/giving any value nor even an error
Last edited by abhishek_sharma at
10:11 May 07, 2009.
|
cysun
Posts: 2935
|
Posted 11:21 May 07, 2009 |
This is roughly how a SimpleFormController works:
The formBackingObject() in SimpleFormController will create a command object by calling the default constructor (i.e. the constructor with no argument) of the command class. If that's enough, you do not need to overrride formBackingObject(). Sometimes you want to use a different constructor or initialize some fields that are not initialized in the default constructor. In those cases you need to override formBackingObject() in your controller. See csns.spring.controller.forum.CreateTopicController for example. I don't quite get why you want to print out the command object.
|