首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

帮忙。如何跳转不过去

2013-09-11 
帮忙。。。。。怎么跳转不过去啊%@pagecontentType text/htmlcharsetgb2312 language java import j

帮忙。。。。。怎么跳转不过去啊
<%@page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<jsp:useBean   id= "feng "   scope= "page "   class= "feng.Jdbc "   />

<%
  String   User_Name=request.getParameter( "username ");
  String   Pass_Word=request.getParameter( "password ");
    if   ((User_Name.equals( " "))   ||   (Pass_Word.equals( " ")))
          response.sendRedirect( "err.jsp?id=1 ");
    else
    {
     
        Connection   con=feng.getConn();
        Statement     stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
        ResultSet     rs=null;
        String   sql= "Select   *   From   admin   Where   username= ' "+User_Name+ " '   And   password= ' "+Pass_Word+ " ' ";
        rs=stmt.executeQuery(sql);
        rs.last();
  if   (rs.getRow()> 0)
{
session.putValue( "UserName ",User_Name);
  if   (rs.getInt( "qx ")==1)   {
session.putValue( "admin ", "ok ");

///response.sendRedirect( "admin.jsp ");
          %>
<jsp:forward   page= "admin.jsp "/>
<%
}
else   {
response.sendRedirect( "info.jsp?id= "+User_Name);

}
//   <a   href= "javascript:history.go(-1) "> </a>
 
        }
else   {
                response.sendRedirect( "err.jsp?id=2 ");
                }
  try   {  
                            rs.close();
                            stmt.close();
                            con.close();
                        }
                        catch   (Exception   ex)   {
                        System.out.println(ex);
                        ex.printStackTrace();
                        }

    }
%>


跳转就出错
description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP



No   Java   compiler   was   found   to   compile   the   generated   source   for   the   JSP.  
This   can   usually   be   solved   by   copying   manually   $JAVA_HOME/lib/tools.jar   from   the   JDK  
to   the   common/lib   directory   of   the   Tomcat   server,   followed   by   a   Tomcat   restart.  
If   using   an   alternate   Java   compiler,   please   check   its   installation   and   access   path.

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Tomcat   logs.


[解决办法]
抛出的异常已经很清楚了 是tools.jar文件的缘故 解决办法也提示的很清楚 就是把你安装的jdk下的lib/tools.jar 文件拷贝到tomcat下的common/lib文件夹下即可

出现这个异常的原因估计是你的jdk版本和tomcat需求版本不一样 照上面的方法解决应该可以的
但最好是下载与你使用的tomcat匹配的jdk
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.myexception.cn/j2ee/2308.html

热点排行