This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes how to use java class in jsp or servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "how to use java class in jsp or servlet" Watch "how to use java class in jsp or servlet" New topic

how to use java class in jsp or servlet

mohan cheepu
Ranch Hand

Joined: Nov 15, 2007
Posts: 49
i some java class.i want use those class at serverside in tomcat server. how using jsp or servlets calling those java class.please give me advice.what is dirctory structure.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


Welcome to the ranch.

If you're new to servlets or JSP, I's suggest picking up a good book or finding a good web tutorial. Your question doesn't make a lot of sense because servlets are Java classes. JSPs eventually become Java classes as well. If you follow current best practices your JSP is the end result of a chain of Java classes that are invoked and referenced by one another.

As to directory structure, class files go under {webapp}/WEB-INF/classes/{package structure}/{.class files}

If you bundle your Java classes into jar files, the jars go under WEB-INF/lib.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Have you checked out Aspose?
subject: how to use java class in jsp or servlet
It's not a secret anymore!