当前位置:  技术问答>java相关

为什么会这样? Unable to compile class for JSP

    来源: 互联网  发布时间:2017-03-31

    本文导语:  jsp.jsp:     SimpleBean.java: import java.io.*;  import javax.servlet.http.HttpServletRequest;  import javax.servlet.http.HttpServletResponse;  import javax.servlet.ServletInputStream;  public class SimpleBean {  public void doUpload(HttpServletRequest reques...

jsp.jsp:

 
 

SimpleBean.java:

import java.io.*; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import javax.servlet.ServletInputStream; 

public class SimpleBean { 

public void doUpload(HttpServletRequest request) throws 
  IOException { 
PrintWriter pw = new PrintWriter( 
new BufferedWriter(new FileWriter("Demo.out"))); 
ServletInputStream in = request.getInputStream(); 
int i = in.read(); 
while (i != -1) { 
pw.print((char) i); 
i = in.read(); 

pw.close(); 
  } 


jsp放在examples/jsp下,class放在examplesWEB-INFclasses下

运行jsp出错:
An error occurred at line: 1 in the jsp file: /jsp/jsp.jsp

Generated servlet error:
D:JBuilder7jakarta-tomcat-4.0.3worklocalhostexamplesjspjsp$jsp.java:56: Class org.apache.jsp.SimpleBean not found.
                SimpleBean TheBean = null;
                ^


An error occurred at line: 1 in the jsp file: /jsp/jsp.jsp

Generated servlet error:
D:JBuilder7jakarta-tomcat-4.0.3worklocalhostexamplesjspjsp$jsp.java:59: Class org.apache.jsp.SimpleBean not found.
                    TheBean= (SimpleBean)
                              ^


An error occurred at line: 1 in the jsp file: /jsp/jsp.jsp

Generated servlet error:
D:JBuilder7jakarta-tomcat-4.0.3worklocalhostexamplesjspjsp$jsp.java:64: Class org.apache.jsp.SimpleBean not found.
                            TheBean = (SimpleBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "SimpleBean");

|
这是你的设置的问题

你可以再看看tomcat的设置

要不你要麻烦的话就用jbuilder吧

|
不能把jsp编译成class文件,用resin试试.

|
重新启动Tomcat

|
你把你的web-inf/classes加到classpath里去看一看

    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • unable to read inode block - inode
  • xhost问题,unable to open display "192.163.3.153:0.0"
  • j-tag连接时,显示unable to find target
  • 运行sipp 出现 Unable to bind main socket 错误
  • 发邮件提示SMTP Server reply:451 unable to read configuration
  • 我的系统经常报错:unable to load interpreter /lib/ld-linux.so.2
  • vnc4提示unable to connect to host:Connection refused (10061)
  • 挂载文件系统失败:VFS : unable to mount root fs on 03:01
  • vimgdb出错:unable to read from GDB pesudo tty
  • unable to connect to X Server?
  • 连接NFS服务器出错:RPC:Port mapper failure -RPC:Unable to receive
  • 重新配置内核时出现:::VFS:unable to mount root fs on
  • windows下用vmware模拟linux,点power on时提示:Unable to open kernel device "\.vmx86...
  • telnet:Unable to connect to remote host.请大家和斑竹帮忙!
  • jbuilder7突然打不开,unable to open jbuilder.congif??????????
  • 求助:已经安装了共享库,还是提示“Unable to load library”
  • 深入android Unable to resolve target 'android-XX'详解
  • kubuntu 安装 unable to find a medium containing a live file system
  • 执行apt-get,为什么输出 Unable to determine a suitable packaging system type?
  • Unable to open a initial console


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3