2014-01-08 33 views
0

當我在Netbeans IDE中使用下面的代碼時,我在Netbeans中收到錯誤指示。但代碼工作正常。任何人都可以告訴我爲什麼我在Netbeans中收到錯誤警告。是一個用於此顯示netbeans中的struts2選擇錯誤

list="#{'01':'Jan', '02':'Feb'}"

<s:select label="Months" 
     name="months" 
     headerKey="-1" headerValue="Select Month" 
     list="#{'01':'Jan', '02':'Feb'}" 
     value="selectedMonth" 
     required="true" 
/> 

下面

Encountered ":" at line 1, column 7. 
Was expecting one of: 
    "}" ... 
    "." ... 
    "[" ... 
    ">" ... 
    "gt" ... 
    "<" ..... 
+0

這可能是NetBeans的問題 – xrcwrn

+0

沒有當我在MyEclipse中嘗試過我」米得到同樣的東西.....我認爲所以它可能會發生時遇到#字符.......有沒有解決方案 – user3159579

+0

我使用netbeans7.4它顯示上述類型的錯誤指示代碼但沒有運行錯誤 – xrcwrn

回答

0

錯誤指示消息中給出的Netbeans 7使用JSP EL 2.1現在使用#字符任何溶液中的錯誤警告是。

也許在這個時候最簡單的解決方案是增加的地圖類:

#@[email protected]{ "foo" : "foo value", "bar" : "bar value" } 

看到答案:Answer