<?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>techtamasha.com &#187; Struts</title>
	<atom:link href="http://www.techtamasha.com/category/struts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techtamasha.com</link>
	<description>a new play everyday</description>
	<lastBuildDate>Fri, 13 Jan 2012 09:21:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Struts 2 enum form value</title>
		<link>http://www.techtamasha.com/struts-2-enum-form-value/138</link>
		<comments>http://www.techtamasha.com/struts-2-enum-form-value/138#comments</comments>
		<pubDate>Sun, 01 Aug 2010 19:26:36 +0000</pubDate>
		<dc:creator>Nischal Shetty</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[enum form bean]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[struts 2 enum action]]></category>
		<category><![CDATA[struts enum]]></category>

		<guid isPermaLink="false">http://www.techtamasha.com/?p=138</guid>
		<description><![CDATA[If you want to use enums in jsps while employing the struts 2 framework, add the following in your xwork-conversion.properties file: java.lang.Enum = com.opensymphony.xwork2.util.EnumTypeConverter]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.techtamasha.com%2Fstruts-2-enum-form-value%2F138&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Struts 2 enum form value" data-url="http://www.techtamasha.com/struts-2-enum-form-value/138" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>If you want to use enums in jsps while employing the struts 2 framework, add the following in your <strong>xwork-conversion.properties</strong> file:</p>
<p><span style="color: #ff0000;">java.lang.Enum = com.opensymphony.xwork2.util.EnumTypeConverter</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techtamasha.com/struts-2-enum-form-value/138/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Struts 2 test enum</title>
		<link>http://www.techtamasha.com/struts-2-test-enum/133</link>
		<comments>http://www.techtamasha.com/struts-2-test-enum/133#comments</comments>
		<pubDate>Sun, 01 Aug 2010 19:15:32 +0000</pubDate>
		<dc:creator>Nischal Shetty</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[enum compare struts]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[struts 2 enum]]></category>
		<category><![CDATA[struts enum]]></category>

		<guid isPermaLink="false">http://www.techtamasha.com/?p=133</guid>
		<description><![CDATA[In my Struts 2 app I needed to check for an enum value in the jsp. Using the struts &#60;s:if test=&#8221;"&#62; tag this can be done : &#60;s:if test=&#8217;#role.toString()!=&#8221;PAID&#8221;&#8216;&#62;&#60;/s:if&#62; Hope this helps out someone. What I&#8217;m doing is getting the string representation of the enum and comparing the same. I did not know we could [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.techtamasha.com%2Fstruts-2-test-enum%2F133&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Struts 2 test enum" data-url="http://www.techtamasha.com/struts-2-test-enum/133" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>In my Struts 2 app I needed to check for an enum value in the jsp. Using the struts &lt;s:if test=&#8221;"&gt; tag this can be done :</p>
<p><span style="color: #ff0000;">&lt;s:if test=&#8217;#role.toString()!=&#8221;PAID&#8221;&#8216;&gt;&lt;/s:if&gt; </span></p>
<p>Hope this helps out someone. What I&#8217;m doing is getting the string representation of the enum and comparing the same. I did not know we could do a <strong>toString()</strong> here, hence thought of blogging about it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techtamasha.com/struts-2-test-enum/133/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate dynamic id&#8217;s for struts html tags</title>
		<link>http://www.techtamasha.com/generate-dynamic-ids-for-struts-html-tags/72</link>
		<comments>http://www.techtamasha.com/generate-dynamic-ids-for-struts-html-tags/72#comments</comments>
		<pubDate>Tue, 23 Sep 2008 05:18:29 +0000</pubDate>
		<dc:creator>Nischal Shetty</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[dynamic style id struts tag]]></category>
		<category><![CDATA[generate id using scriptlet struts tag]]></category>
		<category><![CDATA[scriptlets in struts tag]]></category>
		<category><![CDATA[struts html generate dynamic id]]></category>
		<category><![CDATA[struts html tag dynamic style id]]></category>

		<guid isPermaLink="false">http://techtamasha.com/?p=72</guid>
		<description><![CDATA[Do you use struts tags to generate html content? If yes, then sooner or later you&#8217;ll come across a scenario where you would generate html elements with the same name but would need different id&#8217;s for each element. I faced a similar predicament recently. I had no other option but to use scriptlets to generate [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.techtamasha.com%2Fgenerate-dynamic-ids-for-struts-html-tags%2F72&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Generate dynamic id&#8217;s for struts html tags" data-url="http://www.techtamasha.com/generate-dynamic-ids-for-struts-html-tags/72" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Do you use struts tags to generate html content? If yes, then sooner or later you&#8217;ll come across a scenario where you would generate html elements with the same name but would need different id&#8217;s for each element. I faced a similar predicament recently. I had no other option but to use scriptlets to generate id&#8217;s for the html elements. However, I soon found out using scriptlets within the struts html tags isn&#8217;t really straight forward.</p>
<p>Here&#8217;s the code I tried in my first attempt:</p>
<p><span style="color: #339966;">&lt;%int i=0;%&gt;</span></p>
<p><span style="color: #339966;">//iteration logic here</span></p>
<p><span style="color: #339966;">&lt;html:text property=&#8221;example&#8221; styleid=&#8221;example&lt;%=i%&gt;&#8221;&gt;</span></p>
<p>Well, if you write the code as shown above, the html code generated would be :</p>
<p><span style="color: #339966;">&lt;input type=&#8221;text&#8221; name=&#8221;example&#8221; id = &#8220;example&lt;%=i%&gt;&#8221;&gt;</span></p>
<p>and not</p>
<p><span style="color: #339966;">&lt;input type=&#8221;text&#8221; name=&#8221;example&#8221; id=&#8221;example0&#8243;&gt;</span></p>
<p>To get the expected result, i.e. for the scriptlet to work inside the struts html tag, write as below:</p>
<p><span style="color: #339966;">&lt;html:text property=&#8221;example&#8221; styleid=&#8217;&lt;%=&#8221;example&#8221;+i%&gt;&#8217;</span></p>
<p>That&#8217;s it. If any of you ever find out a way to generate different id&#8217;s for html elements with the same name using strtus tags exclusively then do let me know <img src='http://www.techtamasha.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.techtamasha.com/generate-dynamic-ids-for-struts-html-tags/72/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

