请教为什么编译不通过

请问为什么编译不通过Java codepackagecom.nongimport javax.servlet.*import javax.servlet.http.*imp

请问为什么编译不通过

Java code
package  com.nong;import javax.servlet.*;import javax.servlet.http.*;import java.io.*;public class ServletContext extends  HttpServlet {public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{    try{        res.setContentType("text/html;charset=gbk");        PrintWriter pw=res.getWriter();        ServletContext sc=this.getServletContext();//为什么这里编译不通过        }    catch(Exception e)    {e.printStackTrace();}}public void doPost(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{    this.doGet(req,res);}    }


[解决办法]
ServletContext sc=this.getServletContext();//为什么这里编译不通过
需要强制转换