Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in instantiating bean

 
jayram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello!!! i had posted this proble a month back and still to receive any reply...so reposting the same problem. I hope i would get reply this time ...

i am trying to call a bean from my jsp
the bean class is in $tomcat_home\webapps\examples\WEB-INF\classes\projsp
and the JSP is located at
$tomcat_home\webapps\examples\jsp\projsp
The usebin tag is as follows:
<jsp:usebean id="tryBean" class="projsp.SpellCheck" scope="session" />
And the error message is as follows
Undefined variable or class name: tryBean
I am not sure why the jsp can not find the bean
Thanks in advance
Cheers
Jayram
 
vishnukanth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi jayram,
i ve not worked in tom-cat
but try with the following
1)usebean -->useBean ('B' is capital)
2)find out the default directory of the server for 'beans' and give the path accordingly..
 
jayram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks vishnu my bean worked..
I changed usebean to useBean.
I put the class file for the bean in /webapps/examples/web-inf/classes...and the jsp file into /webapps/examples/jsp ...and the bean worked
but one doubt ...why didnt i get an error when my usebean tag was wrong .How does JSPC validate a JSP for syntax errors?
Cheers
Jayram
 
Ben Roy
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since a jsp can include both code and html, it probably just ignored the tag thinking it was some crazy html thing. This is just a guess, but when it comes to html most apps tend to skip over anything that starts with a < and ends with a > if they don't understand what it is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic