commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reidar Hoerning" <>
Subject [JXPath] JXPathServletContexts scope problem
Date Mon, 22 Mar 2004 17:47:09 GMT

I have a problem using Servlet Contexts and .getRequestContext.
JXPathServletContexts.getRequestContext() does not walk through the
different contexts to get a specific object as promised in the
What's wrong?

Example (last line): 
public class test extends HttpServlet {

  public void doGet(HttpServletRequest request, HttpServletResponse
      throws IOException, ServletException {

    PrintWriter out = response.getWriter();
    ServletContext servletContext = getServletContext();

    servletContext.setAttribute("A", "anObject");

    JXPathContext appContext =
    JXPathContext reqContext =
JXPathServletContexts.getRequestContext(request, getServletContext());
    out.println("this works: "+ appContext.getValue("A"));
    out.println("this does not work: "+reqContext.getValue("A"));


Thanks in advance!
Reidar H.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message