为什么我的servlet部署到weblogic后不能打开?(200分)

  • 主题发起人 主题发起人 panwen
  • 开始时间 开始时间
P

panwen

Unregistered / Unconfirmed
GUEST, unregistred user!
我用JBuilder9建立了一个web应用程序,再建一个servlet,所有代码都是JBuilder自动生成的,然后就将这个应用程序部署到weblogic上,可是在ie中打开这个servlet时却总是出现错误:
“Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.”
 
把你的代码和web.xml文件 给我看看
我在jbuilder下试了一下 是可以的
testServlet.java 代码如下 :
package dzsb.web.user;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
/**
* <p>Title: dzsb</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: sun</p>
* @author michael.sun
* @version 1.0
*/
public class testServlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html;
charset=GBK";
//Initialize global variables
public void init() throws ServletException {
}
//Process the HTTP Get request
public voiddo
Get(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>testServlet</title></head>");
out.println("<body bgcolor=/"#ffffff/">");
out.println("<p>The servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
}
//Process the HTTP Post request
public voiddo
Post(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>testServlet</title></head>");
out.println("<body bgcolor=/"#ffffff/">");
out.println("<p>The servlet has received a POST. This is the reply.</p>");
out.println("</body></html>");
}
//Clean up resources
public void destroy() {
}
}
web.xml文件如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>testservlet</servlet-name>
<servlet-class>dzsb.web.user.testServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testservlet</servlet-name>
<url-pattern>/testservlet</url-pattern>
</servlet-mapping>
</web-app>
 
呵呵,我已经解决了,可能室我的JBuilder的问题,不过还是要谢谢你!
 
后退
顶部