Forums Register Login

Calling a Java Bean from JSP Problem

+Pie Number of slices to send: Send
This is my first attempt at trying to call a java bean
from a jsp.
<jsp:useBean id="Books" class="BookStore" scope="page" />
Both .jsp and .class are in the same directory.
Every time I attempt to invoke my jsp, the error message
BookStore.class not found appears.

Can anybody shine some light on this problem?
(Currently using Tomcat).
+Pie Number of slices to send: Send
I don't pretend to solve you problem, but in your case, the JSP and .class file may have to be in different specific DIRs dictated by your configuration.
And if your *.class files and *.jsp files are in the same DIR, that tells me that that may be the problem.
Usually a Web application requires that the JSPs and the .class files be in *different* DIRs.
At least with out of the box configurations.
Your mileage may vary!
+Pie Number of slices to send: Send
Make sure that your bean does not belong to any package.
And can you let us know what was the way you invoked your bean?
+Pie Number of slices to send: Send
With Tomcat, .jsp files go with the normal HTML files, while class files go is a separate directory.
Assuming you have not created a specific application and are using ROOT for your HTML and JSP files, classes go in
/tomcat/webapps/ROOT/WEB-INF/classes
Tomcat uses the Sun J2EE scheme of organizing web applications see the Java servlet 2.2 API for details. It is laid out in great detail there.
+Pie Number of slices to send: Send
If u r using IIS and ServletExec then u need to place the class file of ur bean in C:/Program Files/New Atlanta/ServletExec API/classes directory.Also Do not forget to replicate the package structure for the class in above directory..
I think this should solve ur problem since i just now faced the same problem.
Police line, do not cross. Well, this tiny ad can go through:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 789 times.
Similar Threads
Where to put .jsp and class file in websphere
Error : class not found while running jsp
Error in jsp on instanciating a java class
Assigining java variable to java script variable
JSP and class diagram
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:11:16.