项目正常部署,后台不报错,但是所有的页面都访问不了,我自己写的过滤器都没有拦截
是项目外的配置出问题了吗,
ps:项目原来是没有错的
可以把问题描述的具体点,404是资源未找到的意思,原因有很多,比如地址错误等。
有可能你的eclipse不是直接用的你安装的tomcat,你可以看到你部署且正常运行的工程并没有出现在tomcat目录下的APP,也就是说你项目启动用的是
你eclipse Package Explorer中显示的 Servers。你可以设置一下,具体参见如下方法:
http://blog.csdn.net/lucklq/article/details/7621807
关键点如下图所示
说一下大体上的可以原因吧,如果都不是,我也就不知道了。。
用的是eclipse,右键项目选择properties看看这里项目的访问名称:
如果是myeclipse,右键项目选择properties看看这里项目的访问名称:
还有就是看一下项目启动时,控制台输出的端口号是什么
然后就是web工程下如果是WEB-INF下的页面是无法直接访问的,需要通过后台程序的跳转。
再然后看看web.xml文件中配置的欢迎页面有没有。
废话说完了,管不管用的吧,就想到这么多
404未找到资源,是不是没把项目加进去,你看下 service.xml Context docBase的配置。
这是web.xml配置文件
CitySessionTimeOutFilter
com.guoxin.listener.MockCitySessionTimeOutFilter
CitySessionTimeOutFilter
*.jsf
login.jsf
这是我写的类
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterchain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpSession session = httpRequest.getSession(true);
System.out.println("===========this is login=============");
CityOperLoginBean operBean = (CityOperLoginBean) session
.getAttribute("CityOperLoginBean");
if (operBean == null) {
operBean = new CityOperLoginBean();
session.setAttribute("CityOperLoginBean", operBean);
}
operBean.setUser_id("123456");
operBean.setUser_name("wuwenyao");
filterchain.doFilter(request, response);
}
前台一直报404
后台什么反应都没有

应该是工程的配置存在问题,可以检查一下是否是web.xml中存在问题 可以将配置先删除,再尝试是否能显示index.jsp,应该可以显示,在逐步排除xml文件的具体问题
把具体信息贴出来看看