• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to access the package in jsp ?

 
Honey Joshi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody please solve my problem.

I am creating a a web application and now

File Structure is like

Tomcat
|
webapps
|
MySession (This is my web application)
|
-------------------
| |
Login.jsp WEB-INF
|
classes
|
com
|
example
|
Dog (This is my class)

Now i want to import "Dog" class in my Login.jsp.
how can i access this package.
Please tell me.
I would appreciate


 
Vasudhaiv Naresh
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Honey,
you can use your class-Dog simply by adding the following directive in your login.jsp:
<%@page import="com.example.Dog" %>
Now, the class can be used like any other built in one.
Hope this helps.
Regards,
Naresh
 
Honey Joshi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vasudhaiv Naresh:
Hi Honey,
you can use your class-Dog simply by adding the following directive in your login.jsp:
<%@page import="com.example.Dog" %>
Now, the class can be used like any other built in one.
Hope this helps.
Regards,
Naresh


Hi Vashu

Thanks alot. I was thinking the same that the container look after the classes folder. so we should use com.example.*;
Thanks the code runs

 
prashant kond
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U can use like this only..
<%@page import="com.example.Dog" %>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!