<?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; JSTL</title>
	<atom:link href="http://betweengo.com/category/java/jsp-java-2/jstl-jsp-java-java/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>Thu, 24 Jun 2010 19:42:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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:JSTL for current URI
Get JSTL Vars from PageContext
Getting the request parameter



Related posts:<ol><li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='Permanent Link: JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2009/04/10/getting-the-request-parameter/' rel='bookmark' title='Permanent Link: Getting the request parameter'>Getting the request parameter</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>Related posts:<ol><li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='Permanent Link: JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2009/04/10/getting-the-request-parameter/' rel='bookmark' title='Permanent Link: Getting the request parameter'>Getting the request parameter</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.  For example:
pageContext.setAttribute("foo", bar);
Therefore to get a JSTL variable use the pageContext within a tag or a JSP page.  For example:
// get item from pageContext and put in request
atg.servlet.DynamoHttpServletRequest drequest = atg.servlet.ServletUtil.getDynamoRequest(request);
drequest.setParameter("foo", pageContext.getAttribute("foo"));


Related posts:JSP Dynamo Request Retrieval
Accessing RepositoryItems with JSTL
JSTL for current URI



Related posts:<ol><li><a href='http://betweengo.com/2005/08/30/jsp-dynamo-request-retrieval/' rel='bookmark' title='Permanent Link: JSP Dynamo Request Retrieval'>JSP Dynamo Request Retrieval</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Permanent Link: 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='Permanent Link: JSTL for current URI'>JSTL for current URI</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>JSTL sets its vars in the pageContext.  For example:</p>
<pre>pageContext.setAttribute("foo", bar);</pre>
<p>Therefore to get a JSTL variable use the pageContext within a tag or a JSP page.  For example:</p>
<pre>// get item from pageContext and put in request
atg.servlet.DynamoHttpServletRequest drequest = atg.servlet.ServletUtil.getDynamoRequest(request);
drequest.setParameter("foo", pageContext.getAttribute("foo"));</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2005/08/30/jsp-dynamo-request-retrieval/' rel='bookmark' title='Permanent Link: JSP Dynamo Request Retrieval'>JSP Dynamo Request Retrieval</a></li>
<li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Permanent Link: 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='Permanent Link: JSTL for current URI'>JSTL for current URI</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='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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>Related posts:<ol><li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Permanent Link: 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='Permanent Link: 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='Permanent Link: 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 [...]


Related posts:<ol><li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Permanent Link: Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</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>Related posts:<ol><li><a href='http://betweengo.com/2007/02/07/accessing-javabeans-getters-and-setters/' rel='bookmark' title='Permanent Link: Accessing JavaBean&#8217;s Getters and Setters'>Accessing JavaBean&#8217;s Getters and Setters</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</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.
Update the start of [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Permanent Link: Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</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>Related posts:<ol><li><a href='http://betweengo.com/2008/05/27/jstl-for-current-uri/' rel='bookmark' title='Permanent Link: 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='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/' rel='bookmark' title='Permanent Link: Size of collection in a JSP/DSP page'>Size of collection in a JSP/DSP page</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>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:Accessing RepositoryItems with JSTL
Trim White Space from JSP
Getting the request parameter



Related posts:<ol><li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Permanent Link: Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/04/10/getting-the-request-parameter/' rel='bookmark' title='Permanent Link: Getting the request parameter'>Getting the request parameter</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>Related posts:<ol><li><a href='http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/' rel='bookmark' title='Permanent Link: Accessing RepositoryItems with JSTL'>Accessing RepositoryItems with JSTL</a></li>
<li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/04/10/getting-the-request-parameter/' rel='bookmark' title='Permanent Link: Getting the request parameter'>Getting the request parameter</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:Get JSTL Vars from PageContext
JSTL for current URI
Upgrading to JSTL 1.1



Related posts:<ol><li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: 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='Permanent Link: JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Permanent Link: Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</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>Related posts:<ol><li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: 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='Permanent Link: JSTL for current URI'>JSTL for current URI</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Permanent Link: Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</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>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[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;


Related posts:Get JSTL Vars from PageContext
Testing Which Page Loaded [...]


Related posts:<ol><li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/' rel='bookmark' title='Permanent Link: Testing Which Page Loaded your JSP Page Fragment'>Testing Which Page Loaded your JSP Page Fragment</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Permanent Link: Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</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>Related posts:<ol><li><a href='http://betweengo.com/2009/05/04/get-jstl-vars-from-pagecontext/' rel='bookmark' title='Permanent Link: Get JSTL Vars from PageContext'>Get JSTL Vars from PageContext</a></li>
<li><a href='http://betweengo.com/2010/02/01/testing-which-page-loaded-your-jsp-page-fragment/' rel='bookmark' title='Permanent Link: Testing Which Page Loaded your JSP Page Fragment'>Testing Which Page Loaded your JSP Page Fragment</a></li>
<li><a href='http://betweengo.com/2009/02/03/upgrading-to-jstl-11/' rel='bookmark' title='Permanent Link: Upgrading to JSTL 1.1'>Upgrading to JSTL 1.1</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>
		<item>
		<title>Size of collection in a JSP/DSP page</title>
		<link>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/</link>
		<comments>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/#comments</comments>
		<pubDate>Thu, 15 May 2008 18:44:26 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=182</guid>
		<description><![CDATA[
(Photo: leaf pile by oeimah)
Sometimes in a JSP/DSP page you will want to get the size of a collection and unless you are within a Range, ForEach or similar droplet you won&#8217;t have access to this value.
Struts has a nice solution using the &#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#34; href=&#34;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&#34;&#62;&#60;bean:size&#62; tag.&#160; JSTL 1.1 has a nice solution using [...]


Related posts:<ol><li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='Permanent Link: ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Permanent Link: Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><a href="http://www.flickr.com/photos/oeimah/4112247972/"><img title="leaf pile on Flickr" alt="leaf pile on Flickr" src="http://farm3.static.flickr.com/2496/4112247972_3bb40b80b3.jpg" /></a></p>
<p style="text-align: center">(Photo: <a title="leaf pile on Flickr" href="http://www.flickr.com/photos/oeimah/4112247972/">leaf pile</a> by <a title="Flickr: oeimah&#39;s photostream" href="http://www.flickr.com/photos/oeimah/">oeimah</a>)</p>
<p>Sometimes in a JSP/DSP page you will want to get the size of a collection and unless you are within a Range, ForEach or similar droplet you won&#8217;t have access to this value.</p>
<p>Struts has a nice solution using the <a title="&lt;bean:size&gt;" href="http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size">&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&quot; href=&quot;http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#size&quot;&gt;&lt;bean:size&gt; tag</a>.&#160; JSTL 1.1 has a nice solution using the <a title="JSTL Function length" href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/length.fn.html">fn:length</a> function.</p>
<p>Here is an example of how to use Struts, DSPEL and JSTL to get the size of a collection.</p>
<pre>  &lt;dspel:getvalueof param=&quot;book.pages&quot; var=&quot;pages&quot;
                    vartype=&quot;java.util.Collection&quot;/&gt;
  &lt;bean:size id=&quot;numPages&quot; name=&quot;pages&quot;/&gt;
  Number of Pages: &lt;c:out value=&quot;${numPages}&quot;/&gt;
  Number of Pages: &lt;dspel:valueof value=&quot;${numPages}&quot;/&gt;</pre>
<p>
  <br />Here is an example of how to use JSTL 1.1 and DSPEL to get the size of a collection. </p>
<p></p>
<pre>  &lt;dspel:getvalueof param=&quot;book.pages&quot; var=&quot;pages&quot;
                    vartype=&quot;java.util.Collection&quot;/&gt;
  Number of Pages: &lt;c:out value=&quot;${fn:length(pages)}&quot;/&gt;</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2008/08/22/trim-white-space-from-jsp/' rel='bookmark' title='Permanent Link: Trim White Space from JSP'>Trim White Space from JSP</a></li>
<li><a href='http://betweengo.com/2009/07/24/atg-foreach-output-with-separators-between-items/' rel='bookmark' title='Permanent Link: ATG ForEach Output with Separators Between Items'>ATG ForEach Output with Separators Between Items</a></li>
<li><a href='http://betweengo.com/2008/07/17/jumping-within-page-from-dropdown/' rel='bookmark' title='Permanent Link: Jumping to different parts of a page using a dropdown'>Jumping to different parts of a page using a dropdown</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/15/size-of-collection-jsp-dsp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing RepositoryItems with JSTL</title>
		<link>http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/</link>
		<comments>http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/#comments</comments>
		<pubDate>Sat, 10 May 2008 04:32:25 +0000</pubDate>
		<dc:creator>Frank Kim</dc:creator>
				<category><![CDATA[JSTL]]></category>
		<category><![CDATA[Page Development]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[ATG]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>

		<guid isPermaLink="false">http://betweengo.com/?p=181</guid>
		<description><![CDATA[Often we are accessing repository items in a JSP page like this.
  &#60;dspel:droplet name="RQLQueryForEach" var="query"&#62;
    &#60;dspel:param name="repository" bean="/betweengo/repository/Repository"/&#62;
    &#60;dspel:param name="itemDescriptor" value="Account"/&#62;
    &#60;dspel:param name="queryRQL" value="ALL"/&#62;
    &#60;dspel:setvalue param="account" paramvalue="element"/&#62;
    &#60;dspel:oparam name="output"&#62;
      &#60;dspel:valueof param="account.name"/&#62;&#60;br/&#62;
    [...]


Related posts:<ol><li><a href='http://betweengo.com/2009/02/18/dynamicbeanmap/' rel='bookmark' title='Permanent Link: DynamicBeanMap'>DynamicBeanMap</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Permanent Link: Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='Permanent Link: ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Often we are accessing repository items in a JSP page like this.</p>
<pre>  &lt;dspel:droplet name="RQLQueryForEach" var="query"&gt;
    &lt;dspel:param name="repository" bean="/betweengo/repository/Repository"/&gt;
    &lt;dspel:param name="itemDescriptor" value="Account"/&gt;
    &lt;dspel:param name="queryRQL" value="ALL"/&gt;
    &lt;dspel:setvalue param="account" paramvalue="element"/&gt;
    &lt;dspel:oparam name="output"&gt;
      &lt;dspel:valueof param="account.name"/&gt;&lt;br/&gt;
    &lt;/dspel:oparam&gt;
  &lt;/dspel:droplet&gt;</pre>
<p>With JSTL we could try to display the name like this.</p>
<pre>      &lt;c:out value="${query.account.name}"/&gt;</pre>
<p>If you are using JSP 2.0 you can display it even more simply.</p>
<pre>      ${query.account.name}</pre>
<p>However since account is a RepositoryItem object and there is no get method for the name property (i.e. it&#8217;s not a JavaBean object) the above will fail and produce an exception.</p>
<p>To get around this you can extend ATG&#8217;s RQLQueryForEach class by overriding the protected setElementParameter.  In addition to setting the element parameter in the request you can set a new parameter which we will call &#8220;item&#8221;.  This item is of class atg.beans.DynamicBeanMap and wraps a RepositoryItem.</p>
<pre>public class RQLQueryForEachEL extends RQLQueryForEach {
  protected void setElementParameter(DynamoHttpServletRequest pRequest,
                                     String pElementName, Object pValue) {
    super.setElementParameter(pRequest, pElementName, pValue);
    DynamicBeanMap itemBean = new DynamicBeanMap(pValue, true);
    pRequest.setParameter("item", itemBean);
  }
}</pre>
<p>Now we can access the repository item with JSTL like this.</p>
<pre>      ${query.item.name}</pre>


<p>Related posts:<ol><li><a href='http://betweengo.com/2009/02/18/dynamicbeanmap/' rel='bookmark' title='Permanent Link: DynamicBeanMap'>DynamicBeanMap</a></li>
<li><a href='http://betweengo.com/2008/04/29/comparison-of-dsp-and-dspel/' rel='bookmark' title='Permanent Link: Comparison of DSP and DSPEL'>Comparison of DSP and DSPEL</a></li>
<li><a href='http://betweengo.com/2009/08/12/atg-currency-converter-not-working-with-jstl-c-set/' rel='bookmark' title='Permanent Link: ATG Currency Converter Not Working With JSTL c:set'>ATG Currency Converter Not Working With JSTL c:set</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://betweengo.com/2008/05/09/accessing-repositoryitems-with-jstl/feed/</wfw:commentRss>
		<slash:comments>1</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! -->