Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could Java class instantiate in jsp scriplet

 
Gopi Krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
can we instantiate a java class in a jsp page like
<% MyClass mc = new MyClass();
mc.getConnection();
%>
 
Asuthosh Borikar
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic