In a Struts Action, I want to get a parameter from the URL or from a hidden field, when the parameter in the URL is not set. To retrieve the parameter from the URL is as follows:
String userId = request.getParameter("userId");
But the problem is now, the HTML is based on forms (legacy code). And I observerd that the parameter userId
may be reset to null
. Is it an option to set the parameter in a form in a hidden field as well? Would I need to define a parameter in the dynaForm for this? How would I retrieve the parameter from the hidden field?