Thread: Where to put javabean?

1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jul 2003
Posts
17
Rep Power
0

Where to put javabean?

Hi All,

I am testing with a really simple bean and jsp page, but I can't seem to get the bean to work. I placed the class file in the following directory:
C:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes

and I get these errors:

Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\multizone_jsp.java:41: cannot resolve symbol
[javac] symbol : class MultiZoneBean
[javac] location: class org.apache.jsp.multizone_jsp
[javac] MultiZoneBean zones = null;
[javac] ^
[javac] C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\multizone_jsp.java:43: cannot resolve symbol
[javac] symbol : class MultiZoneBean
[javac] location: class org.apache.jsp.multizone_jsp
[javac] zones = (MultiZoneBean) pageContext.getAttribute("zones", PageContext.SESSION_SCOPE);

What am I doing wrong? Where else would I place the bean?

Thanks,
Julie
2. No Profile Picture
Contributing User
Devshed Regular (2000 - 2499 posts)

Join Date
Jan 2003
Location
No es importante
Posts
2,065
Rep Power
17
In the webproject create a folder called web-inf, then create a classes folder. Place the class file in that directory and see what happens.
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jul 2003
Posts
17
Rep Power
0
Hi victorpendleton,

I realized that my code probably didn't work for two reasons:

1. I didn't put the bean in a package and in a separate folder under webapps. I didn't know that I have to.

2. Tomcat was messed up. I made the above changes and it still didn't work. I tried tackling it again a few hours later and it worked! And there were no code changes, so I don't know what happened.

-julie
4. No Profile Picture
Contributing User
Devshed Regular (2000 - 2499 posts)

Join Date
Jan 2003
Location
No es importante
Posts
2,065
Rep Power
17
Good to hear. Let us know if you have any more questions.