Results 1 to 2 of 2

Thread: One Session Form Backing Object, Many Forms?

  1. #1

    Default One Session Form Backing Object, Many Forms?

    Good Morning,

    I have a question concerning session forms,

    I wish to use a POJO that is stored in my session across multiple forms in my application (one form backing object, multiple forms).

    I can't seem to control what the name of session attribute used to store the form backing object in the session is.

    It isn't for a wizard, the form backing object is just a list of settings I want the user to carry with them across the application.

    Code:
        <bean id="mainPageController" class="com.concilerpress.webapp.action.MCPMainPageController">
    		<property name="commandClass" value="com.concilerpress.webapp.action.commandobject.AppState"/>
    		<property name="commandName" value="appState"/>
    		<property name="successView" value="redirect:/main_page.html" /> 
    		<property name="cancelView" value="forward:/" /> 
    		<property name="formView" value="index"/> 
    
    		<!-- Specified as a sessionForm -->
    		<property name="sessionForm" value="true" />
        </bean>
    Now when the form-backing object gets stored in the session I get a log message that reads:

    Code:
    	Setting form session attribute [com.concilerpress.webapp.action.MainPageController.FORM.appState] to: com.concilerpress.action.commandobject.AppState@4c03d
    Therefore, it would seem to me that this means my form-backing object is stored in the session attribute: com.concilerpress.webapp.action.MainPageController .FORM.appState

    I can't seem to find a setter for setting the name of the session attribute which stores the form; Now given this fact, how can I retrieve the same form backing object from the session in a different part of the application?

    Thank you,
    Andrew J. Leer

  2. #2
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    IIUC, sessionForm is only intended to carry over data through a complete form display/submission cycle without having to reload data from the business layer for each request during the cycle.

    For what you are trying to achieve, session scope beans might be better.
    --Jing Xue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •