Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use java class in jsp or servlet

 
mohan cheepu
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohan,

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic