Hi all,
I'd like to get to the bottom of this issue: Suppose you have a re-usable form
such as editcontactmech that is called from various screens. To get back to the
screen the user came from, there is a [Go Back] and [Save] link generated from a
DONE_PAGE parameter that is passed to editcontactmech.
However, suppose instead of having [Go Back] and [Save], the requirement is that
the user is taken back to the originating screen upon submitting the form.
Currently, the only way I was able to implement this was to have a special java
event method called donePageRequestHelper as follows,
<!-- call this request when you have a donePage that you want to go to
after finishing a service -->
<request-map uri="donePageRequestHelper">
<security https="true" auth="true"/>
<event type="java" path="path.to.java" invoke="donePageRequestHelper"/>
<response name="viewContact" type="request-redirect"
value="viewContact"/>
<response name="viewAccount" type="request-redirect"
value="viewAccount"/>
<response name="viewLead" type="request-redirect" value="viewLead"/>
...
</request-map>
public static String donePageRequestHelper(HttpServletRequest request,
HttpServletResponse response) {
String donePage = (String) request.getParameter("donePage");
if (donePage == null) {
donePage = "error";
}
return donePage;
}
The problem with this is that the request-redirect will end up adding all the
form parameters to the URL. I see no way to resolve this with the current
RequestHandler, except maybe with a flag to prevent the form POST data from
being added to the GET parameter data. That is, it is only desired to pass
along GET parameters to the redirect URL from the original request.
Any ideas?
- Leon