This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with making an instance of java file in jsp

 
gaurav chaudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made one jsp. Now I have one more public java file with me.....the problem is that how do I make an instance of the java file in jsp. for example
java file
now I have to access that function from my jsp.
Any help would be appreciated
thanks
 
sandeep balyan
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try it
<%
Myclass my=new Myclass();
my.func1();
%>
do import u r class in starting jsp file
<% @ page import="ur class location" >

second way is u can use by usebean tag ..
hope it help
regds
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic