Win a copy of Learn Spring Security (video course) this week in the Spring 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