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());
}
}