• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 380
  • Last Modified:

Can I define an interface in JSP?

Can I define an interface in jsp? I've tried the following at the beginning of my program:

interface iFace {
    Object reportDetail(Object arg);

and I get the error:

An error occurred at line: 22 in the jsp file: /printAPchecks.jsp
The member interface iFace can only be defined inside a top-level class or interface
1 Solution
Works fine for me.

My guess is that you tried to define it in the middle of the jsp class -- which is not valid java.  The error message is pretty clear.

So you need to define it outside of the java class, but inside the .jsp file, like this:
interface iFace {
    Object reportDetail(Object arg);
jmarkfoleyAuthor Commented:
That did the trick! Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now