Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Expression lang in tag attributes  RSS feed

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am using TextButtonTag who inherits ButtonTag
ButtonTag declare attribute "disabled" in the tld , TextButtonTag also declare the same attribute "disabled" in the tld.



The problem is when I am using EL:


The "disabled" attribute always evaluated as false.

I tried replacing the setter to receive Boolean or String instead of just primitive boolean, so all Java calls will stay the same (no refactoring required) and jsp calls will routed to the setDisable that getting "String"



But I am getting "NoSuchMethodError", What am i doing wrong?
Thank you!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP 1.1?
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:JSP 1.1?

JSP 1
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not helping. What versions of JSP and Servlets are you using? Are you sure that the EL is being correctly evaluated? Please show some effort.
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Not helping. What versions of JSP and Servlets are you using? Are you sure that the EL is being correctly evaluated? Please show some effort.

Servlet version (from servlet-api.jar manifest)

Specification-Title: Java API for Servlets
Specification-Version: 2.4

taglib version (from the tld)




EL is being correctly evaluated, I added test Javascript test code and I am able to see 'shouldDisable' value.


Thank you for you help.
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wasted hours trying to figure out why won’t this EL evaluated eventually I replaced the code as so:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!