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

The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int)

 
pradeep rawat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Trying a simple construct
<%int checkInt=9; %>

<html:text property="" alt="<%=checkInt %>"/>

Integer to String conversion is working in one environment but not working in jdk1.6.

I am getting this run time error.

The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int)

How can this statement work in jdk 1.6?

Regards
 
Pravin Venkatesh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try casting to the String type..
 
Harsha Ka
Ranch Hand
Posts: 45
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or can use String.valueOf() method
 
pradeep rawat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for the reply but i dont want to cast it into String.
I know this will work.
Can you tell me some other way to do?
because i dont want to change my code everwhere,where it is using same construct.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic