-
SitePoint Zealot

How to reference another Java class from JSP?
Hi!
I have some code in databaseAccess.java file and I want to reference it by calling it from a jsp file.
In my jsp file, I have:
<%
databaseAccess db = new databaseAccess();
db.query("SELECT....");
%>
But it gives me a HTTP 500 error report. It says: cannot find symbol
symbol : class databaseAccess
Do I need to "reference" the databaseAccess.java in my jsp file? How should I do it?
Thanks.
-
SitePoint Wizard
Just like regular Java, you'll need to import a class or package you want to include in your code.
Like so:
<%@ page import="java.text.*, java.util.*" %>
-
SitePoint Zealot

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks