• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error : the field jspBody is not visible

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am extending the tag handler class SimpleTagSupport, and getting the following error.
" the field SimpleTagSupport.jspBody is not visible. "
What is meant by visibility here?

public class BodySimpleTag extends SimpleTagSupport {

public void doTag() throws JspException, IOException {
// null means 'send the output to JspContext.getOut()'
jspBody.invoke(null); // Error at this Line
}
}
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I am extending the tag handler class SimpleTagSupport, and getting the following error.
" the field SimpleTagSupport.jspBody is not visible. "
What is meant by visibility here?

jspBody.invoke(null); // Error at this Line



The field jspBody cannot be accessed from your class. This is because of the access modifiers like private, public, protected, "left out"(package or default) etc.

The access modifier could be either private or package. Check
section 2.7.4 Qualified Names and Access Control
&
2.9.1 Field Modifiers
in
http://java.sun.com/docs/books/jvms/second_edition/html/Concepts.doc.html#18914

Change it to public and see the difference.

If it still don't work give us the class type for jspBody and the method declaration for invoke.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic