Results 1 to 2 of 2
  1. #1
    Satch is offline Member
    Join Date
    Jul 2010
    Posts
    7
    Rep Power
    0

    Default jdom XPath multithreading issues?

    /* Will I have threading problems with the servlet code below? */
    public String processResults(HttpServletRequest request, HttpServletResponse response,
    Rete engine) throws IOException {
    String nextPage = null;
    HttpSession session = request.getSession();
    Document document = (Document)session.getAttribute(ServletCommand.DOCU MENT);
    try { //multithread issues?
    if ("TRUE".equals(hasErrorsExpression.valueOf(documen t)) == true)
    nextPage = "contactInfo.xslt"; //do it again
    else
    nextPage = "success.html";
    }
    catch (JDOMException e) {
    request.setAttribute(ServletCommand.ERROR, e);
    nextPage = "jdom-error.jsp";
    }
    return nextPage;
    }


    /* In this class */
    private static XPath hasErrorsExpression = null;

    static {
    try {
    hasErrorsExpression =
    XPath.newInstance("/session/fact[@id='contactInfo']/slot[@name='hasErrors']/value");
    }
    catch (JDOMException e) {
    logger.severe(e.getMessage());
    }
    }
    Last edited by Satch; 09-20-2010 at 01:42 PM.

  2. #2
    Satch is offline Member
    Join Date
    Jul 2010
    Posts
    7
    Rep Power
    0

Similar Threads

  1. XPath using JDom question...
    By master_x in forum Advanced Java
    Replies: 1
    Last Post: 07-25-2010, 06:34 AM
  2. jdom question , show xml
    By pipikrk in forum New To Java
    Replies: 11
    Last Post: 05-05-2010, 03:20 PM
  3. Replies: 4
    Last Post: 02-18-2010, 05:24 PM
  4. XML JDOM XPATH NumberFormatException
    By Jazzperson in forum Advanced Java
    Replies: 3
    Last Post: 03-08-2009, 09:15 PM
  5. JDOM in java applications
    By boy22 in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2007, 06:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •