Why always find bean? Come .....

Category: Java SE
 
lzywhx_2009
2011-03-08 04:34:23

Sponsored Links
Environment:
tomcat + win2000 + ultraedit
------------------
tomcat's server.xml configuration
; <! - Tomcat Root Context ->
<Context path = "" docBase = "D: \ jspApp" debug = " ; 0 "privileged =" true "/>
--------------------
showbean.jsp:
.......
<jsp:useBean id = "dialog" class = "mybean.Bean1"/>
.... .
------------------------
will mybean folder (which contains Bean1.class) test to: d : \ jspapp
---------------------------
Click showbean.jsp
appear:
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 9 in the jsp ; file: / showbean.jsp

Generated servlet error:
E: \ Apache Tomcat 4.0 \ work \ localhost \ _ \ showbean $ jsp.java: 60: Can not find class mybean.Bean1.
mybean.Bean1 dialog = null;
^

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

Generated servlet error:
E: \ Apache Tomcat 4.0 \ work \ localhost \ _ \ showbean $ jsp.java: 63: can not find class mybean.Bean1.
dialog = (mybean . Bean1)
; ^

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

Generated servlet error:
E: \ Apache Tomcat 4.0 \ work \ localhost \ _ \ showbean $ jsp . java: 68: can not find class mybean.Bean1.
dialog = (mybean.Bean1) java.beans.Beans.instantiate (this.getClass (). getClassLoader (), "mybean.Bean1");
whether path problem ^


Sponsored Links

fulinlong
2011-03-08 04:43:15
just a typo, should be in the d: \ jspapp to build a WEB-INF directory, and then build a classes directory, then mybean catalog copy into
tiancong2
2011-03-08 04:50:05
changed after Again mhow said, to build a WEB-INF directory.
ifullmoon
2011-03-08 05:09:10
<jsp:useBean id = "dialog" class = "mybean.Bean1"/>

This has been defined BEAN, the direct use of dialog can be
supernovastudios
2011-03-08 05:15:05
Please zhipop (J2EEfans) on to explain that I did not quite understand
mybean.Bean1 dialog = null
chsh_f
2011-03-08 05:30:12
do this directly with the dialog on the line!
szhunsha80
2011-03-08 05:42:56
tomcat's server.xml configuration should be changed, but not like you so changed.
change the law as follows:
original:
<! - Define the default virtual host ->
<Host name = " ; localhost "debug =" 0 "appBase =" webapps "unpackWARs =" true ">
changed:
<Host name =" localhost " debug = "0" appBase = "D: \ jspApp" unpackWARs = "true">
lsrm31
2011-03-08 05:58:39
skyyoung (type handsome bargain Full English passerby) brother Taiwan Brother E text is not very strong, you mean my classpath set Debu right. Can specific about it
libing8799
2011-03-08 06:10:33
to MagicFan (I love Yang Guo)
rehabilitated or not it

to skyyoung (type handsome bargain Full English passerby)
set classpath = d: \ jspapp also find package
lxuan1978
2011-03-08 06:18:03
in d: \ jspapp following the construction of a directory called classes, and then copy the entire folder into mybean .
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.