File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes found String rquired int Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "found String rquired int" Watch "found String rquired int" New topic
Author

found String rquired int

raji toor
Greenhorn

Joined: Jun 01, 2007
Posts: 20


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.


toor
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
raji toor
Greenhorn

Joined: Jun 01, 2007
Posts: 20
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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

Joined: Jun 01, 2007
Posts: 20
i have allowed values form 0 to 255 to be input in the form
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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
 
subject: found String rquired int