Announcement Announcement Module
Collapse
No announcement yet.
Need help with accessing POST-variables Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with accessing POST-variables

    Hi,
    I'm trying to read in some form data in a method that i called via a rendering-action element.

    so i have that jsp with my form and a hidden field for the flow-key and my object id:

    Code:
    <form action="wizard" method="post">
    	<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
    	<input type="hidden" name="objectId" value="${sessionScope.object.objectId}" /> 
    	...
    then the transition leads me to this view:
    Code:
    <view-state id="feature" view="cpWizard/feature">
    		<render-actions>
    			<action bean="createObjectController" method="getObjects"/>
           	</render-actions>
    
    ...
    and inside my objectController the getObjects method is successfully called. i tried to print out all entries of all maps stored in each scope or context i could access via the RequestContext object and i could not find my objectId from that hidden field.

    how can i access that simple value?

  • #2
    Hi,

    have you tried

    contextPar.getRequestParameters().asMap() ?

    Normally here you can find all request Parameters from the underlying external context.

    Regards
    lyserg

    Comment


    • #3
      no, didn't work. i tried also
      context.getExternalContext().getRequestParameterMa p().asMap()
      context.getExternalContext().getRequestMap().asMap ()
      context.getRequestParameters().asMap()
      context.getFlowScope().asMap()
      context.getActiveFlow().getAttributes().asMap()
      ...and some more...

      is it only possible to access the parameters when i use a formAction (didn't tried this out, yet)?

      Comment


      • #4
        Hi,

        this is crazy, normally you can access all the request paramters like explained.
        Could you please check if the paramter is really filled while sending back to the server. (By looking into the page source)

        Regards
        lyserg

        Comment


        • #5
          All request parameters of the current request are in the context.getRequestParameters map. You're probably having an alwaysRedirectOnPause side effect:

          http://www.ervacon.com/products/swf/tips/tip4.html

          The event processing phase and render phase happen in completely separate requests. As a result any request parameters submitted with the first request (event processing phase) will no longer be available when the view is rendered in the second request (render phase). Capture any required request parameters in flash scope or flow scope to make them available for view rendering.
          Erwin

          Comment


          • #6
            Thanks for that hint, Erwin! Since I called my method as a render-action it couldn't work. I changed it to an entry-action and my data is where I expected it to be...

            Thanks a lot!

            Comment

            Working...
            X