<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>betweenGo &#187; JSP</title>
	<atom:link href="http://betweengo.com/category/java/jsp-java-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://betweengo.com</link>
	<description>We make Ruby on Rails easy.  We make ATG easy.</description>
	<lastBuildDate>Tue, 08 May 2012 19:30:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Testing Which Page Loaded your JSP Page Fragment</title>
		<link>http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/</link>
		<comments>http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 16:49:00 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>

		<guid isPermaLink="false">http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/</guid>
		<description><![CDATA[Zen Water by darkpatator Sometimes you want to check in your JSP page fragment which page loaded it.&#160; Fortunately this is simple with JSTL. &#60;c:if test=&#34;${fn:indexOf(pageContext.request.requestURI,'foo.jsp') != -1}&#34;&#62; The request URI ${pageContext.request.requestURI} contains foo.jsp. &#60;/c:if&#62; Simple but something I always forget how to do. Related posts: Get JSTL Vars from PageContext JSTL for current URI [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/06/10/jsp-redirect-to-another-page/' rel='bookmark' title='JSP redirect to another page'>JSP redirect to another page</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/darkpatator/395226087/"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="Zen Water on Flickr" alt="Zen Water on Flickr" src="http://farm1.static.flickr.com/188/395226087_9002872142.jpg" /></a></p>
<p align="center"><a title="Zen Water on Flickr" href="http://www.flickr.com/photos/darkpatator/395226087/">Zen Water</a> by <a title="Flckr: darkpatator&#39;s Photostream" href="http://www.flickr.com/photos/darkpatator/">darkpatator</a></p>
<p>Sometimes you want to check in your JSP page fragment which page loaded it.&#160; Fortunately this is simple with JSTL.</p>
<pre>&lt;c:if test=&quot;${fn:indexOf(pageContext.request.requestURI,'foo.jsp') != -1}&quot;&gt;
  The request URI ${pageContext.request.requestURI} contains foo.jsp.
&lt;/c:if&gt;</pre>
<p>Simple but something I always forget how to do. <img src='http://betweengo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2010%2F02%2F01%2Ftesting-which-page-loaded-your-jsp-page-fragment%2F&amp;title=Testing%20Which%20Page%20Loaded%20your%20JSP%20Page%20Fragment" id="wpa2a_2"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/06/10/jsp-redirect-to-another-page/' rel='bookmark' title='JSP redirect to another page'>JSP redirect to another page</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get JSTL Vars from PageContext</title>
		<link>http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/</link>
		<comments>http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/#comments</comments>
		<pubDate>Mon, 04 May 2009 15:02:17 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=697</guid>
		<description><![CDATA[JSTL sets its vars in the pageContext.&#160; For example: pageContext.setAttribute(&#34;foo&#34;, bar); Therefore to get a JSTL variable use the pageContext within a tag or a JSP page.&#160; For example: // get item from pageContext and put in request atg.servlet.DynamoHttpServletRequest drequest = atg.servlet.ServletUtil.getDynamoRequest(request); drequest.setParameter(&#34;foo&#34;, pageContext.getAttribute(&#34;foo&#34;)); Note that getAttribute assumes the variable is in the page scope.&#160; [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2005/08/30/jsp-dynamo-request-retrieval/' rel='bookmark' title='JSP Dynamo Request Retrieval'>JSP Dynamo Request Retrieval</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>JSTL sets its vars in the pageContext.&#160; For example:    </p>
<pre>pageContext.setAttribute(&quot;foo&quot;, bar);</pre>
<p>
  <br />Therefore to get a JSTL variable use the pageContext within a tag or a JSP page.&#160; For example: </p>
<p></p>
<pre>// get item from pageContext and put in request
atg.servlet.DynamoHttpServletRequest drequest = atg.servlet.ServletUtil.getDynamoRequest(request);
drequest.setParameter(&quot;foo&quot;, pageContext.getAttribute(&quot;foo&quot;));</pre>
<p>
  <br />Note that <tt>getAttribute</tt> assumes the variable is in the page scope.&#160; If you want to get a variable from for example the request scope you would do this.</p>
<pre>pageContext.getAttribute(&quot;foo&quot;, javax.servlet.PageContext.REQUEST_SCOPE);</pre>
<p>
  <br />For further reading please see <a title="PageContext (Jave EE 5 SDK)" href="http://download.oracle.com/javaee/5/api/javax/servlet/jsp/PageContext.html">PageContext</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F05%2F04%2Fget-jstl-vars-from-pagecontext%2F&amp;title=Get%20JSTL%20Vars%20from%20PageContext" id="wpa2a_4"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2005/08/30/jsp-dynamo-request-retrieval/' rel='bookmark' title='JSP Dynamo Request Retrieval'>JSP Dynamo Request Retrieval</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the request parameter</title>
		<link>http://betweengo.com/2009/04/10/getting-the-request-parameter/</link>
		<comments>http://betweengo.com/2009/04/10/getting-the-request-parameter/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 18:14:09 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=687</guid>
		<description><![CDATA[I always forget how to do this so I thought I should write it down. In JSP: &#60;%=request.getParameter("foo")%&#62; &#60;img src="&#60;%=request.getParameter("foo")%&#62;"&#62; In JSTL: &#60;c:out value="${param.foo}"/&#62; In DSP: &#60;dspel:valueof param="foo"/&#62; Related posts: Comparison of DSP and DSPEL Accessing RepositoryItems with JSTL Display formatted HTML text
Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/12/display-formatted-html/' rel='bookmark' title='Display formatted HTML text'>Display formatted HTML text</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I always forget how to do this so I thought I should write it down.</p>
<p>In JSP:</p>
<pre>&lt;%=request.getParameter("foo")%&gt;
&lt;img src="&lt;%=request.getParameter("foo")%&gt;"&gt;</pre>
<p>In JSTL:</p>
<pre>&lt;c:out value="${param.foo}"/&gt;</pre>
<p>In DSP:</p>
<pre>&lt;dspel:valueof param="foo"/&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F04%2F10%2Fgetting-the-request-parameter%2F&amp;title=Getting%20the%20request%20parameter" id="wpa2a_6"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/12/display-formatted-html/' rel='bookmark' title='Display formatted HTML text'>Display formatted HTML text</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/04/10/getting-the-request-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unexplainable JSP Compilation Problem</title>
		<link>http://betweengo.com/2009/02/04/unexplainable-jsp-compilation-problem/</link>
		<comments>http://betweengo.com/2009/02/04/unexplainable-jsp-compilation-problem/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 15:47:56 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=424</guid>
		<description><![CDATA[I was getting a JSP compilation problem that I could not solve. org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:572) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303) java.lang.NumberFormatException: For input string: "${status.index}" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:447) at java.lang.Integer.valueOf(Integer.java:553) at org.apache.jasper.compiler.JspUtil.coerceToInt(JspUtil.java:752) at org.apache.jasper.compiler.Generator$GenerateVisitor.convertString(Generator.java:2949) The major [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was getting a JSP compilation problem that I could not solve.</p>
<pre>org.apache.jasper.JasperException: Unable to compile class for JSP
        at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

org.apache.jasper.JasperException: Unable to compile class for JSP
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:572)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)

java.lang.NumberFormatException: For input string: "${status.index}"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:553)
        at org.apache.jasper.compiler.JspUtil.coerceToInt(JspUtil.java:752)
        at org.apache.jasper.compiler.Generator$GenerateVisitor.convertString(Generator.java:2949)</pre>
<p>The major problem was this was happening on the server but not locally.  The compilation problem was occurring for this line.</p>
<pre>&lt;uportal:module definition="${module}" moduleIndex="${status.index}"/&gt;</pre>
<p>The moduleIndex value is &#8220;${status.index}&#8221;.  Locally when the JSP compiler encounters this it knows to call my setter for moduleIndex that takes a String parameter.  But on the server the JSP compiler seemed to insist on using the setter for moduleIndex that takes an integer parameter, hence the compilation problem.</p>
<p>I finally posted on the <a title="Unable to compile class for JSP java.lang.NumberFormatException" href="http://forums.sun.com/message.jspa?messageID=10593842">Sun Forums</a> and with the help of <a title="User Profile: evnafets" href="http://forums.sun.com/profile.jspa?userID=345151">evnafets</a> I came up with two solutions.</p>
<ol>
<li>The correct solution is to upgrade my application to use JSTL 1.1.  Then the JSTL expressions such as &#8220;${status.index}&#8221; will be evaluated by the container.  Then I don&#8217;t have to have a setter that takes a String parameter, the JSTL expression, and evaluate it myself.  I can just use a setter that takes an integer parameter.</li>
<li>The quick, hack solution which is to get rid of the setter that takes an integer parameter.  Wherever the application passes in an integer parameter, I change it to pass in a String representation of that integer.</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F02%2F04%2Funexplainable-jsp-compilation-problem%2F&amp;title=Unexplainable%20JSP%20Compilation%20Problem" id="wpa2a_8"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/02/04/unexplainable-jsp-compilation-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading to JSTL 1.1</title>
		<link>http://betweengo.com/2009/02/03/upgrading-to-jstl-11/</link>
		<comments>http://betweengo.com/2009/02/03/upgrading-to-jstl-11/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 20:14:41 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=417</guid>
		<description><![CDATA[Based on this excellent post I came up with the following instructions for upgrading from JSTL 1.1. Update URI in JSP pages to use JSTL 1.1. &#60;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&#62; Install in WEB-INF/lib the two JSTL 1.1 jars, standard.jar and jstl.jar.  You can get these from The Jakarta Site &#8211; Standard 1.1 Taglib Downloads. [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Based on this <a title="JSTL 1.1 in JSP2.0 containers" href="http://forums.sun.com/thread.jspa?messageID=3625783#3625783">excellent post</a> I came up with the following instructions for upgrading from JSTL 1.1.</p>
<ol>
<li>Update URI in JSP pages to use JSTL 1.1.
<pre>&lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;</pre>
</li>
<li>Install in WEB-INF/lib the two JSTL 1.1 jars, standard.jar and jstl.jar.  You can get these from <a title="The Jakarta Site - Standard 1.1 Taglib Downloads" href="http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi">The Jakarta Site &#8211; Standard 1.1 Taglib Downloads</a>.</li>
<li>Update the start of web.xml to look like this.
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4"&gt;</pre>
</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2009%2F02%2F03%2Fupgrading-to-jstl-11%2F&amp;title=Upgrading%20to%20JSTL%201.1" id="wpa2a_10"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2009/02/03/upgrading-to-jstl-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trim White Space from JSP</title>
		<link>http://betweengo.com/2008/08/22/trim-white-space-from-jsp/</link>
		<comments>http://betweengo.com/2008/08/22/trim-white-space-from-jsp/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 17:41:17 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSP]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=285</guid>
		<description><![CDATA[Sometimes the resultant HTML from JSP files has too much white space.&#160; This is because a lot of JSP logic will result in only a few lines of actual HTML code and the rest is white space. One efficient way to get rid of white space is to add this configuration to your web.xml on [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/29393867@N07/4286828753/"><img style="margin: 0px 10px 0px 0px; display: inline; float: left" title="Untitled Flickr" alt="Untitled | Flickr" align="left" src="http://farm5.static.flickr.com/4046/4286828753_3d4d0092cd_t.jpg" /></a>Sometimes the resultant HTML from JSP files has too much white space.&#160; This is because a lot of JSP logic will result in only a few lines of actual HTML code and the rest is white space.</p>
<p>One efficient way to get rid of white space is to add this configuration to your web.xml on Tomcat/JBoss as described in this article, <a title="Trim Spaces in your JSP&#39;s HTML" href="http://raibledesigns.com/rd/entry/trim_spaces_in_your_jsp">Trim Spaces in your JSP&#8217;s HTML</a>.</p>
<pre>/jboss/jboss-eap-4.2/jboss-as/server/atg/deploy/jboss-web.deployer/conf/web.xml
OR
/jboss/jboss-eap-5.1/jboss-as/server/atg/deployers/jbossweb.deployer/web.xml

&lt;servlet&gt;
    &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
    ...

    &lt;init-param&gt;
        &lt;param-name&gt;trimSpaces&lt;/param-name&gt;
        &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/init-param&gt;

    ...
&lt;/servlet&gt;</pre>
<p>
  <br />However this sometimes has undesired side-effects. For example this DSP: </p>
<p></p>
<pre>&lt;div class=&quot;foo&quot;&gt;
  &lt;dspel:valueof param=&quot;displayName&quot; /&gt;
&lt;/div&gt;</pre>
<p>
  <br />causes this undesired result: </p>
<p></p>
<pre>&lt;div class=&quot;foo&quot;/&gt;
  Frank Kim</pre>
<p>
  <br />The work around is to do this. </p>
<p></p>
<pre>&lt;dspel:getvalueof  var=&quot;displayName&quot; param=&quot;displayName&quot; /&gt;
&lt;div  class=&quot;foo&quot;&gt;&lt;c:out  value=&quot;${displayName}&quot;/&gt;&lt;/div&gt;</pre>
<p><strong>Update 06-09-2010:</strong> The above problem might have been happening because we were running with a version of ATG that is for Servlet 2.3. When we run with a version of JBoss that runs with Servlet 2.4, e.g.&#160; ATG 9.1 with JBoss EAP 4.2, we no longer see this problem.</p>
<p>There is another tip on removing white space in this <a title="Why I am getting extra whitespace in the output of my JSP?" href="http://www.caucho.com/resin-3.0/jsp/faq.xtp">JSP FAQ: Why I am getting extra whitespace in the output of my JSP</a>?&#160; In our code we had one file which included a bunch of tag libraries.&#160; It originally looked like this.</p>
<p>&lt;%/** Taglibs.jsp: include to pull in all taglibs */%&gt;</p>
<pre>&lt;%@ taglib uri=&quot;/dspELTaglib&quot; prefix=&quot;dspel&quot; %&gt;
&lt;%@ taglib uri=&quot;/jstlCoreTaglib&quot; prefix=&quot;c&quot; %&gt;
&lt;%@ taglib uri=&quot;/struts-bean&quot; prefix=&quot;bean&quot; %&gt;
&lt;%@ taglib uri=&quot;/struts-tiles&quot; prefix=&quot;tiles&quot; %</pre>
<p>
  <br />When we changed it to this we saved about 5% in terms of page size in bytes. </p>
<p></p>
<pre>&lt;%@ taglib uri=&quot;/dspELTaglib&quot; prefix=&quot;dspel&quot;
%&gt;&lt;%@ taglib uri=&quot;/jstlCoreTaglib&quot; prefix=&quot;c&quot;
%&gt;&lt;%@ taglib uri=&quot;/struts-bean&quot; prefix=&quot;bean&quot;
%&gt;&lt;%@ taglib uri=&quot;/struts-tiles&quot; prefix=&quot;tiles&quot; %&gt;</pre>
<p>
  <br />You can use this tip with a DSP page and maintain indentation. </p>
<p></p>
<pre>&lt;dspel:page&#160;&#160;&#160; &gt;&lt;dspel:droplet name=&quot;/betweengo/droplet/Foo&quot;&#160;&#160;&#160;&#160;&#160; &gt;&lt;dspel:oparam name=&quot;output&quot;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt;Name: &lt;dspel:valueof param=&quot;name&quot;&#160;&#160;&#160;&#160;&#160; /&gt;&lt;/dspel:oparam&#160;&#160;&#160; &gt;&lt;/dspel:droplet
&gt;&lt;/dspel:page&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F08%2F22%2Ftrim-white-space-from-jsp%2F&amp;title=Trim%20White%20Space%20from%20JSP" id="wpa2a_12"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/08/22/trim-white-space-from-jsp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Display formatted HTML text</title>
		<link>http://betweengo.com/2008/08/12/display-formatted-html/</link>
		<comments>http://betweengo.com/2008/08/12/display-formatted-html/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 21:34:58 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=270</guid>
		<description><![CDATA[In DSP to display formatted HTML text you use the valueishtml converter attribute.  For example: &#60;dspel:valueof param="displayName" valueishtml="true"/&#62; For example &#8220;foo &#38;amp; bar&#8221; becomes &#8220;foo &#38; bar&#8221;. In JSTL to do this you tell JSTL not to escape the XML.  For example: &#60;c:out value="${displayName}" escapeXml="false" /&#62; Related posts: Upgrading to JSTL 1.1 Get JSTL Vars [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In DSP to display formatted HTML text you use the <a title="Escape HTML Converter" href="http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/ATG2006.3/pagedev/pagedev0308.html#escapehtmlconverter01">valueishtml converter attribute</a>.  For example:</p>
<pre>&lt;dspel:valueof param="displayName" valueishtml="true"/&gt;</pre>
<p>For example &#8220;foo &amp;amp; bar&#8221; becomes &#8220;foo &amp; bar&#8221;.</p>
<p>In JSTL to do this you tell <a title="JSP programming best practice: Use the escapeXml attribute to preserve HTML formatting" href="http://publib.boulder.ibm.com/infocenter/wchelp/v5r6/index.jsp?topic=/com.ibm.commerce.developer.doc/refs/rsdjspbpescapexml.htm">JSTL not to escape the XML</a>.  For example:</p>
<pre>&lt;c:out value="${displayName}" escapeXml="false" /&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F08%2F12%2Fdisplay-formatted-html%2F&amp;title=Display%20formatted%20HTML%20text" id="wpa2a_14"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/08/12/display-formatted-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test if empty in JSTL</title>
		<link>http://betweengo.com/2008/06/26/test-if-empty-jstl/</link>
		<comments>http://betweengo.com/2008/06/26/test-if-empty-jstl/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 14:34:13 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=201</guid>
		<description><![CDATA[(Photo: Singur suflet pustiu by dani81_const) This article, Expression Language Overview&#8221; href=&#8221;http://www.informit.com/articles/article.aspx?p=30946&#8243;&#62;InformIT: The JSTL Expression Language &#62; Expression Language Overview, informed me on how to test if something is empty or not. Empty? &#60;c:if test="${empty foo}"&#62;...&#60;/c:if&#62; Not empty? &#60;c:if test="${not empty foo}"&#62;...&#60;/c:if&#62; Related posts: Upgrading to JSTL 1.1 Get JSTL Vars from PageContext JSTL for [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/daniela_c/3287363948/"><img title="Singur suflet pustiu on Flickr" src="http://farm4.static.flickr.com/3162/3287363948_bc4e08a20d.jpg" alt="Singur suflet pustiu on Flickr" width="500" height="405" /></a></p>
<p style="text-align: center">(Photo: <a title="Singur suflet pustiu on Flickr" href="http://www.flickr.com/photos/daniela_c/3287363948/">Singur suflet pustiu</a> by <a title="Flickr: dani81_const's photostream" href="http://www.flickr.com/photos/daniela_c/">dani81_const</a>)</p>
<p>This article, <a title="InformIT: The JSTL Expression Language &gt; Expression Language Overview" href="http://www.informit.com/articles/article.aspx?p=30946"> Expression Language Overview&#8221; href=&#8221;http://www.informit.com/articles/article.aspx?p=30946&#8243;&gt;InformIT: The JSTL Expression Language &gt; Expression Language Overview</a>, informed me on how to test if something is empty or not.</p>
<p><strong>Empty?</strong></p>
<pre>&lt;c:if test="${empty foo}"&gt;...&lt;/c:if&gt;</pre>
<p><strong>Not empty?</strong></p>
<pre>&lt;c:if test="${not empty foo}"&gt;...&lt;/c:if&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F06%2F26%2Ftest-if-empty-jstl%2F&amp;title=Test%20if%20empty%20in%20JSTL" id="wpa2a_16"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='JSTL for current URI'>JSTL for current URI</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/06/26/test-if-empty-jstl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSP redirect to another page</title>
		<link>http://betweengo.com/2008/06/10/jsp-redirect-to-another-page/</link>
		<comments>http://betweengo.com/2008/06/10/jsp-redirect-to-another-page/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 14:06:40 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSP]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=191</guid>
		<description><![CDATA[I found on this forum how to redirect to another page in JSP. One of the respondents explained it perfectly. Well you have two options. Either you&#8217;ll do a server side forward or a client side redirect. Server side forward has no interaction with the browser and therefore the URL on the location bar won&#8217;t [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/' rel='bookmark' title='Testing Which Page Loaded your JSP Page Fragment'>Testing Which Page Loaded your JSP Page Fragment</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I found on this forum how to <a title="JavaServer Pages (JSP) and JSTL - JSP - redirect to another page" href="http://forum.java.sun.com/thread.jspa?threadID=576813">redirect to another page</a> in JSP.  One of the respondents explained it perfectly.</p>
<blockquote><p>Well you have two options. Either you&#8217;ll do a server side forward or a client side redirect.<br />
Server side forward has no interaction with the browser and therefore the URL on the location bar won&#8217;t change.<br />
But if you do the HTTP redirect, the browser is instructed to load the other page and the contents of the location will change.<br />
It&#8217;s your call which one to choose.</p>
<p>forward:</p>
<pre>&lt;% <span style="color: navy;"><strong>if</strong></span> (s1.equals(s2) ) <span style="color: navy;">{</span> %&gt;

     &lt;jsp:forward page=<span style="color: red;">"s2.jsp"</span>/&gt;

&lt;% <span style="color: navy;">}</span> %&gt;</pre>
<p>redirect:</p>
<pre>&lt;% <span style="color: navy;"><strong>if</strong></span> (s1.equals(s2) ) <span style="color: navy;">{</span>

    response.sendRedirect(<span style="color: red;">"s2.jsp"</span>);

<span style="color: navy;">}</span> %&gt;</pre>
</blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F06%2F10%2Fjsp-redirect-to-another-page%2F&amp;title=JSP%20redirect%20to%20another%20page" id="wpa2a_18"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/' rel='bookmark' title='Testing Which Page Loaded your JSP Page Fragment'>Testing Which Page Loaded your JSP Page Fragment</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Trim White Space from JSP'>Trim White Space from JSP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/06/10/jsp-redirect-to-another-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSTL for current URI</title>
		<link>http://betweengo.com/2008/05/27/jstl-for-current-uri/</link>
		<comments>http://betweengo.com/2008/05/27/jstl-for-current-uri/#comments</comments>
		<pubDate>Tue, 27 May 2008 19:24:23 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[dsp]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=185</guid>
		<description><![CDATA[I was wondering how do get the current URI using JSTL and found this forum thread, JSTL EL for current page URL?. If you want the actual URI of the JSP that is being rendered: &#60;c:out value="${pageContext.request.requestURI}"/&#62; If you want the original URI, which is probably the case, then: &#60;c:out value="${requestScope['javax.servlet.forward.request_uri']}"/&#62; In DSP if you [...]
Related posts:<ol>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was wondering how do get the current URI using JSTL and found this forum thread, <a title="JSTL EL for current page URL?" href="http://forum.java.sun.com/thread.jspa?threadID=5205523&amp;messageID=9822007">JSTL EL for current page URL?</a>.</p>
<p>If you want the actual URI of the JSP that is being rendered:</p>
<pre>&lt;c:out value="${pageContext.request.requestURI}"/&gt;</pre>
<p>If you want the original URI, which is probably the case, then:</p>
<pre>&lt;c:out value="${requestScope['javax.servlet.forward.request_uri']}"/&gt;</pre>
<p>In DSP if you want the original URI you can use the OriginatingRequest bean which implements the <a title="Java 2 Platform EE v1.3: Interface HttpServletRequest" href="http://download.oracle.com/javaee/1.3/api/javax/servlet/http/HttpServletRequest.html">HttpServletRequest</a>.</p>
<pre>&lt;dsp:valueof bean="/OriginatingRequest.requestURI" /&gt;</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fbetweengo.com%2F2008%2F05%2F27%2Fjstl-for-current-uri%2F&amp;title=JSTL%20for%20current%20URI" id="wpa2a_20"><img src="http://betweengo.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>Related posts:<ol>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/27/jstl-for-current-uri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
