I'm using struts2 for front end framework and found this issue which need to be resolved. So I view the page with edit privilege for this url
[CONTEXT]/getUser.do?userId=1
But when I click Submit button, it seems struts render my request uri to getUser.do without any URL parameter. It also displayed in my result url
[CONTEXT]/getUser.do
From this SO solution I knew I can use struts hidden tag. But using that tag will not change the result URL. I want the URL parameter passed to java action, as well as change the URL result.
If I using s:url tag, it need to know the value beforehand (is it?).
<s:url id="xyzUrl" action="xyz" includeContext="false"><s:param name="user" value="george"/></s:url>
If using s:url
tag, how can I pass dynamic value given by url parameter(in url browser) to the value argument of struts url tag? And can this solution resolve both of view mode(display page in the first time) and submit mode(submit the displayed page)?