2012-06-27 2 views
0

나는 장애인 동적으로 활성화 <select> 옵션 /를 얻으려면JSTL에서 동적으로 HTML을 사용하지 않도록 설정하려면 <select>?

<select id="_${sec_field}_id" name="${sec_field}" multiple="${multiple}" "${(empty disabled) ? 'disabled' : ' '}" > 

를 사용하려고

그러나 이클립스는 경고를 줘 :

Multiple annotations found at this line: 
- Element type "select" must be followed by either attribute specifications, ">" or "/>". 
- Attribute """ has no value 

그래서 우리가 해결할 수있는 솔루션이에게 JSTL에서 html <select>의 사용 중지?

미리 감사드립니다.

답변

4

disabled 속성 이름을 인쇄하는 EL 표현식 주위의 이중 따옴표를 제거하십시오. 큰 따옴표는 (= 이후의 부분) 만 주위에 배치해야합니다.

<select ... ${empty disabled ? 'disabled' : ''}> 

그렇지 않으면 당신은

<select ... ""> 

또는 구문 잘못

<select ... "disabled"> 

와 끝까지.

+0

위대한 답변, 감사합니다. – Dreamer