File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could Java class instantiate in jsp scriplet

 
Gopi Krishna
Greenhorn
Posts: 10
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic