I would like to understand how i can pass a value on form submit from one page to another.
I have a form submit from one component
Component class doAction() method
@Override
public void doAction(HstRequest request, HstResponse response) throws HstComponentException {
FormMap map = new FormMap(request, new String[]{"test"});
HstRequestContext context = request.getRequestContext();
final HstLinkCreator hstLinkCreator = context.getHstLinkCreator();
final HstLink hstLink = hstLinkCreator.create("/accelerator", context.getResolvedMount().getMount());
**FormUtils.persistFormMap(request, response, map, null);**
try {
response.sendRedirect(hstLink.toUrlForm(context, false));
} catch (IOException e) {
log.warn("Error redirecting to 404 page: ");
}
}
When i persist the formMap i am able to retrieve this value on the same components doBeforeRender() method. But since i have to redirect the request to another sitemap (page) how can i retrieve the value in another page ?