入门jsp报Unable to compile class for JSP错,救助

问题描述

各位高手好,小弟在入门jsp入到错误提示,请帮帮忙,谢谢。如下SayHelloBean.html编码放置在D:apache-tomcat-8webappstesttestbean下<html><head><title>数据输入</title><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><bodybgcolor="#FFFFFF"><divalign="center"><p>请输入数据</p><formmethod="post"action="SayHelloBean.jsp"><p>姓名<inputtype="text"name="name">性别<selectname="sex"><optionvalue="先生">先生</option><optionvalue="女士">女士</option></select></p><p><inputtype="submit"name="Submit"value="提交"></p></form><p>&nbsp;</p><p>&nbsp;</p></div></body></html>SayHelloBean.jsp编码放置在D:apache-tomcat-8webappstesttestbean下<%@pagelanguage="java"import="bean.HelloBean;"%><%@pagecontentType="text/html;charset=gb2312"%><%--先将传过来的request中的字符编码格式设置成gbk,再取内容--%><%request.setCharacterEncoding("gbk");%><html><head><title>HelloBean</title><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><bodybgcolor="#FFFFFF"><p>&nbsp;</p><palign="center">欢迎</p></body></html>我的编译好的HelloBean.class放在D:apache-tomcat-8webappstestWEB-INFclassesbean下,工程目录为D:apache-tomcat-8webappstestpackagebean;publicclassHelloBean{privateStringname="";privateStringsex="";publicHelloBean(){}publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicStringgetSex(){returnsex;}publicvoidsetSex(Stringsex){this.sex=sex;}}当jsp编码中添加了<%@pagelanguage="java"import="bean.HelloBean;"%>就出现提示错误UnabletocompileclassforJSP。请给位帮帮忙看一下,谢谢

解决方案

解决方案二:
classpath路径:.;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar;D:java;JAVA_HOME:C:jdk1.7运行其他jsp没有问题。例如<html><head><title>Hello</title><body><%out.println("HelloWorld!");%></body></head></html>这个没有问题。
解决方案三:
<%@pagelanguage="java"import="bean.HelloBean"%>

时间: 2024-10-29 22:41:21

入门jsp报Unable to compile class for JSP错,救助的相关文章

Unable to compile class for JSP 装饰器

装饰器装饰了目标页INDEX.JSP后.突然 报Unable to compile class for JSP错误,删除了 <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> 后正常了.

jsp-新手求教,总是出现“Unable to compile class for JSP:”

问题描述 新手求教,总是出现"Unable to compile class for JSP:" 解决方案 报了三个这样相同的错误,其他的没问题. 解决方案二: ?近来用到tomcat,在发布项目是,碰到这样一个问题:org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 23 in the generated java file The method

jsp-HTTP Status 500 - Unable to compile class for JSP

问题描述 HTTP Status 500 - Unable to compile class for JSP 求大牛求解!新手不了解 j点击Jsp页面出现的错误 type Exception report message Unable to compile class for JSP description The server encountered an internal error that prevented it from fulfilling this request. except

Unable to compile class for JSP

问题描述 Anerroroccurredatline:163inthejspfile:/WEB-INF/jsp/sys/Menu.jspThemethodsetTest(boolean)inthetypeIfTagisnotapplicableforthearguments(String)160:<c:forEachitems="${buttonList}"var="buttonList">161:<c:iftest="${buttonL

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

问题描述 <%@pagelanguage="java"import="java.util.*"pageEncoding="GB2312"%><%@pageimport="com.wh.communicationsystem.DAO.*"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+":

Unable to compile class for JSP问题

问题描述 <%@pagelanguage="java"import="java.io.File"%><%@pagelanguage="java"import="java.io.*"%><%@pagelanguage="java"import="jxl.read.biff.*"%><%@pagelanguage="java"im

tomcat-Unable to compile class for JSP

问题描述 Unable to compile class for JSP 2C HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to com

javaweb-struts报Unable to load configuration. - action

问题描述 struts报Unable to load configuration. - action web.xml文件内容: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"

javaweb-HTTP Status 500 - Unable to load class for JSP

问题描述 HTTP Status 500 - Unable to load class for JSP <%@ page contentType="text/html pageEncoding="GBK"%> <%@ page import="java.io.*"%> <%@ page import="java.util.*"%> <%@ page import="java.math.