您的位置:首页 > 编程语言 > Java开发

eclipse 转换过来的web项目直接访问工程名包404

2014-04-10 15:02 288 查看
这个问题很简单,但是防止以后忘记还是做下记录,

这个工程是从别的地方过来的,刚开始不是web工程,经过转换后(怎么转换就不做介绍),发现web.xml里面

加上了

<welcome-file-list>

<welcome-file>/index.jsp</welcome-file>

</welcome-file-list>

无效,原因是缺少index.jsp,于是加入这个jsp页面就行了,我这里加上index.jsp后然后又进行了一个跳转

如下

<%@ page language="java" contentType="text/html; charset=UTF-8"

pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<%

String basePath = request.getContextPath();

%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>

</head>

<body onload="forwardAction()">

</body>

<script type="text/javascript">

function forwardAction(){

window.location.href = xxxxxxxx;

}

</script>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: