Search code examples
javajspstruts2url-parametersognl

Unable to use hidden field value in JSP


I have a hidden field whose value I want to send to my action, but it always sends null.

<s:hidden property="SystemId" name="SystemId" id="SystemId" value="1"/>

I am calling the action like this

<s:url  id="papa" value="Alertpup?ET_ID=%{ID}&ET_BUSID=%{SystemId}"></s:url>
<s:a href="%{papa}"><s:property value="ID" /></s:a>

But my ET_BUSID field in from bean will be null.


Solution

  • Instead of hidden try with

    <s:set name="SystemId" value="1"/>
    <s:url  id="papa" value="Alertpup?ET_ID=%{ID}&ET_BUSID=%{#SystemId}"/>