dcsimg
How can I instantiate an object of a class(MyClass) within a JSP page ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   anish_Raghavan
Posted On:   Monday, April 16, 2001 12:01 AM

How can I instantiate an object of a class(MyClass) within a JSP page ?

Re: How can I instantiate an object of a class(MyClass) from within a JSP page ?

Posted By:   Vasu_Devan  
Posted On:   Monday, April 16, 2001 03:01 AM

You can do it as follows:



<%@ page import="MyClass"%>
<% MyClass myObj=new MyClass(); %>

Make sure you import the correct package.


You can also use the usebean tag, where you can specify the scope of the object.


For more details, see


http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents.html#JSPIntro11

About | Sitemap | Contact