Search code examples
jspstruts-1

How to set value of hidden tag


I am using <html:hidden styleId="user" property="issueBranch" value='' /> For value of <html:hidden> i want to set value that i am getting from <bean:write name="sessionData" property="userId"/> How to do this?


Solution

  • Use

    <html:hidden styleId="user" property="issueBranch"/>
    

    and in the action which dispatches to the JSP, set the form bean's issueBranch property to what you want:

    myActionForm.setIssueBranch(sessionData.getUserId());