關閉→
當前位置:知科普>IT科技>multipleannotationsfoundatthisline怎麼解決 - jsp

multipleannotationsfoundatthisline怎麼解決 - jsp

知科普 人氣:1.23W

index.jsp頁面中出現:Multiple annotations found at this line,是設置錯誤造成的,解決方法如下: 1、首先項目右鍵,點擊build path。 2、然後選擇configure build path選項進入下一步。 3、接着在configure build path界面下找到,java buil

有的用户在創建JSP的時候出現了Multiple annotations found at this line,不清楚該如何解決,下面就告訴大家一個解決方法。

材料/工具

JSP電腦

方法

首先找到“Acsb”。

常見錯誤一 文件名與類名不同,不如我們的文件名為“A.java”。而我們編寫程序的時候卻寫成了 public class a{ …… } 常見錯誤二 主方法中缺少關鍵詞。比如void(無返回值)關鍵字,我們在編寫程序的時候一定要注意,主方法一定不鞥少了這個關鍵字

jsp:multipleannotationsfoundatthisline怎麼解決

然後右鍵,再點擊“build path”,選擇“configure build path”選項。

window-->preference-->MyEclipse-->Valdation-->將Manual和Build下複選框全部取消選擇

jsp:multipleannotationsfoundatthisline怎麼解決 第2張

在configure build path界面下找到“java build path”項,再找到“Libraries”。

你這個變量應該是試圖從request得到,但是request對象裏沒有你説的那個變量,在jsp頁之前的servlet裏應該要有setAttribute這個方法,把你想要獲得的變量名稱和值添加進去 request.setAttribute("name",value); value可以是任何對象。也有可能一

jsp:multipleannotationsfoundatthisline怎麼解決 第3張

然後在“Libraries”選項下的“Add Library”。

為避免頁面亂碼,charset你直接用户utf-8就可以了: 和你的開發工具設置的要一致

jsp:multipleannotationsfoundatthisline怎麼解決 第4張

在“Add Library”下找到“server Runtime ”然後點擊“next”,

你union的兩個select語句裏的字段要一致,就是後面的select 0,MonthName也要select 0 as sumje,MonthName as xsmonth

jsp:multipleannotationsfoundatthisline怎麼解決 第5張

在“server Runtime”下,選擇你的服務器,然後點擊“finish”,錯誤就沒有了。

可以將代碼中的 換成${pageContext.request.contextPath} like this

jsp:multipleannotationsfoundatthisline怎麼解決 第6張

擴展閲讀,以下內容您可能還感興趣。

JSP運行出錯Multiple annotations found at this line:

你union的兩個select語句裏的字段要一致,就是後面的select 0,MonthName也要select 0 as sumje,MonthName as xsmonth

jsp頁面為什麼會顯示Multiple annotations found at this line:的錯誤

出現了非法的標點符號導致語法錯誤,

jsp: Multiple annotations found at this line:- basePath cannot be resolved to a variable-basePath

可以將代碼中的<%=basePath%>

換成${pageContext.request.contextPath}

like this

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.js"></script>

JSP運行出錯Multiple annotations found at this line:

你union的兩個select語句裏的字段要一致,就是後面的select 0,MonthName也要select 0 as sumje,MonthName as xsmonth

jsp頁面為什麼會顯示Multiple annotations found at this line:的錯誤

出現了非法的標點符號導致語法錯誤,

TAG標籤:#JSP #