<%String classon=text.dealNull(request.getParameter("classon"),"0");
request.getSession().setAttribute("classon",classon);
%>
<s:set name="myValue" value="#session.classon" />
<s:iterator value="#session.listA" status="courseType" >
<li id="<s:property value="mainid" />" <s:if test="%{#courseType.index==#myValue}"> class="on" </s:if>
>
<a href="javascript:gotoson('<s:property value="mainid" />','<s:property value="#courseType.index" />');">
<s:property value="name" /></a></li>
</s:iterator>
如果是request接收过来的
<%String cmid=text.dealNull(request.getParameter("coursecontentID"),"");
//out.print(cmid);
request.setAttribute("cmid",cmid);
%>
<s:set name="cmid" value="#request.cmid" />
<select id="contentID" name="coursecontentID" οnchange="selectzj()">
<s:if test="#request.CourseContents[0] != null">
<s:iterator value="#request['CourseContents']" status="cct" id="content">
<option value="<s:property value="mainid" />" <s:if test="%{#content.mainid==#cmid}"> selected="selected" </s:if> ><s:property value="lessonName" escape='false' /></option>
</s:iterator>
</s:if>
这样就行了