一百三十分求解!新手的第一个问题,到{未知的jsp的bean调用错误}中领30分
web服务器resin
源文件toservlet.jsp 放在doc目录下
<html>
<head>
<title>From JSP to Servlet</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<jsp:forward page="/servlet/toJSP"/>
</body>
</html>
源文件toJSP.java 放在doc/WEB-INF/classes下
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class toJSP extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
{
try
{
request.setAttribute("comefrom","Servlet");
getServletConfig().getServletContext().getRequestDispatcher(
"/cw/stj.jsp").forward(request,response);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
\源文件stj.jsp 放在doc/cw/下
<html>
<body bgcolor="white">
<h1>
This page is redir from:
<% out.print(request.getAttribute("comefrom").toString());%>
</h1>
</body>
</html>
运行出错 向各位请教