• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use objects in JSP  RSS feed

 
Kathy Wang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this question may be stupid, but please forgive me, I am new to JSP. Here is what I what:
I have a myapps/index.jsp file and a myapps/web-inf/classes/myUtils.java file. In the index.jsp file, I want to use myUtils.class, what should I do to realize this? I tried <%@ include file="/servlet/myUtils.class" %> and also <%@ include file="/web-inf/classes/myUtils.class" %>, they all gave class not found exception.
Thanks for your reply!
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can you be more specific in how u want to make use of myUtils
class.It can be used only if it is either a servlet or a bean.

[This message has been edited by Manjunath Subramanian (edited November 15, 2001).]
 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
All u need to do here is take care of 2 things .....
1)
See to it the the package is imported ....
2) make use of the usebean keyword to use the bean ...

------------------
Try and Try Till u succeed
Sandeep Jain
 
Kathy Wang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manjunath and Sandeep,
My myUtils is not a servlet or a bean. It is just a java object. I will try Sandeep's first mehod. Thanks again!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!