I have ShowAction java class, on success of class JSP page will be shown, that jsp page contains
<bean:define id="stateTypes" name="sessionData" property="stateTypes" />
<html:select property="issueStateCode" styleClass="smallDropInput" tabindex="5" styleId="myId">
<html:options collection="stateTypes" property="value" labelProperty="label" />
</html:select>
In my ShowAction java class I am setting values for <html:select> (JSP) like this:
sessionData.setStateTypes(TypeHelper.getTypeList(TypeHelper.TYPE_JURISDICTION,
sessionData.getCarrierId(), sessionData.getProductId()));
I want to set a particular value from list for <html:select> which gets selected or auto populated when JSP will be shown.
Got solution.
sessionData.getSession().setAttribute("issueBranch","SetValue"); //to set value that you wants to setand retrive this value in JSPand set value in JS
var val=document.getElementById('myText').value;document.getElementById('myId').value=val; // myId is styleId or id attribute for <html:select>