• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error : the field jspBody is not visible  RSS feed

 
vijay kumarg
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • 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
}
}
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!