小弟初次用JSP做个东西,我在JSP页面静态区块中用到内置对象application,网页显示该对象不能解析,这是什么问题呢。

解决方案 »

  1.   

    估计不得行lz需要做什么东西 不可以在jsp中的jspInit方法中写?
      

  2.   

    后台是干嘛用的,怎么什么都在jsp上写,蛋疼的厉害
      

  3.   


    重写jsp的jspInit方法,在里面初始化资源就可以了
      

  4.   


    自己看下jsp生成的servlet吧 public void _jspService(HttpServletRequest request, HttpServletResponse response)
            throws java.io.IOException, ServletException {    PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        JspWriter _jspx_out = null;
        PageContext _jspx_page_context = null;
    }内置对象全是在_jspService中初始化的,而你在静态块中能有application这个对象吗?跟导没导相关类没关系