崩溃了,jsp部署到tomcat 出现页面空白
eclipse + jsp + tomcat5.0.25 程序在本机上运行正常,没有问题。 今天我部署到服务器就出问题了。服务器是win2003 ,我用的是tomcat5.0.25 的zip版本。我把本机的整个tomcat拷到服务器上,在浏览器里访问主页,输入用户名登陆成功后应该跳到我定义的页面home.jsp,但出现空白,我把信息输出到控制台,没有异常,显示的sql语句和结果都正确,浏览器的跳转地址也正确,但是home.jsp就是一片空白。我的程序的文件夹结构是这样的:
webapps/ContractorSystem ---- login.jsp
|----- jspPages ---- home ---- home.jsp
后来我把home.jsp换成一个html页面也不行,但把home.jsp直接放在ContractorSystem 下,即和login.jsp页面同级就可以显示。
tomcat配置应该没问题,因为我把部署前备份的程序拷回来就不出这个问题,一切正常。但新程序在我本机上也是正常。
home.jsp页面我是写在web.xml里的
web.xml 片断:
<?xml version= "1.0 " encoding= "UTF-8 "?>
<web-app version= "2.4 "
xmlns= "http://java.sun.com/xml/ns/j2ee "
xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation= "http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">
<!--Logger-->
<context-param>
<param-name> logger </param-name>
<param-value>
CONSOLE_LOGGER
</param-value>
</context-param>
<!-- Context path Prefix-->
<context-param>
<param-name> contextPathPre </param-name>
<param-value> /ContractorSystem </param-value>
</context-param>
<!-- Login Page -->
<context-param>
<param-name> loginPage </param-name>
<param-value> /ContractorSystem/login.jsp </param-value>
</context-param>
<!-- Main Page -->
<context-param>
<param-name> mainPage </param-name>
<!-- <param-value> /ContractorSystem/jspPages/report/reportindex.jsp </param-value> -->
<param-value> /ContractorSystem/jspPages/home/home.jsp </param-value>
</context-param>
程序片断:
package org.moto.servlet;
import
java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import
javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.moto.VO.User;
import org.moto.bean.UserBean;
import org.moto.config.APPLICATION;
import org.moto.exception