當輸入localhost:8080/項目名
瀏覽器彈出不知道神馬錯誤
The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
出現這個問題百度的下說是將jstl-impl.jar包放到lib目錄下就可以解決了,
嘗試后確實可以解決問題。
然而,當我把這個jar包從我項目中刪除后再訪問又出現不一樣的報錯
java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/rt/core/SetTag
也是缺少jatl-impl.jar包但是你給我報不一樣錯誤干嘛呢
Message:The server encountered an internal error that prevented it from fulfilling this request.
大概意思是:服務器遇到內部錯誤,阻止其執行此請求。
項目中web.xml配置。只需要看<welcome-file></welcome-file>
因為是SpringMVC項目,我就想輸入網址請求時候由Controller返回頁面到瀏覽器不是更好嗎,這就不需要找jar包那么麻煩了
定義一個映射
這樣當輸入localhost:8080/項目名 ==》servletDispatcher將這個請求發送到這個方法,然后返回頁面就可以了。
@RequestMapping(value = "")
public String welcomeHandler()
{
return "WEB-INF/views/login.jsp"
}