• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to convert integer variable to string representation  RSS feed

 
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.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let us see some code snippets and sample data.
 
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
errr...

 
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
Boost this thread!