JSP筆記

王明輝發表於2017-09-26

JSP連結區分大小寫

如果在eclipse專案中改了檔名,要在tomcat對應目錄下的Catalina中的對應目錄下把之前的檔案刪除,會重新編譯生成,否則會報:java.lang.NoClassDefFoundError: 這個錯誤。必須要刪除,只是修改檔名或者在java檔案中修改類名,沒有作用。


<Context path="" docBase="D:\eclipseWorkspace\MentalArithmetic\WebContent" debug="0" privileged="true">
</Context>

If you spell the class name wrong or the class isn't on the classpath, the JSP processor will say it "resolves to a package" rather than that it doesn't exist. This was driving me crazy today as I kept not seeing a typo I'd made.

JSP頁面中,隨便寫個匯入類的語句,如<%@ page import="a.b.c"%>,就會報下面這個錯
Only a type can be imported. a.b.c resolves to a package
無論a.b.c是否真的存在,這說明系統沒有找到a.b.c這個類,那麼問題就集中在“如何讓系統找到自定義的類”。

微軟真的很偉大

null是基本型別,java的幾個基本型別如下:
Literal:
IntegerLiteral
FloatingPointLiteral
BooleanLiteral
CharacterLiteral
StringLiteral
NullLiteral
對於這些型別的比較,要用==,其它的用equals
.net中的字串比較可以使用==,應該是微軟做的語法糖。

 

相關文章