Code Snippets: Utilizing JSTL forEach tag in your Web Pages

JavaServer Pages Standard Tag Library or JSTL for short is a library that contains a set of core functionality including iterations and conditionals.  The tag I find myself most often using is the forEach tag to output a collection of data in a consistent format. By use of the optional status object and the if

Code Snippets: How to set id property using Struts HTML Tag library

For those new to Struts and in particular the Struts HTML library it might come as a surprise that there is no id property on their tags. Don’t get frustrated the tag library document clearly states that the styleId property renders its assigned value as the element id. This means that instead of id use

Code Snippets: Commenting your JSP code

All web developers know that they can add comments to their HTML by use of the <!– –> tag. This causes the contents to not be rendered to the viewer but still displayed in the source of the page. This method of commenting can still be done in JSP but in addition there is the<%–

Code Snippets: How to get the web application context path from within JSP

Often in JSP we find ourselves creating links to other pages within our web application.  The below code allows us to easily get the web application context path from within a JSP file. ${pageContext.request.contextPath} Utilizing JSTL we could also set this value to a variable so that we have a short hand method for getting