• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple jsp problem

 
Chris Chua
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does one import a .class file in a jsp file using <%@ page import= %> assuming my class file is A.class and is on directory
c:\tomcat\webapps\myjsp\web-inf\classes\A.class what should I put in the import="". I am using Tomcat ver 3.3. also what if i put the A.class file in a package what should i do?.
Thanks
Chris
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really should put your class in a package so that the JSP interpreter will look in the right place.
<%@ page import="mypkg.A" %>
Tomcat will start looking at the directory:
c:\tomcat\webapps\myjsp\WEB-INF\classes\mypkg
(the upper case WEB-INF is required)
All of these conventions are laid out in the servlet API you can download from java.sun.com
Bill

------------------
author of:
 
Chris Chua
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot Mr Brogden. My jsp is working fine already. However I'ld like to clarify something you said that WEB-INF should be capitalized and it is a must but my jsp and servlets are working fine using lowercase web-inf how's that?
Thanks
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic