Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setDynamicAttribute not being invoked

 
David Pantale
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I can't seem to get the setDynamicAttribute method to work properly. I can get the application to print out the options but not the attributes. Below is my code (note I've been playing with it by commenting and uncommenting parts) :


the jsp:


the tld:

As I said, I can get it all to work except printing out the size attribute, to do that I have to put "out.print(String.format(ATTR_TEMPLATE, "size", this.size));" into my code.

Can anyone see why the setDynamicAttribute method is not being called by the container?

Thanks
Dave
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There's a typo here, it should be "dynamic-attributes".
 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

I have the same problem even after checking all typos.

I'm getting jasperexception at the line of tag invocation.

It says root cause as :
java.lang.NullPointerException
customtag.simpletag.TestTag.<init>(TestTag.java:20)
org.apache.jsp.JSP.SimpleTagTest_jsp._jspx_meth_t_005fTest_005f0(SimpleTagTest_jsp.java:96)


Can someone help ... What might went wrong..?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic