description The server encountered an internal error () that prevented it from fulfilling this request
这句大概的是说你的文件也就是你的程序出现了内部的错误了
java.lang.ClassNotFoundException: bean.samplebean
这个好象就是说你的BEAN写的可能有错误了这种错误报的很多了,一般的就是你的页面上自己粗心出现的错误了,仔细点
应该没有问题的了

解决方案 »

  1.   

    sample1.jsp内容:<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"' target="_blank" >http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>sample1</title>
    </head>
    <jsp:useBean id="samplebeanId" scope="session" class="bean.samplebean"/>
    <jsp:setProperty name="samplebeanId" property="*"/>
    <body>
    <h1> A JSP  & Bean Sample</h1>
    <form method="post">
    <br>Enter new value:<input name="sample"><br>
    <br><br>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" value="Reset">
    <br>
    Value of Bean property is:<jsp:getProperty name="samplebeanId" property="sample"/>
    </form>
    </body>
    </html>----------------------------------------------------------------------samplebean.class在文件夹bean下,samplebean.java的内容:package bean;
    public class samplebean{
        private String sample="start value";
        public String getSample(){
            return sample;
        }
        public void setSample(String newValue){
            if(newValue!=null){
                sample=newValue;
            }
        }
    }
    我看了半天没看出来有什么错误,谁能帮忙指点下!!!谢谢
      

  2.   

    先要做一个servlet,在转到JSP之前serAttribute一下才能找到,还有把scope改成request
      

  3.   

    package Sampleservlet;import java.io.IOException;import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;public class servlet extends HttpServlet { protected void doPost(
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException { samplebean bean = new samplebean();
                      bean.sample = "That`s ok";
    //****************************************************************************
                      //如果jsp上写的是scope="request",那么就用这段
             request.setAttribute("samplebeanId", bean);
    //****************************************************************************
                      //如果jsp上写的是scope="session",那么就用这段
    HttpSession s = request.getSession();
    s.setAttribute("samplebeanId", bean);
    //****************************************************************************
    request.getRequestDispatcher("/sample1.jsp").forward(request,response);
    }
    }