Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在异步方法seam中获取上下文参数_Java_Jakarta Ee_Seam_Facescontext - Fatal编程技术网

Java 在异步方法seam中获取上下文参数

Java 在异步方法seam中获取上下文参数,java,jakarta-ee,seam,facescontext,Java,Jakarta Ee,Seam,Facescontext,我想在我的web.xml中配置一个上下文参数。在方法调用中(使用seam 2.2.0),我通常执行以下操作: readDirectory = (String) FacesContext.getCurrentInstance() .getExternalContext().getInitParameter( "ReadDirectory"); 工作正常,但在异步方法(@asynchronous)中,我的faceCon

我想在我的web.xml中配置一个上下文参数。在方法调用中(使用seam 2.2.0),我通常执行以下操作:

readDirectory = (String) FacesContext.getCurrentInstance()
                .getExternalContext().getInitParameter(
                        "ReadDirectory");
工作正常,但在异步方法(@asynchronous)中,我的faceContext为null

所以我不知道如何获取此参数。

我找到了它:

ServletLifecycle.getServletContext().getInitParameter("ReadDirectory");
当你知道的时候很容易^^