Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet can't see Interface  RSS feed

 
Dan Mc
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to put all of my HTML for a servlet into an Interface and my servlet won't compile. I compiled my Interface in the same folder as my servlet and my servlet implements the interface like this:
public class ResumeServlet extends HttpServlet implements HTMLStuff (which is the name of my interface)
When I try to compile it it doesn't recognize the Interface(cannot resolve symbol HTMLStuff error) I tried this same thing on my laptop and it worked. Are there settings I have to change? I've been successfully running servlets on Tomcat so I know it works.Thanks for any help.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't have both the interface and the servlet code in a package, fix that. Why do you want HTML code in an interface (I assume as static String[] or similar)? Much more flexible to put your static HTML in a file.
Bill
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!