Our site requires users to register before they can add comments. This will be supported via an 'Add a Comment' link at the end of each blog. Logged-in users will be able to add their comments immediately. All others will be taken to a registration signup page. Registered users may be able to log on at any time through a login button available at the top of the screen.
To enable this
feature, we need to add a new JSP for the user registration page. The JSP will reside in the elements folder of our module and will be named Register.jsp
. The JSP page looks similar to our other JSP templates. At the top, we include the imports and tag libraries, and then declare and instantiate the bean class:
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"%> <%@ page import="com.deepthoughts.templates.*" %> <% // create the bean BlogJspTemplate blog = new BlogJspTemplate(pageContext, request, response); %>
The rest of the JSP is like...