0

I have a page where I'm "Viewing session info" (where session in this context is a business element. Think of a session like a training session). Part of this session info is a list of files. (An example of a session file would be the sign-in sheet of all the people who attended the session.) Clicking the link at the end of the list of files will delete the file from the session via a method called `inativeateSe

In my struts config for inactivateSessionMaterial, I have the following result

<result name="success">
    /secure/courses/sessions/view_session_info.jsp
</result>

But this is insufficient. It really needs to be view_session_info.jsp?sessionId=1234. How can I add that variable (session id) to the end of this? Something like

<result name="success">
    /secure/courses/sessions/view_session_info.jsp?sessionId=$sessionId
</result>
corsiKa
  • 81,495
  • 25
  • 153
  • 204

1 Answers1

1

Just use <param> tag inside your action for all results in this action

<action>
   <param name="sessionId">${sessionId}</param>
   <result>...</result>
</action>

or for specific action result.

<action>
   <result>
      <param name="location">...</param>
      <param name="sessionId">${sessionId}</param>
   </result>
</action>
Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
  • So like `/secure/blah/view.jsp${sessionId}` nested inside the result tag? – corsiKa Nov 22 '12 at 20:02
  • Your answer is correct, so I'm accepting it. However, it has led me to an epiphany... I actually want my action to do -nothing-. Is there a way I can do ``? – corsiKa Nov 22 '12 at 20:45
  • Not sure what do you mean by "nothing". You can return `Action.NONE` from your action. See http://struts.apache.org/2.x/docs/result-configuration.html. – Aleksandr M Nov 23 '12 at 09:29