my dog learned polymorphism*
The moose likes Struts and the fly likes The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int)" Watch "The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int)" New topic
Author

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

pradeep rawat
Greenhorn

Joined: Dec 26, 2011
Posts: 2
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

Joined: Jun 22, 2010
Posts: 5
try casting to the String type..
Harsha Ka
Ranch Hand

Joined: Mar 14, 2010
Posts: 45

Or can use String.valueOf() method


SCJP 1.6,Preparing (Tryin to prepare) for scwcd
pradeep rawat
Greenhorn

Joined: Dec 26, 2011
Posts: 2
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: The method setAlt(String) in the type BaseHandlerTag is not applicable for the arguments (int)