JSP Import problem - JasperException?

  • Thread starter Price Ellington
  • Start date
P

Price Ellington

Hi,

I am trying to import a class into my JSP and am getting the following
error at runtime:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Compiling 1 source file
[javac] D:\jwsdp-1.2\work\Catalina\localhost\pe\org\apache\jsp\guestbook_jsp.java:7:
'.' expected
[javac] import MessageGetter;


My import statement in the JSP is simply:

<%@ page import="MessageGetter" %>

and I am placing the class in the WEB-INF/classes directory. This is
stumping me - if you've come across this or a similar problem, please
let me know. Thanks.

P
 
D

Daniel Schneller

Price said:
Generated servlet error:
[javac] Compiling 1 source file
[javac] D:\jwsdp-1.2\work\Catalina\localhost\pe\org\apache\jsp\guestbook_jsp.java:7:
'.' expected
[javac] import MessageGetter;

and I am placing the class in the WEB-INF/classes directory. This is
stumping me - if you've come across this or a similar problem, please
let me know. Thanks.

Have you tried the fully qualified name? Do you have subdirs according
to the package structure?

Daniel
 
C

Chris Riesbeck

Hi,

I am trying to import a class into my JSP and am getting the following
error at runtime:


My import statement in the JSP is simply:

<%@ page import="MessageGetter" %>

and I am placing the class in the WEB-INF/classes directory.

For JSP, all classes have to be in named packages to be
importable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,097
Latest member
RayE496148

Latest Threads

Top