Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using a instance of a class in a jsp page

Status
Not open for further replies.

rabix

Programmer
Apr 23, 2001
12
CH
hi,
how can i make use of the instanc of a class in a jsp page. the class is not a java bean class.
thanx
Rabix
 
First your class must be in a package. You would then call your class like:
yourpackagename.yourclassname

Then in your jsp page you put this at the top of the jsp file.

<%@ page import=&quot;yourpackagename.yourclassname&quot; %>

Then do this to get an instance of your class:

Code:
<%
  yourclassname b = new yourclassname( args );
%>

Be sure to pass any arguments to your class if required.

Catch my drift?
I hope this helped! ;-)
- Casey Winans
 
hi,
thanx for ur solution.
i have got a jsp page which has to take the value from the instance of a class and display it. for a single instance i am able to display the values. if the class has two or more instances how do i itrate the values and display it in a jsp page.
please help me on this.
regards,
Rabis
 
I don't totally follow what you are trying to say. Could you describe it better please. What were you trying to type &quot;itrate&quot;... I couldn't figure it out.

Later.

I hope this helped! ;-)
- Casey Winans
 
hi,
i got a class and its instances have different values. what i meant was that i wanted to display all those values in the jsp page.
is using the vector a correct method? if so could u please explain it to me.
regards,
Rabix
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top