Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

found String rquired int

 
raji toor
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this passes a return value of type String to property IP1. so it threw IllegalArgumentException for this function.


bean specs definne that getIP1() method should return String if i use String as argument for setIP1(). But i want to manipulate them as int's not strings what should i do.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bean specs definne that getIP1() method should return String

Does it ? Where did you read this ? If your ip1 variable is an int, it's getter should be :


By the way, you should avoid mixing upper/lower case that way, or you'll get troubles with beans. You'd better rename your instance variable to "ip1", and declare setIp1 and getIp1.
 
raji toor
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i am misunderstood
According to this code I get IllegalArgumentException

and this function in my class

but when i changed my functions to below it went well. I had also to change ip1 instance variable to String.

 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to user integers too.

IllegalArgumentException

What is the value of param.subnet1 ?
[ June 19, 2007: Message edited by: Satou kurinosuke ]
 
raji toor
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have allowed values form 0 to 255 to be input in the form
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
comment that line :

and try this instead :


Check what is being printed. I have a feel that your subnet1 is null/empty. It may happen the first time you access the page (which means that subnet1 has not been submitted yet)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic