Why not find the java Bean?

Category: Web Develop
 
zhaoshihong111
2012-04-18 01:13:59

Sponsored Links
I'm just learning jsp, system Windows xp, jdk1.3, TOMCAT; environment has been configured.
Write a simple jsp pages and java Bean, put them in the same a directory, when browsing with IE error: Can not find java Bean! Is this why?
Thank you!
greatly appreciated!

Sponsored Links

mashch
2012-04-18 01:16:25
javaBean should be placed in WEB-INF \ classes below, and the directory structure and package structure should be consistent
hanshan1304
2012-04-18 01:22:38
I did as you said, it can be or not, and why?
grateful! ! !
jean1341111
2012-04-18 01:26:14
path settings of your service is valid, preferably directly in the webapps build their own applications, while, if the tomcat, it is best to hit your java bean bag, or if tomcat does not recognize, in the beginning of your bean file add: package mybean;
then built in a mybean in classes directory, recompile your class into them, modify jsp references, use mybean. you have the class name to take.
coolffeng
2012-04-18 01:41:31
You should be on the path of the web structure is unclear
assume you on such a
root
test.jsp (a jsp file, which calls a bean)
src
com
MytestBean.java
this time, you have to MytestBean.java preceded by package com;
then compile the java files obtain a class file, this file into
web-inf
classes
; com in this directory
bean in classpath test.jsp on this: com.MytestBean, so try to find a
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.