This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Removing form session attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Reply Bookmark "Removing form session attribute " Watch "Removing form session attribute " New topic
Author

Removing form session attribute

Ramesh Etta
Ranch Hand

Joined: Sep 18, 2007
Posts: 46
Hi,

I had a problem with the session form. I wrote a controller which inherits SimpleFormController and set the sessionForm to true.
When i sent the first request to the server, a session is created see the log message below:
Setting form session attribute .....
and when i resend the request with some change in parameters i got to see the message
Removing form session attribute ...... <command class>
I think because of this i am getting NullPointerExceptions.

I dont know why its giving the message like this.
can any body say why its being removed from the session.
and how to overcome it.
Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
When you read the API for the getCommand method in AbstractFormController you can see the comment

Calls formBackingObject if not in session form mode. Else, retrieves the form object from the session. Note that the form object gets removed from the session, but it will be re-added when showing the form for resubmission.

Basically spring will remove it from the session and re-bind it to the session if needed


Paras Jain
SCJP 5.0
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Removing form session attribute
 
Similar Threads
Struts Session Scope Listener
Problem passing a value from one jsp to another using href
availability of ActionForm object in two action classes.
Question with FormBean and action class
ActionForm Thread Safety