How can I instantiate an object of a class(MyClass) within a JSP page ?
Created May 4, 2012
Govind Seshadri
Answer by Vasu devan
Answer by Vasu devan
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