aspose file tools*
The moose likes JSP and the fly likes JspParseException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JspParseException" Watch "JspParseException" New topic
Author

JspParseException

shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,

I am working on JSP with Apache server
My files are under c:\oracle\apache\apache\htdocs
All my individual jsp files are working fine.
There is one bean I have defined in the same directory and I use this bean in a jsp file
I have included
<jsp:usebean>
But I get the following error:
oracle.jsp.parse.JspParseException: Line # 2, Error: Unable to find class for bean: takeOrderBean defined by tag with class: htdocs.TakeOrderBean
I have the TakeOrderBean.java in the same directory and I am able to compile it independently to TakeOrderBean.class.
There was a similar example in the book Professional Java Server Programming J2EE ed.
They also have an XML descriptor file -- is it necessary to have that? What purpose does it serve?


Regards,<BR>Shree
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
<jsp:usebean>
But I get the following error:

That must be <jsp:useBean>, with an upper case B.
regds.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,
I guess I should have given the whole thing -- I tried to make it short and missed the syntax nuance:
Here is the syntax I used for using the bean:
<jsp:useBean id="takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>
Am I missing out something? Right now, I am reading about Web deployment and packaging -- but I really don't know if I 'have' to do that. I am just trying out a simple appln.
[ April 10, 2002: Message edited by: shree vijay ]
brunda
Greenhorn

Joined: Apr 10, 2002
Posts: 3
I guess I should have given the whole thing -- I tried to make it short and missed the syntax nuance:
Here is the syntax I used for using the bean:
<jsp:useBean id="takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>
Am I missing out something? Right now, I am reading about Web deployment and packaging -- but I really don't know if I 'have' to do that. I am just trying out a simple appln.
[ April 10, 2002: Message edited by: shree vijay ]
--------------------
TRy this
<%@ page language="java" import="beans.databeans.*"%>
<jsp:useBean id="beans.databeans.takeOrderBean" scope="session" class="htdocs.TakeOrderBean" />
<jsp:setProperty name="takeOrderBean" property="*"/>

I had the same problems as soon as gave the path where the bean was residing , it worked.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
A lot of annoying and mysterious problems can be avoided if you go ahead and make your application a "web application" with an entry in web.xml, etc etc. and with your classes in a package.
Bill
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi,
I have tried to put the whole thing as an appln.
MY application is ordapp under

c:\oracle\apache\apache\htdocs
The hierarchy is
ordapp (contains)
1 *.html
2 *.jsp
3 web-inf (contains)
1 web.xml
2 classes (contains)
TakeOrderBean.java
TakeOrderBean.class
my web.xml file is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<welcome-file-list>
<welcome-file>submitorder.html</welcome-file>
</welcome-file-list>
</web-app>

Still it doesn't work. I also saw that there is a file called server.xml. Is that essential?
TIA
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

.....class="htdocs.TakeOrderBean" ......
[ snip ]
2 classes (contains)
TakeOrderBean.java
TakeOrderBean.class
[ snip ]
Still it doesn't work. I also saw that there is a file called server.xml. Is that essential?

Ofcourse it still doesn't work.
I hate to say this but it is very clear to me that you are second guessing what works and what doesn't. Please take some time. Read a tutorial or two and see how it all fits together. You could have done all this if you din't waster your time guessing....pssttt! Sorry.
When you lean something, do it the right way, don't guess. It will not take you very far, if you do.
For what its worth..........
- madhav
shree vijay
Ranch Hand

Joined: Sep 18, 2000
Posts: 208
Hi Madhav,
I think what your are referring to is that
TakeOrderBean is under the directory classes and therefore htdocs.TakeOrderBean is an error.
I should admit my error. In fact, I found out that soon after I posted and corrected and of course "still it doesn't work"
But regarding your opinion
I hate to say this but it is very clear to me that you are second guessing what works and what doesn't. Please take some time. Read a tutorial or two and see how it all fits together. You could have done all this if you din't waster your time guessing....

I think you would accept that there are as many ways of learning as there are people.
There are people who go through the whole set of facts , and then only try the basic things.
I have tried this approach and it doesn't work for me. I feel that I get mired in too much text and theory. You take a book, and there are all the details of all methods in a class, what they do ... on... and on...
I prefer the 'incremental approach', I guess especially with programming -- I try to decide the basic thing I want to do, search out the commands for that, try it out and then improve upon the basic thing with additional code -- and so forth -- as far as learning personally. That the basic structure works gives me added incentive to learn more and dig in.
I would like to state that I appreciate your opinion and of course, I will have to dig in more into this stuff. Thanks, of course.
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
I believe you said you are using an web application called ordapp. I believe you should have defined a sub-directory in your Web-Inf\classes directory, this is where you should place you bean.
i.e.
\Web-Inf\classes\htdocs\TakeOrderBean.class
What do you think.
Craig
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JspParseException