就是这点代码,我要跳转到AdminIndex.jsp,可是总跳不过去,是404错误
<%
String action=request.getParameter("action");
if(action!=null&&action.equals("check"))
{
String username=request.getParameter("username");
String password=request.getParameter("password");
if(!"admin".equals(username))
{
out.println("用户名不对");
return ;
}
else if(!"admin".equals(password))
{
out.println("密码不对");
return ;
}
session.setAttribute("admin","admin");
response.sendRedirect("admin/AdminIndex.jsp");
}
%>
把错误贴一下
HTTP Status 404 - /Shopping1/admin/AdminIndex.jsp--------------------------------------------------------------------------------type Status reportmessage /Shopping1/admin/AdminIndex.jspdescription The requested resource (/Shopping1/admin/AdminIndex.jsp) is not available
不理解的是这个路径明明是对的,为什么还说是404找不到啊
我的项目就是Shopping1,然后里面有个folder是admin,admin里面也有这个AdminIndex.jsp文件啊
就教指点!
<%
String action=request.getParameter("action");
if(action!=null&&action.equals("check"))
{
String username=request.getParameter("username");
String password=request.getParameter("password");
if(!"admin".equals(username))
{
out.println("用户名不对");
return ;
}
else if(!"admin".equals(password))
{
out.println("密码不对");
return ;
}
session.setAttribute("admin","admin");
response.sendRedirect("admin/AdminIndex.jsp");
}
%>
把错误贴一下
HTTP Status 404 - /Shopping1/admin/AdminIndex.jsp--------------------------------------------------------------------------------type Status reportmessage /Shopping1/admin/AdminIndex.jspdescription The requested resource (/Shopping1/admin/AdminIndex.jsp) is not available
不理解的是这个路径明明是对的,为什么还说是404找不到啊
我的项目就是Shopping1,然后里面有个folder是admin,admin里面也有这个AdminIndex.jsp文件啊
就教指点!
解决方案 »
- java调用dll文件
- struts2的iterator标签如何在条件成立的情况下跳出迭代
- 不能强制将List内容转换成DTO类???
- 关于webservice返回Documnet对象报空指针异常的问题
- 菜鸟问题,多谢指点
- jsp通过jdbc连接SQLServer2000报错:Unsupported VM encoding MS936
- 在IE中 错误'ScreenSize' 未定义 腾讯TT中 错误'main_height' 未定义 怎么解决啊 是不是浏览器有问题啊
- 给大家解决问题!
- 用xmlhttp往servlet中post的时候总出现“没有权限”的错误。
- 新手入门,帮帮忙?
- 在struts1中怎么获取request和response.
- xml求解
不行就
request.getRequestDispatcher("/admin/AdminIndex.jsp").forward(request,response);再试一下
如果一切还不可以 就检查一下你的环境吧
HTTP Status 404 - /admin/AdminIndex.jsp--------------------------------------------------------------------------------type Status reportmessage /admin/AdminIndex.jspdescription The requested resource (/admin/AdminIndex.jsp) is not available.
->
response.sendRedirect(request.getContextPath+"/admin/AdminIndex.jsp");
后面要不要第一个/,两个都试下。
很奇怪的是我在地址栏直接打http://localhost:8080/Shopping1/admin/AdminIndex.jsp
这样也出现404错误,但是
我的项目就是Shopping1,然后里面有个folder是admin,admin里面也有这个AdminIndex.jsp文件啊
怎么回事呢?
如果是改成这个名字的话,那你还是改成首先建的那个名称吧,
我做项目就出现过这样的问题啊。