Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The type HttpServlet is not accessible

 
victor chiong
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Have you encountered the problem below? It is found in public class BeerSelect extends HttpServlet. Any Idea how to solve this problem? I used the Tomcoat 7 Servlet Jar.

Access restriction: The type HttpServlet is not accessible due to restriction on required library C:
\Apache 7\lib\servlet-api.jar
- Breakpoint:BeerSelect

I am using eclipse Juno Release


package com.example.web;


import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;


/**
* Servlet implementation class BeerSelect
*/

public class BeerSelect extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public BeerSelect() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


response.setContentType(null);





// TODO Auto-generated method stub
}

}
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there should not be any constructor for your servlet extended class.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, servlets should not have constructors, but that's not the problem here.
 
victor chiong
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gurus,

It is actually the auto generated servlet from Eclipe Juno Edition. Even the constructor is auto generated... It is very weird..... How am I not allowed to extend the super class httpservlet right?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic