tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anto Paul <antop...@gmail.com>
Subject Re: Importing user-defined class in a JSP page
Date Thu, 09 Jun 2005 14:12:14 GMT
On 6/9/05, uttam.g.dubal@accenture.com <uttam.g.dubal@accenture.com> wrote:

> Any ideas how to import a user-defined class in JSP, I mean where to
> place the class file and is there anyother environment variable to set?
> I read somewhere that if you are using jdk 1.4 and above, you need to
> have package name for classes.  It said to Put your webappname class in
> a package, compile it and then import it like the following in your JSP
> file:  <%@ page import="packagename.WebAppName"%>
> 

You should grab some good book on programming JSP and Servlets.

    I assume you know Java.  As far as the error is concerned it don't
seem to be because of a class is not properly imported. The syntax for
importing class in JSP page is correct assuming WebAppName is the
class you are importing. The compiles class files in the proper
package structure is to be put in
$CATALINA_HOME/webapps/mywebapp/WEB-INF/classes folder. Then restart
Tomcat.

    You can find a sample web application in the
$CATALINA_HOME/webapps/examples folder.
-- 
rgds
Anto Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message