Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert integer variable to string representation

 
vernon mweetwa
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

i have the servlet that gets the site number in integer form.what i would like to do is this integer variable must be converted to a string giving the exact name of site. once this is done it should be used by the setter and getter methods of a java bean which in turn supplies the jsp with the string name of the site to be displayed.

at the moment i can not display the string name of the site cause the conversion fron an int to a string is refusing and therefore i cannot use the integer representation cause the java beans's setter and getter methods only make use of strings.

i really need your help on this.
 
Jessica Doe
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let us see some code snippets and sample data.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
errr...

 
Babar Qadri
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int i=5;
String iAsString=Integer.toString(i);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic