简体   繁体   中英

Tomcat 6: Importing utility class from WEB-INF/classes

(I've removed client name because of NDA)

Java/JSP newbie here. I have a JSP site and I have a 'Functions' class in WEB-INF/src/client/project/Functions.java

In the Functions.java, the package is com.client.util

This is compiled and ends up as

WEB-INF/classes/client/project/Functions.class
WEB-INF/classes/client/project/Functions$1.class
WEB-INF/classes/client/project/Functions$RequestData.class

Now, in my index.jsp, I try to use this class like so:

<%@ page import="com.client.util.Functions"%><%
Functions.init(request,response,config,out);
%>

And I receive error "Functions cannot be resolved"

How can I make my app aware of this Functions.class?

I'm tried adding various things to web.xml but can't get it to work.

Thanks!

The directory your classes are in doesn't match the package you are trying to import.

If the package com.client.util is correct, then Functions.class should be in directory WEB-INF/classes/com/client/util/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM