This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Could Java class instantiate in jsp scriplet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Could Java class instantiate in jsp scriplet" Watch "Could Java class instantiate in jsp scriplet" New topic
Author

Could Java class instantiate in jsp scriplet

Gopi Krishna
Greenhorn

Joined: Jan 25, 2001
Posts: 10
Hi ,
can we instantiate a java class in a jsp page like
<% MyClass mc = new MyClass();
mc.getConnection();
%>
Asuthosh Borikar
Ranch Hand

Joined: Sep 29, 2000
Posts: 75
Gopi,
I don't see why not. I do it all the time and it never gives me any problem. But, it is preferrable to use JavaBeans in place of java classes,going by the MVC pattern.
HTH.
 
wood burning stoves
 
subject: Could Java class instantiate in jsp scriplet
 
Similar Threads
which one is better to use jsp:useBean or import statement .
Error in jsp on instanciating a java class
Confusion about class creation inside a class.
Synchronized class
Number of instances