Java & XML, 2nd Edition <% if (authorOrEditor) { %> Mike - Do you think the following sidebar is a little much? I could easily leave it out if it’s still clear without it. <% } %> This is not very structured, as the JSP block ends before the authorComment element begins; then a new block is appended after the element, which closes the brackets opened in the first JSP block. It is very easy to mismatch coding structures or forget to add matching JSP blocks. The XSP paradigm forces every open element to be closed (standard XML well-formedness) and one block of code is matched with one element. With these logical structures in place, the XSP page just needs to interpret the request parameters. You can use the built-in XSP variable request, which mimics the javax.servlet.http.HttpServletRequest object. The following code additions read the values of the userRole and password request parameters (if they exist). The value of userRole is then compared with the roles that can see the comments (”author” and “editor”). If a match occurs, the password is checked as well. If the password matches the key for the supplied role, the boolean variable is set to true, and the authorComment element is part of the XML output: boolean authorOrEditor = false; // Perform logic to see if user is an author or editor In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.