1 Reply Latest reply on Jan 10, 2008 3:48 PM by ajohnson1200

    webwork redirect keeping all paramters

       

      Hello, I am currently heavily rewriting the moderation system to suit our needs.

       

       

      But i have a generic question about webwork redirects in the xwork xml file....

       

       

      First you view a thread with all posts to moderate using the viewThread.jspa?threadID=111 page

       

       

      Each msg has a button next to it saying "publish" and the form pointing to the moderatePost with the msgid included in the post.

       

       

       

      After moderating a post (with themoderatePost action), i want to return to my viewThread.jspa but keeping all the params (e.g. ?threadID=, and others)...is this possible.

       

       

       

       

       

      In my xwork-plugin.xml i have this for my moderatePost action

       

       

      <action name="moderatePost " class="com.stuff.moderatePost ">

                  <result name="success" type="redirect">viewThread .jspa</result>

      </action>

       

       

      I dont want to list out all the possible params e.g.

       

       

      <action name="moderatePost " class="com.stuff.moderatePost ">

                  <result name="success" type="redirect">viewThread .jspa?threadID=$&blah=$</result>

      </action>

       

       

      (incidentally that didnt work either)

       

       

      Is there anything i can add similar to includeParams="all" ?

       

       

      Thanks!

       

       

      Alex.

       

       

       

       

       

        • Re: webwork redirect keeping all paramters

          hi Alex,

           

          One thing I've done in the past is to have your action build up a list of all the parameters (since it has access to the request) and then create a getter for that string:

          public String getUrlParams() {
            return urlParams; // this instance variable set somewhere in your execute method
          }

          and then in your xwork config:

           <action name="moderatePost " class="com.stuff.moderatePost ">
          <result name="success" type="redirect">viewThread .jspa?{urlParams}</result>
          </action>

           

          Cheers,

           

          AJ