各位大哥门我的不行啊 我的index.jsp在WebRoot目录下 web.xml在WebRoot里面的WEB-INF目录下 而且里面有 <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> 我的项目名字叫lovingpig 我启动后输入 http://localhost:8080/lovingpig但是不行啊 有如下错误啊HTTP Status 404 - /lovingpig/--------------------------------------------------------------------------------type Status reportmessage /lovingpig/description The requested resource (/lovingpig/) is not available.
<forward name="myweb" path="/login.jsp" />
</global-forwards>
在web.xml配置文件中找到 <welcome-file-list> 这一项,添加你的欢迎页面,如
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>二:不用修改web.xml,因为一般情况下会默认欢迎页面为index.jsp
新建一个简单的JSP页面命名为 index.jsp ,里面只用写一句话
<%
response.sendRedirect(request.getContextPath()+"/login.jsp");
%>
在web.xml配置文件中找到 <welcome-file-list> 这一项,添加你的欢迎页面,如
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
我的index.jsp在WebRoot目录下
web.xml在WebRoot里面的WEB-INF目录下
而且里面有
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
我的项目名字叫lovingpig
我启动后输入
http://localhost:8080/lovingpig但是不行啊
有如下错误啊HTTP Status 404 - /lovingpig/--------------------------------------------------------------------------------type Status reportmessage /lovingpig/description The requested resource (/lovingpig/) is not available.
我的tomcat里面的server.xml中没有添加我这个项目的地址
呵呵
加了后就好了
谢谢各位了啊