From: Wolfgang M. M. <wol...@us...> - 2004-07-15 19:43:31
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/request In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9621/src/org/exist/xquery/functions/request Modified Files: RequestParameterNames.java Log Message: Pass global context information to imported XQuery modules. Index: RequestParameterNames.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/request/RequestParameterNames.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RequestParameterNames.java 28 May 2004 10:54:20 -0000 1.2 --- RequestParameterNames.java 15 Jul 2004 19:43:23 -0000 1.3 *************** *** 73,79 **** // request object is read from global variable $request Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR); if (var.getValue().getItemType() != Type.JAVA_OBJECT) throw new XPathException("Variable $request is not bound to an Java object."); - JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0); if (value.getObject() instanceof RequestWrapper) { --- 73,80 ---- // request object is read from global variable $request Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR); + if(var == null) + throw new XPathException("No request object found in the current XQuery context."); if (var.getValue().getItemType() != Type.JAVA_OBJECT) throw new XPathException("Variable $request is not bound to an Java object."); JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0); if (value.getObject() instanceof RequestWrapper) { |