• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

found String rquired int

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have allowed values form 0 to 255 to be input in the form
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic