2014-12-28 2 views
0

특정 시나리오가 있습니다. 내 JSP로, 나는 다음과 같은 구조의 태그가 - 특정 시나리오의 드롭 다운에서 값을 선택할 수 없습니다.

<c:choose> 
    <c:when test="${some_condition}"> 
     <dsp:select id="myId" bean="MyBean.property1"> 
      <dsp:option></option> 
      .... 
     </dsp:select> 
    </c:when> 
    <c:otherwise> 
     <dsp:select id="myId" bean="MyBean.property2"> 
      <dsp:option></option> 
      .... 
     </dsp:select> 
    </c:otherwise> 
</c:choose> 

내가 처음으로 페이지를 방문

은 조건 'some_condition이'사실 말을 나는이 드롭 다운 목록에서 값을 선택합니다. 이 값은 양식 제출시 서버로 전달됩니다. 이제 같은 페이지로 이동하면이 섹션의 드롭 다운이로드됩니다.이 드롭 다운에서 옵션을 선택하면 서버로 전달되지 않습니다.

답변

0

변경 MyBean.property1

<c:choose> 
<c:when test="${some_condition}"> 
    <dsp:select id="myId" bean="MyBean.property1"> 
     <dsp:option></option> 
     .... 
    </dsp:select> 
</c:when> 
<c:otherwise> 
    <dsp:select id="myId" bean="MyBean.property1"> 
     <dsp:option></option> 
     .... 
    </dsp:select> 
</c:otherwise> 

<c:otherwise>에서 <dsp:select> 태그의 bean 속성
관련 문제