• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Madhan Kumar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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
 
jyothsna kumari
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!