• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to pass values from .java file to .JSP file

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I want to use a set of Strings inside JSP file.
I have a file called trimtest1.java
import trimIBM.*;
import com.ibm.bridge2java.*;
import java.util.*;
public class trimtest1
{
public static void main(String args[])
{
try
{
int intEachLoc;
com.ibm.bridge2java.OleEnvironment.Initialize();
IDatabase db = (IDatabase) new Database();
ILocations loc = (ILocations) new Locations();
db.set_Id("11");
loc = db.MakeLocations();
loc.SelectAll();
for(intEachLoc=0;intEachLoc<loc.get_Count();intEachLoc++)
{

System.out.println(loc.Item (intEachLoc).get_FormattedName());
}
}
}

This file outputs a set of Strings...
I want these strings in my JSP file...
Please do reply me in detail...
Expecting ur reply
Regards
Madhan
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
One way to do is to use sessions.You can use session.setAttribute("name","value") in your java class and and can access session.getAttribute("name") in your jsp page.
Thanks,
Jyothsna
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic