帮忙给个答案

解决方案 »

  1.   

    拿不到的,servletConfig就在Servlet的init可以拿到,其他不行。
      

  2.   

    ServletActionContext.getPageContext().getServletConfig();
      

  3.   

    2楼没错ServletActionContext.getPageContext().getServletConfig();
      

  4.   

    初始化的时候服务器帮你传过来可以用到
    还有就是等到Pagecontext的时候可以得到
      

  5.   

    ServletActionContext.getPageContext().getServletConfig();是这个
      

  6.   


    ServletActionContext.getPageContext().getServletConfig();
    这里框架已经给你了,还初始化什么?
      

  7.   

    严重: Servlet.service() for servlet default threw exception
    java.lang.NullPointerException
    at com.purchase.zw.seller.web.SellerAction.addgoods(SellerAction.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

  8.   

    今天试了一下:ServletActionContext.getPageContext() 返回空不知如何得到这个PageContext?
      

  9.   

    那为什么在运行的时候出现空指针异常? ,Action拿到的是空的。。那不是没用
      

  10.   

    ServletActionContext没有作为类的成员变量在使用吧?