<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
   <channel>
      <title>glassfish-webtier</title>
      <description>Aggregated feed from various developers working on GlassFish webtier</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=8uEA4dQi3RGq6caoTaoASA</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=8uEA4dQi3RGq6caoTaoASA&amp;_render=rss&amp;page=2" />
      <pubDate>Sat, 26 May 2012 05:15:02 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/GlassFish-webtier" /><feedburner:info uri="glassfish-webtier" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
         <title>Executing Groovy Programs in-memory</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/5ghAbSeOh40/executing-groovy-programs-memory</link>
         <description>&lt;p&gt;Now that we've gone over some &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/16/a-quick-introduction-to-the-groovy-language-part-1/"&gt;Groovy&lt;/a&gt; &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/17/a-quick-introduction-to-the-groovy-language-part-2/"&gt;basics&lt;/a&gt;, it's time to switch back to writing in the Java language, and talk about how to run Groovy programs inside your Java programs.  Like most general purpose programming languages, there's more than one way to do things in Groovy, and that's never more true when it comes to executing Scripts - I once counted 7 ways to use the String "System.exit(0)" to shut down the VM, and I'm quite sure that I missed a few.  For this example, we'll use the method I consider to be the best and most extensible, which uses the class GroovyShell.&lt;/p&gt;
&lt;p&gt;Before we get started, be sure to include the Groovy libraries in your Java class path, so that you can use the same classes as Groovy.  In the current distro, it's the file named groovy-all.jar.    Once that's there, you should be able to execute the following code:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;import groovy.lang.GroovyShell;&lt;br /&gt;import groovy.lang.Script;&lt;br /&gt;&lt;br /&gt;public class Test {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;GroovyShell shell = new GroovyShell();&amp;lt;/strong&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;shell.evaluate(&amp;quot;println &amp;#039;hello world&amp;#039;&amp;quot;);&amp;lt;/strong&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I won't bother including the surrounding cruft in the future, but wanted to illustrate that this is just a (very) simple Java program.  We create a GroovyShell object, and call the evaluate method on it, passing a String.  That String, in turn, is evaluated by the Groovy parser, a class is (invisibly) created, and the class is run - the end result is that "&lt;strong&gt;hello world&lt;/strong&gt;" is printed to std out.&lt;/p&gt;
&lt;p&gt;There's a problem with this code though - it's kinda slow.  About 10ms on my machine (for a warm run, where all the required classes are already loaded and initialized - the initialization is actually 300ms, but that's a one time hit).  Now, that might be perfectly acceptable for your application - but if you're going to be executing this thing multiple times, that could really add up in a multiuser environment.  One of the things that's happening here is a full compile of the generated script code.  And while compiler technology has certainly gotten faster in the last few years, it'd be nice to skip that step on occasion.  The GroovyShell API offers a way to separate out the compilation and execution steps.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;GroovyShell shell = new GroovyShell();&lt;br /&gt;&amp;lt;strong&amp;gt;Script script = shell.parse(&amp;quot;println &amp;#039;hello world&amp;#039;&amp;quot;);&amp;lt;/strong&amp;gt;&lt;br /&gt;&amp;lt;strong&amp;gt;script.run();&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here, we've separated out the compile phase from the run phase.  The compile phase still takes 10ms, but the run phase only takes whatever the Java class run time is.  In this case, it's a sub 1ms run time.  This separation also opens things up for us to use other APIs as well, and we're going to use this technique going forward.&lt;/p&gt;
&lt;p&gt;Under the hood, here's what's happening:  Groovy is taking your input String, and converting it into a class, of type Script.  Script contains a method, run.  The contents of that run method are populated with the parsed contents of the String you pass in as an argument.  So, when we call script.run(), the println method is called, which prints out the message.  One last important note is that the run method actually returns Object - so we can also use these scripts to compute values.  And if you don't specify a return, the final statement executed in the script will be automatically returned as the value.  Thus, if the final line in your script is "x &amp;lt; y", the run method will return a Boolean equal to whatever the result of the comparison is.  You can also define inline methods (as we did in &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/16/a-quick-introduction-to-the-groovy-language-part-1/"&gt;the intro post I did&lt;/a&gt;), and those methods will be placed on the generated Script - you can even access those methods via reflection.&lt;/p&gt;
&lt;p&gt;Next up, &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/04/14/groovy-bindings-or-adding-keywords-to-your-dsl/"&gt;using the Groovy Binding class&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;(As usual, this article is cross posted on &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/17/executing-groovy-programs-in-memory/"&gt;my main blog site&lt;/a&gt;.)&lt;/p&gt;</description>
         <guid isPermaLink="false">885091 at http://www.java.net</guid>
         <pubDate>Sat, 14 Apr 2012 22:37:07 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2012/04/14/executing-groovy-programs-memory</feedburner:origLink></item>
      <item>
         <title>A quick introduction to the Groovy language (part 2)</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/2TRt8nU2Zq4/quick-introduction-groovy-language-part-2</link>
         <description>&lt;p&gt;In my &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/16/a-quick-introduction-to-the-groovy-language-part-1/"&gt;previous post&lt;/a&gt;, I started with a simple Java program (which also worked in Groovy), and slowly stripped out the cruft until I was left with the following Groovy script:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;def name = &amp;#039;world&amp;#039;&lt;br /&gt;sayHello(name)&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;code class="prettyprint"&gt;&amp;lt;br /&amp;gt;&lt;/code&gt;
&lt;p&gt;Now, let's add a little change to use an array.  Since Groovy is a rough superset of Java, you might be tempted to do something like:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;String[] names = {&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;}&lt;br /&gt;&lt;br /&gt;for (String name : names) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;code class="prettyprint"&gt;&amp;lt;strong&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/strong&amp;gt;&lt;/code&gt;
&lt;p&gt;But this won't work.  This is one place where Java syntax differs from Groovy's. To create a static array, you'd instead do:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;String[] names = &amp;lt;strong&amp;gt;[&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&amp;lt;/strong&amp;gt;&lt;br /&gt;&lt;br /&gt;for (String name : names) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;As before, we can eliminate the type declarations:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;def&amp;lt;/strong&amp;gt; names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;for (&amp;lt;strong&amp;gt;def&amp;lt;/strong&amp;gt; name : names) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;But a more Groovy way of doing the same thing would be to use the "in" keyword:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;for (&amp;lt;strong&amp;gt;name in names&amp;lt;/strong&amp;gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Note that under the hood, this code is no longer creating an array - rather, Groovy is (invisibly) creating an ArrayList.  This gives us a number of new options - for instance, sorting:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;names.sort()&lt;br /&gt;&amp;lt;/strong&amp;gt;&lt;br /&gt;for (name in names) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You can also add and remove entries to the list, like so:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;names += &amp;#039;Jim&amp;#039;&lt;br /&gt;names -= &amp;#039;SintSi&amp;#039;&amp;lt;/strong&amp;gt;&lt;br /&gt;names.sort()&lt;br /&gt;&lt;br /&gt;for (name in names) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sayHello(name)&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;But this still isn't the way that many Groovy coders would do it. They'd probably use the built in method each, which takes a closure as an argument.  If you aren't already familiar with closures (I knew them already from JavaScript), they're similar in many ways to method pointers.  And you might as well start learning about them, they're coming to Java (&lt;a rel="nofollow" target="_blank" href="http://openjdk.java.net/projects/lambda/"&gt;finally&lt;/a&gt;).  To use a closure, you define it using enclosing curly braces, and you can call it with the call method, like so:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;def clos = {name -&amp;amp;gt; sayHello(name)}&lt;br /&gt;clos.call(&amp;#039;world&amp;#039;)&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This will print "Hello world!".  Note that if you're trying this in groovyConsole, you'll see an additional value at the end - this is because Groovy scripts always return the last value as the return value, and groovyConsole is showing you the value of the names ArrayList.  In this example, the "name -&amp;gt;" preamble defines a single parameter that the closure takes.  Now let's use the closure with the each method:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;names += &amp;#039;Jim&amp;#039;&lt;br /&gt;names -= &amp;#039;SintSi&amp;#039;&lt;br /&gt;names.sort()&lt;br /&gt;&lt;br /&gt;def clos = {name -&amp;amp;gt; sayHello(name)}&lt;br /&gt;&amp;lt;strong&amp;gt;names.each(clos)&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Under the covers, names.each is iterating through the collection, and passing each value to the closure as the first parameter, just as in our previous example.  We can simplify this by creating the closure in place.  And since in Groovy, method parenthesis are optional when the method takes one or more parameters, we can say:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;names += &amp;#039;Jim&amp;#039;&lt;br /&gt;names -= &amp;#039;SintSi&amp;#039;&lt;br /&gt;names.sort()&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;names.each {name -&amp;amp;gt; sayHello(name)}&amp;lt;/strong&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Which is pretty darn readable.  One more thing:  by default, the first parameter of a closure is named "it".  So, you could instead say:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def names = [&amp;quot;SintSi&amp;quot;, &amp;quot;Kaitlyn&amp;quot;, &amp;quot;Keira&amp;quot;]&lt;br /&gt;&lt;br /&gt;names += &amp;#039;Jim&amp;#039;&lt;br /&gt;names -= &amp;#039;SintSi&amp;#039;&lt;br /&gt;names.sort()&lt;br /&gt;&lt;br /&gt;names.each {&amp;lt;strong&amp;gt;sayHello(it)&amp;lt;/strong&amp;gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;That's it for now.  If you've followed along so far, you've gotten more than enough Groovy under your belt to deal with anything you might see in my coming posts, as well as being able to say "Sure, more or less", when someone says "Do you know any Groovy?"&lt;/p&gt;
&lt;p&gt;(As usual, this article is cross posted on &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/17/a-quick-introduction-to-the-groovy-language-part-2/"&gt;my main blog site&lt;/a&gt;.)&lt;/p&gt;</description>
         <guid isPermaLink="false">884342 at http://www.java.net</guid>
         <pubDate>Sat, 14 Apr 2012 22:35:44 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2012/04/14/quick-introduction-groovy-language-part-2</feedburner:origLink></item>
      <item>
         <title>A quick introduction to the Groovy language (part 1)</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/Yo1gyFcdNWo/quick-introduction-groovy-language-part-1</link>
         <description>&lt;p&gt;Before I start talking about using Groovy's capabilities to create a DSL (mostly in Java), let's take a few minutes to go over what Groovy is.&lt;/p&gt;
&lt;p&gt;Groovy is a general purpose scripting language which runs on the JVM, and can largely be viewed as a superset of Java.  Take the following program:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;public class Hello {&lt;br /&gt;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void sayHello() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Hello &amp;quot;+getName()+&amp;quot;!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setName(String name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.name = name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getName() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.setName(&amp;quot;world&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is this a Groovy program or a Java program?  Yes, it is - it will compile and run in both.  This basic program is a bit wordy, and we can certainly do things more simply in Java, but this contains a number of patterns that you'd commonly see, including the use of the bean pattern, as well as the use of the main method to make the class executable via the java command line program.    When we run it, it simply prints out "Hello world!", as is customary in these sorts of things.&lt;/p&gt;
&lt;p&gt;To try this out in Java, you can use your favorite IDE.  You can also use an IDE to try this in Groovy, but you may just want to use the groovyConsole program, which is available as part of the GDK.  &lt;a rel="nofollow" target="_blank" href="http://groovy.codehaus.org/Download"&gt;Download it now&lt;/a&gt;, and play along via cut and paste...&lt;/p&gt;
&lt;p&gt;Now, as I said, Groovy is a rough superset of Java - one difference is that things are public by default.  That means we could just as easily say the following:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;lt;strong&amp;gt;class&amp;lt;/strong&amp;gt; Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;void&amp;lt;/strong&amp;gt; sayHello() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Hello &amp;quot;+getName()+&amp;quot;!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;void&amp;lt;/strong&amp;gt; setName(String name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.name = name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;String&amp;lt;/strong&amp;gt; getName() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;static void&amp;lt;/strong&amp;gt; main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.setName(&amp;quot;world&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Accessors and mutators are automatically created for your class variables, so we can also shorten it by taking those out:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;class Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void sayHello() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Hello &amp;quot;+&amp;lt;strong&amp;gt;getName()&amp;lt;/strong&amp;gt;+&amp;quot;!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;hello.setName(&amp;quot;world&amp;quot;);&amp;lt;/strong&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we're getting somewhere.  In Groovy, System.out.println can be shortened to just "println" as a convenience, so you can also say:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;class Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void sayHello() {&lt;br /&gt;&amp;lt;strong&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello &amp;quot;+getName()+&amp;quot;!&amp;quot;);&lt;br /&gt;&amp;lt;/strong&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.setName(&amp;quot;world&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There's also a difference in how Groovy deals with String objects - double quote strings allow for variable substitution.  There's also single quote strings, which do not:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;class Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void sayHello() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;lt;strong&amp;gt;&amp;quot;Hello $name!&amp;quot;&amp;lt;/strong&amp;gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.setName(&amp;lt;strong&amp;gt;&amp;#039;world&amp;#039;&amp;lt;/strong&amp;gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Groovy also allows dot notation to get and set fields of classes, just like Java.  Unlike Java, this will actually go through the getter/setter methods (which, you'll recall, are automatically generated in our current example):&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;class Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void sayHello() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;hello.name = &amp;#039;world&amp;#039;&amp;lt;/strong&amp;gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Typing information is also optional - instead of specifying a type, you can just use the keyword def.  Use of def is mandatory for methods, but optional for parameters on those methods.  You should also use def for class and method variables.  While we're at it, let's take out those semicolons:  They're optional in Groovy.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;class Hello {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;def&amp;lt;/strong&amp;gt; sayHello(&amp;lt;strong&amp;gt;name&amp;lt;/strong&amp;gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static &amp;lt;strong&amp;gt;def&amp;lt;/strong&amp;gt; main(args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello hello = new Hello()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;strong&amp;gt;def&amp;lt;/strong&amp;gt; name = &amp;#039;world&amp;#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hello.sayHello(name)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;OK, that's nice, but we can get this even shorter. Because Groovy is a scripting language, there's automatically a wrapping class (called Script, which will become very important to us later). This wrapping class means that we can get rid of our own wrapping class, as well as the main method, like so:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;def sayHello(name) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; println(&amp;quot;Hello $name!&amp;quot;)&lt;br /&gt;}&lt;br /&gt;def name = &amp;#039;world&amp;#039;&lt;br /&gt;sayHello(name)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That's all for now, I'll do a second part to this later.  But for now, if someone asks you if you know Groovy, you can now say "Sure, a bit".&lt;/p&gt;
&lt;p&gt;Credit for the idea behind this post goes to &lt;a rel="nofollow" target="_blank" href="http://glaforge.appspot.com/"&gt;Guillaume Laforge&lt;/a&gt; - I saw him give a variation of this as an intro to his talk at JavaOne, and loved it.&lt;/p&gt;
&lt;p&gt;(As usual, this article is cross posted on &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/16/a-quick-introduction-to-the-groovy-language-part-1/"&gt;my main blog site&lt;/a&gt;.)&lt;/p&gt;</description>
         <guid isPermaLink="false">884335 at http://www.java.net</guid>
         <pubDate>Sat, 17 Mar 2012 15:51:40 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2012/03/17/quick-introduction-groovy-language-part-1</feedburner:origLink></item>
      <item>
         <title>DSLs with Groovy JavaOne talk</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/yEQQKjAJmzQ/dsls-groovy-javaone-talk</link>
         <description>&lt;p&gt;I've been neglecting my blog, but just a quick note to mention that my latest talk at JavaOne, DSLs with Groovy, is &lt;a rel="nofollow" target="_blank" href="http://www.slideshare.net/jimdriscoll/groovy-dsls-javaone-presentation"&gt;posted up on Slideshare&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The talk's designed for someone with no significant Groovy experience (unlike most Groovy DSL talks), so if it's interesting to you, check it out.&lt;/p&gt;
&lt;p&gt;I'm hoping (but not promising) to turn the talk into a series of Blog entries in the coming weeks.  So if you want, just wait, and I'll send you explanations in more digestible bits and pieces in the coming weeks.&lt;/p&gt;
&lt;p&gt;(As usual, this entry is cross posted to &lt;a rel="nofollow" target="_blank" href="https://jamesgdriscoll.wordpress.com/2012/03/10/dsls-with-groovy-javaone-talk/"&gt;my main blog site&lt;/a&gt;.)&lt;/p&gt;</description>
         <guid isPermaLink="false">884174 at http://www.java.net</guid>
         <pubDate>Sat, 10 Mar 2012 21:33:30 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2012/03/10/dsls-groovy-javaone-talk</feedburner:origLink></item>
      <item>
         <title>JSF 2 And HTML5 Server Sent Events</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/8RfL6ccUONk/jsf-2-and-html5-server-sent-events-0</link>
         <description>&lt;div class="field field-type-filefield field-field-thumb-100x70"&gt;
    &lt;div class="field-items"&gt;
            &lt;div class="field-item odd"&gt;
                    &lt;img class="imagefield imagefield-field_thumb_100x70" width="125" height="154" alt="" src="http://www.java.net/sites/default/files/rogerk/rogerkitain.jpg?1325724360"/&gt;        &lt;/div&gt;
        &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Recently I had the privilege of writing an article for &lt;a rel="nofollow" target="_blank" href="http://jaxenter.com/java-tech-journal/"&gt;Java Tech Journal&lt;/a&gt; about using HTML5 &lt;a rel="nofollow" target="_blank" href="http://www.w3.org/TR/eventsource/"&gt;Server Sent Events&lt;/a&gt; in a JSF 2 User Interface.&amp;nbsp; I've made that article available &lt;a rel="nofollow" target="_blank" href="http://www.thethirdstone.com/?p=9"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
         <guid isPermaLink="false">880052 at http://www.java.net</guid>
         <pubDate>Thu, 05 Jan 2012 01:15:03 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2012/01/04/jsf-2-and-html5-server-sent-events-0</feedburner:origLink></item>
      <item>
         <title>Call for nominations for expert group members for Servlet 3.1 - JSR 340</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/2kVPP8mYRVY/call-nominations-expert-group-members-servlet-31-jsr-340</link>
         <description>&lt;p&gt;The JSR for the next revision of Servlet specification - Servlet 3.1 is approved and we are now in the process of forming the expert group. If you would like to contribute to the development of the next version of the servlet specification, please nominate yourself and, if possible, please explain how you plan to contribute to the specification.&lt;/p&gt;
&lt;p&gt;If you would like to track the progress of the spec, and see the folowings of the JSR, the spec will now be done using java.net infrastructure. Anyone can sign up to the users mailing list of the &lt;a rel="nofollow" target="_blank" href="http://servlet-spec.java.net"&gt;servlet-spec.java.net&lt;/a&gt; project and will be able to see the proceedings of the expert group mailing list. Please go the JCP site &lt;a rel="nofollow" target="_blank" href="http://jcp.org/en/jsr/summary?id=340"&gt;here&lt;/a&gt; and click on "I would iike to join this Expert Group". Please make sure that your JSPA is up-to-date. Feel free to provide feedback directly to me if you rather prefer that. &lt;/p&gt;</description>
         <guid isPermaLink="false">790213 at http://www.java.net</guid>
         <pubDate>Sat, 09 Apr 2011 06:20:50 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2011/04/09/call-nominations-expert-group-members-servlet-31-jsr-340</feedburner:origLink></item>
      <item>
         <title>GlassFish 3.1: using the master password and managing instances</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/c7l5DNLX8Hg/glassfish-31-using-master-password-and-managing-instances</link>
         <description>&lt;p&gt;GlassFish 3.1 supports creating and managing instances on multiple hosts from a central location (the DAS).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GlassFish 3.1 supports creating and managing instances on multiple hosts from a central location (the DAS). The server software uses SSH to communicate to the remote systems where the instances reside and &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/dipol/entry/glassfish_3_1_using_ssh"&gt;Joe's blog&lt;/a&gt; contains useful information on setting up SSH in a way that GlassFish can take advantage.&amp;nbsp;&amp;nbsp;&amp;nbsp; In this blog I talk about managing those instances when the user sets the master password to something other than the default.&lt;/p&gt;
&lt;p&gt;It is recommended that users change the default master password for security reasons.&amp;nbsp; Since GlassFish never transmits the master password or associated file over the network, the user must take action on the remote hosts to allow the system to manage the instances from a central location.&amp;nbsp; Commands such as &lt;strong&gt;start-instance&lt;/strong&gt; do not have a mechanism that allows the user to enter the master password but they do look for a master password file in the agent directory of the node associated with that instance.&amp;nbsp; This means that each instance on that node uses the same master password.&amp;nbsp; We have updated the command &lt;strong&gt;change-master-password&lt;/strong&gt; so that it creates the&lt;strong&gt; master-password&lt;/strong&gt; file for a node. Commands with the --&lt;strong&gt;savemasterpassword&lt;/strong&gt; option will create or update the &lt;strong&gt;master-password&lt;/strong&gt; file.&lt;/p&gt;
&lt;p&gt;Let's look at an example.&amp;nbsp; In this case, I create a new domain setting the master password to 'welcome1'&amp;nbsp; and start the domain.&amp;nbsp; I create an SSH node for the remote host I plan to use for the instances. &amp;nbsp; I&amp;nbsp;then create an instance on a remote node using the command &lt;strong&gt;create-instance&lt;/strong&gt; which I run on the DAS.&amp;nbsp; &amp;nbsp; Note that I can create the instance from the DAS but I can not start it unless the master password for the instance matches the master password for the DAS.&amp;nbsp; At that point I have to go to the instance machine and run the &lt;strong&gt;change-master-password&lt;/strong&gt; command with the --&lt;strong&gt;savemasterpassword&lt;/strong&gt; option set to true so that the&lt;strong&gt; master-password &lt;/strong&gt;file is created in the node's agent directory.&amp;nbsp; Once I do that I can go to the DAS machine and manage the instance.&amp;nbsp; Since the master pasword is associated with the node I can then create additional instances from the DAS machine and start or stop them without having to go to the remote host.&amp;nbsp; I&amp;nbsp;have added the commands that need to be run below.&lt;/p&gt;
&lt;p&gt;1) Create and start a domain with the master-password set to &amp;quot;welcome1&amp;quot; using the command .&amp;nbsp; Note that I did not set a password for admin user.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;asadmin create-domain --savemasterpassword true domain2 &lt;br /&gt;
asadmin start-domain domain2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
2) Create an SSH node&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &amp;nbsp;asadmin create-node-ssh --nodehost glassfish1.sfbay.sun.com --installdir /export/glassfish3 node2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
3) Create an instance from the DAS.&amp;nbsp; This creates the instance configuration information and the instance file system.&lt;/p&gt;
&lt;p&gt;&lt;em&gt; asadmin create-instance --node node2 ins2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
4) At this point the instance is created but it can not be started by the &lt;strong&gt;start-instance&lt;/strong&gt; command because there is no &lt;strong&gt;master-password &lt;/strong&gt;file in the agent directory for that node. That file must exist and it must have the same password as the master password on the DAS. To create that file run the following command on the instance machine.&amp;nbsp; If I try to start the instance I get the following error:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;asadmin start-instance ins2&lt;br /&gt;
remote failure: Could not start instance ins2 on node node2 (glassfish1.sfbay.sun.com).&lt;/p&gt;
&lt;p&gt;Command failed on node node1 (glassfish1.sfbay.sun.com): The Master Password is required to start the domain.&amp;nbsp; No console, no prompting possible.&amp;nbsp; You should either create the domain with --savemasterpassword=true or provide a password file with the --passwordfile option.Command start-local-instance failed.&lt;/p&gt;
&lt;p&gt;To complete this operation run the following command locally on host glassfish1.sfbay.sun.com from the GlassFish install location /export/glassfish3:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;asadmin&amp;nbsp; start-local-instance --node node2 --sync normal ins2&lt;br /&gt;
Command start-instance failed.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Go to the instance machine (glassfish1.sfbay.sun.com in this case)&amp;nbsp; and create the master password file for node2 by typing the following command.&lt;/p&gt;
&lt;p&gt;
&lt;em&gt; asadmin change-master-password --savemasterpassword true --nodedir /export/glassfish3/glassfish/nodes node2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
Important note: At the prompt I have to enter the old master password ('welcome1') which is what I had set when I created domain2 on the DAS. It is not the default master password 'changeit'&amp;nbsp; because the keystore was copied over when the instance was created and it is encrypted with the master password from the DAS. So the passwords are the same but since &lt;strong&gt;start-instance&lt;/strong&gt; doesn't have an option to take the master password it looks for a file called&lt;strong&gt; master-password&lt;/strong&gt; in the agent directory to access the keystores. Once that file is created, &lt;strong&gt;start-instance&lt;/strong&gt; can be run centrally (from the DAS). &lt;/p&gt;
&lt;p&gt;5) Start the instance from the DAS&lt;/p&gt;
&lt;p&gt;&lt;em&gt; asadmin start-instance ins2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;At this point you can create additional instances from the DAS and start them without going to the instance machine.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A slightly different scenario is below.&amp;nbsp; In this case I will begin by creating a domain with the master password set to 'welcome1' as in the previous example, create an SSH node to point to the remote host where the instance will run but I will create the instance locally on the instance machine.&amp;nbsp; At some future time I want to manage the instance from the DAS so I still need the &lt;strong&gt;master-password&lt;/strong&gt; file created in the node's agent directory.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;On DAS machine: &lt;/p&gt;
&lt;p&gt;1) Create&amp;nbsp; and start a domain with the master-password set to &amp;quot;welcome1&amp;quot; using the command &lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;asadmin create-domain --savemasterpassword true domain2 &lt;br /&gt;
asadmin start-domain domain2 &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;2) Create an ssh node&amp;nbsp; pointing to the remote host where the instances will run.&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;asadmin create-node-ssh --nodehost glassfish1.sfbay.sun.com --installdir /export/glassfish3 node2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Now we move to the instance machine and create the instance locally and as long as there is no &lt;strong&gt;master-password&lt;/strong&gt; file in the node we need to create one. The command create-local-instance can do that for us. &lt;/p&gt;
&lt;p&gt;&lt;em&gt; asadmin --host DASHost create-local-instance --node node2 --savemasterpassword true insL2 &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In this case, the master password for the keystore in the instance is 'changeit' or the default. Nothing was copied over from the DAS so the password is what is on the instance machine. Again, once the file &lt;strong&gt;master-password&lt;/strong&gt; has been created with the passwordthat matches the one on the DAS, then instance insL2 can be administered from the DAS. Additional instances can be created, started and stopped from the DAS machine.&lt;/p&gt;
&lt;p&gt;If the master password is changed on the DAS then you must go to each  instance machine and run the &lt;strong&gt;change-master-password &lt;/strong&gt;command as in step 4 above to reset the master  password file for each node.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;</description>
         <guid isPermaLink="false">732398 at http://www.java.net</guid>
         <pubDate>Wed, 02 Mar 2011 20:38:25 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2011/03/02/glassfish-31-using-master-password-and-managing-instances</feedburner:origLink></item>
      <item>
         <title>JSF Hudson View Support</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/CteQOdns3IE/jsf-hudson-view-support-1</link>
         <description>&lt;p&gt;Recently, we've enabled a "view" to simplify the monitoring of JSF automated tests through the Hudson framework. The introduction of clustering support in GlassFish has expanded our JSF automated test suite coverage. The URL for the view is:&lt;br /&gt;
&lt;br/&gt;&lt;br /&gt;
&lt;br/&gt;&lt;br /&gt;
&lt;a rel="nofollow" target="_blank" href="http://hudson.glassfish.org/view/JSF%20Mojarra/" title="http://hudson.glassfish.org/view/JSF%20Mojarra/"&gt;http://hudson.glassfish.org/view/JSF%20Mojarra/&lt;/a&gt;&lt;br /&gt;
&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;On a side note - &lt;a rel="nofollow" target="_blank" href="http://jsf.java.net" title="http://jsf.java.net"&gt;http://jsf.java.net&lt;/a&gt; and &lt;a rel="nofollow" target="_blank" href="http://jsf-spec.java.net" title="http://jsf-spec.java.net"&gt;http://jsf-spec.java.net&lt;/a&gt; redirect to &lt;a rel="nofollow" target="_blank" href="http://javaserverfaces.java.net" title="http://javaserverfaces.java.net"&gt;http://javaserverfaces.java.net&lt;/a&gt; and &lt;a rel="nofollow" target="_blank" href="http://javaserverfaces-spec-public.java.net" title="http://javaserverfaces-spec-public.java.net"&gt;http://javaserverfaces-spec-public.java.net&lt;/a&gt; respectively.&lt;/p&gt;</description>
         <guid isPermaLink="false">732382 at http://www.java.net</guid>
         <pubDate>Mon, 14 Feb 2011 21:51:15 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2011/02/14/jsf-hudson-view-support-1</feedburner:origLink></item>
      <item>
         <title>Testing JSF</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/i9vFday5DKA/testing-jsf</link>
         <description>&lt;p&gt;It's been a while since I've blogged last (ok, it's been a year), but I recently came across a question that I have a little insight into, and I thought I'd tackle it briefly.&lt;/p&gt;
&lt;p&gt;The question was simple:  "How do I test my JSF application?"&lt;/p&gt;
&lt;p&gt;I've used two different test frameworks to do so, and besides being two of the most popular, they also offer a good example of the two different patterns used for Web testing.  The two programs are &lt;a rel="nofollow" target="_blank" href="http://htmlunit.sourceforge.net/"&gt;HTMLUnit&lt;/a&gt; and &lt;a rel="nofollow" target="_blank" href="http://seleniumhq.org/"&gt;Selenium&lt;/a&gt;.  (Please note, there are certainly others -  &lt;a rel="nofollow" target="_blank" href="http://kenai.com/projects/facestester"&gt;FacesTester&lt;/a&gt;, and &lt;a rel="nofollow" target="_blank" href="http://jboss.org/jsfunit"&gt;JSFUnit&lt;/a&gt; (which actually uses/extends HTMLUnit),  to name just two - but I'm going to stick to the two that I've used.)&lt;/p&gt;
&lt;p&gt;HTMLUnit is a framework which uses browser simulation to test web pages - this means that no browser is launched, which also means that you can do things like test IE7 on Linux without a copy of Windows, as well as running testing in "headless mode", meaning that you don't even need a windowing system to be running (which is handy, and also very efficient for performance).  There are downsides to this, of course - for one, it's possible that the simulation may not be perfect (though I've never found a case where it wasn't).  The other disadvantage is that you can't actually see what's going on during testing, which can be awkward when figuring out why your test failed.    HTMLUnit supports emulating FF2, FF3, FF3.6, IE6, IE7, and IE8.&lt;/p&gt;
&lt;p&gt;Selenium, on the other hand, uses browser automation - meaning that it's actually using the browser you're testing your web app in.  But that, in turn, means you'll need different browsers installed to test - and in Windows, that means that you'll also need multiple machines to test all the myriad versions of IE.  And since you're running a browser in a windowing system, the machine requirements are also a little more substantial.  I've also found that configuring the browsers to be a bit tricky at times.  However, any inconvenience in setup is more than made up for by the &lt;a rel="nofollow" target="_blank" href="http://seleniumhq.org/projects/ide/"&gt;Selenium IDE&lt;/a&gt;, which is really just a Firefox plugin that records mouse and keyboard actions for later playback.  Selenium supports automation of FF2, FF3, IE7, IE8, Safari2, and Safari3.&lt;/p&gt;
&lt;p&gt;In both frameworks, you use their Java API to get a copy of a webpage, find components on that page (such as a button), and perform actions on those components (such as a click).  As such, the usage of both is pretty easy, and I'm not going to give a introductory tutorial of either.  (Selenium also offers a couple of other automation scripting methods in addition to Java, though I've never used them, so the topic is really much too big for a simple blog post.)&lt;/p&gt;
&lt;h3&gt;Which should you use?&lt;/h3&gt;
&lt;p&gt;I suspect that if you're writing your first JSF test, Selenium is really the way to go, for one simple reason:  JSF id generation.  As I'm sure you know already, every HTML tag can have an id, and that id needs to be unique on that page.  For both APIs, the simplest way to find those tags within your code is to use the id.  There's just one problem:  the id that's in the generated HTML may be quite different from the id you use in your JSF page.&lt;/p&gt;
&lt;p&gt;Take this (simplified) example:&lt;/p&gt;
&lt;code class="prettyprint"&gt;&amp;amp;lt;h:form id=&amp;quot;frm&amp;quot;&amp;amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class="prettyprint"&gt;&amp;nbsp; &amp;amp;lt;h:outputText id=&amp;quot;out&amp;quot; value=&amp;quot;#{whatever}&amp;quot;&amp;amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class="prettyprint"&gt;&amp;amp;lt;/h:form&amp;amp;gt;&lt;/code&gt;
&lt;p&gt;Now, say you wish to read the contents of the outputText...  What id would you use?  Answer:  "frm:out".  Because templating can be used to insert one page into another, and all id's need to be unique on the page, JSF has the idea of a "naming container" - every component inside a naming container has its naming container id prepended to the id of the component itself.  A form is one such naming container, but there are many more.&lt;/p&gt;
&lt;p&gt;Now, it's generally possible to figure out what the id will be (though not always easy, given some component libraries), so probably the easiest way to find the component's id would be to use the Selenium IDE, and use it to find the id's of the generated code.  The other ways to do this would be to use View Source on your browser, or dump the page contents in the Java code that you're creating to System.out, and examine it that way.&lt;/p&gt;
&lt;p&gt;Other factors may influence your decision, of course.  HTMLUnit has &lt;strong&gt;much&lt;/strong&gt; better support for Ajax, Selenium has (somewhat feeble) support for Webkit based browsers, which HTMLUnit has none.&lt;/p&gt;
&lt;p&gt;Anyhow, as I mentioned, I'm hardly an expert in this area, but I thought I knew enough to at least be helpful to the novice.  If you're not a novice, and you've got any additional comments (such as corrections or additional frameworks that folks should check out), please comment...&lt;/p&gt;
&lt;p&gt;(Note:  This post is crossposted to my &lt;a rel="nofollow" target="_blank" href="http://jamesgdriscoll.wordpress.com/"&gt;personal blog)&lt;/a&gt;&lt;/p&gt;</description>
         <guid isPermaLink="false">732342 at http://www.java.net</guid>
         <pubDate>Sat, 22 Jan 2011 21:16:33 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2011/01/22/testing-jsf</feedburner:origLink></item>
      <item>
         <title>JSR 330 Style Injection Support For JSF Managed Beans</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/ZEnIReFSp0k/jsr-330-style-injection-support-jsf-managed-beans</link>
         <description>&lt;p&gt;One of the features that had been lacking in JSF has been the ability to use the JSR 330 @Inject annotation for injecting object instances into JSF managed beans.&amp;nbsp; The feature now has been enabled in GlassFish 3.1 - starting with the latest July 22 nightly builds, or a current source build.&amp;nbsp; So now, you should be able to use it in a JSF managed bean as follows:&lt;/p&gt;
&lt;table cellspacing="1" cellpadding="1" border="1" style="width:355px;height:22px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td bgcolor="#ffffcc"&gt;
&lt;p&gt;&lt;strong&gt;import javax.inject.Inject;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;....&lt;/p&gt;
&lt;p&gt;@ManagedBean&lt;br /&gt;
            @SessionScoped&lt;br /&gt;
            &amp;nbsp;&lt;/p&gt;
&lt;p&gt;public class UserNumberBean implements Serializable {&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;@Inject&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp; private Count count;&lt;/strong&gt;&lt;br /&gt;
            ...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getCount() {&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (null != &lt;strong&gt;count&lt;/strong&gt;) {&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;strong&gt;count&lt;/strong&gt;.getCount();&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;quot;&amp;quot;;&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
            ...&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
         <guid isPermaLink="false">453062 at http://www.java.net</guid>
         <pubDate>Fri, 23 Jul 2010 17:58:11 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2010/07/23/jsr-330-style-injection-support-jsf-managed-beans</feedburner:origLink></item>
      <item>
         <title>GlassFish 3.1 m2 supports creating and starting instances on remote hosts.</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/SnDPt61RR64/glassfish-31-m2-supports-creating-and-starting-instances-remote-h</link>
         <description>&lt;p&gt;One of the main features in GlassFish 3.1 is clustering and for m2 we have added support for creating and starting instances on remote hosts.&amp;nbsp; The underying GlassFish 3.1 code uses SSH to connect to the remote hosts and introduces the concept of a node which is used by the system to deterimine where the instances will be created or started. At this time the only connection type supported is SSH.&amp;nbsp; Users now have a few new commands to manage nodes.&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;create-node-ssh&lt;/strong&gt;&amp;nbsp; creates a node that describes the hostname where the instance will run and location of GlassFish installation. &amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;delete-node-ssh&lt;/strong&gt; and&lt;strong&gt; list-nodes&lt;/strong&gt; are useful in deleting and listing nodes respectfully.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Below is a simple example of creating a cluster, creating an instance and starting the instance all from the administration host or the DAS (Domain Administration System).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First, some assumptions about the setup for GlassFish.&amp;nbsp; For m2, users will have to install and start GlassFish on all hosts that are part of the cluster. We do not currently support installing or starting GlassFish on a remote host and this is planned for a future release.&amp;nbsp; Second, SSH needs to be setup on both hosts as it is the underlying mechanism that is used to run commands on the remote hosts.&amp;nbsp; Currently we have only tested on UNIX (MacOs, Ubuntu, and OpenSolaris) but for m3 we will be including Windows as a tested platform.&amp;nbsp; There are many blogs that talk about setting up SSH so I won't go into all details here. I found &lt;a rel="nofollow" target="_blank" href="http://pkeck.myweb.uga.edu/ssh/"&gt;this blog &lt;/a&gt;useful.&amp;nbsp; To summarize how I set up the authentication key,&amp;nbsp; I used &lt;b&gt;ssh-keygen -t dsa &lt;/b&gt;to create the key file in my &lt;strong&gt;.ssh&lt;/strong&gt; dir. &amp;nbsp; Note: a limitation for m2 is that we don't support encrypted key files so you must&amp;nbsp; not set a passphrase when creating keys.&amp;nbsp; I then used &lt;strong&gt;scp&lt;/strong&gt; to copy the key file &lt;b&gt;id_dsa.pub &lt;/b&gt;to the host I want to log in to.&amp;nbsp; I put it in the &lt;span style="font-weight:bold;"&gt;.s&lt;/span&gt;&lt;strong&gt;sh&lt;/strong&gt; dir and called it &lt;b&gt;authorized_keys2.&amp;nbsp;&lt;/b&gt; Also I had the same username on both systems which further simplified things.&amp;nbsp; At that point I can ssh into the remote host without supplying a password.&amp;nbsp; This is a good test to see if you are set up correctly before you try the commands below.&lt;/p&gt;
&lt;p&gt;In this example, we will create a cluster with two machines, &lt;em&gt;foo&lt;/em&gt; and &lt;em&gt;bar&lt;/em&gt;.&amp;nbsp; &lt;em&gt;foo&lt;/em&gt; will be the DAS which has all the information about the servers running in the cluster.&amp;nbsp; Recall that in this release we have introduced a new CLI command &lt;strong&gt;create-node-ssh&lt;/strong&gt; to create a node which is used to locate the host for a particular instance.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;create-node-ssh&lt;/strong&gt; has three required parameters,&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;--nodehost:&amp;nbsp; the name of the host where the instance lives&lt;/li&gt;
&lt;li&gt;--nodename:&amp;nbsp; the GlassFish installation directory&lt;/li&gt;
&lt;li&gt;--name:&amp;nbsp; name of the node being created&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;All other parameters will default to reasonable values.&amp;nbsp; We default the ssh port to 22. If no username is provided we default to the user running the command and we look for the key file in the home directory of that user.&amp;nbsp; All instances are now required to reference a node element which GlassFish uses to determine where the instance will be created or started.&amp;nbsp; This means that we have added a &lt;strong&gt;--node&lt;/strong&gt; option to the &lt;strong&gt;create-instance&lt;/strong&gt; command. As a convience we have a default node for &lt;em&gt;localhost&lt;/em&gt; so if the&amp;nbsp; node option is not specified when the instance is created a reference is automatically added&amp;nbsp; to the &lt;em&gt;localhost&lt;/em&gt; node.&amp;nbsp; The localhost node contains only a node name of localhost.&amp;nbsp; We can get the GlassFish installation directory from the server.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let's see how this works.&amp;nbsp; All commands are run on the DAS machine and as long as there is SSH access to the other host we will be able to create and start instances.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Install and start GlassFish 3.1 m2 on &lt;em&gt;foo&lt;/em&gt; and &lt;em&gt;bar&lt;/em&gt;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On host &lt;em&gt;foo&lt;/em&gt; (the DAS) we run all the commands.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin create-cluster c1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Command create-cluster executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin create-node-ssh --nodehost=bar --nodehome=/home/cmott/glassfishv3/glassfish nodebar&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Command create-node-ssh executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin list-nodes&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;
localhost&lt;br /&gt;
nodebar&lt;/p&gt;
&lt;p&gt;Command list-nodes executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin create-instance --cluster=c1 --node=nodebar instance1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Command create-instance executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin create-instance --cluster=c1 instance2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Command create-instance executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin list-instances&lt;/strong&gt;&lt;br /&gt;
instance2 not running&lt;br /&gt;
instance1 not running&lt;/p&gt;
&lt;p&gt;Command list-instances executed successfully.&lt;/p&gt;
&lt;p&gt;$&lt;strong&gt;asadmin start-cluster c1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/strong&gt;Command&lt;strong&gt; &lt;/strong&gt;start-cluster executed successfully.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$asadmin list-instances&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;instance2 running&lt;br /&gt;
instance1 running&lt;/p&gt;
&lt;p&gt;
Command list-instances executed successfully.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Notice that when creating instance2 I did not specify a node and so the default node &lt;em&gt;lcoalhost&lt;/em&gt; is used.&amp;nbsp; In a future release of GlassFish, &lt;strong&gt;create-node-ssh &lt;/strong&gt;will test if a connection can be made to the remote host when the node is created.&amp;nbsp; If not reachable the user can create the node if the &lt;strong&gt;--force&lt;/strong&gt; option is set to &lt;strong&gt;true&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
         <guid isPermaLink="false">435685 at http://www.java.net</guid>
         <pubDate>Thu, 24 Jun 2010 16:46:06 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2010/06/24/glassfish-31-m2-supports-creating-and-starting-instances-remote-h</feedburner:origLink></item>
      <item>
         <title>JSF 2 / HTML 5 Jazoon 2010 Slides Posted</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/TeMt8nGPg1s/jsf-2-html-5-jazoon-2010-slides-posted</link>
         <description>&lt;p&gt;My slides for &amp;quot;Exploring HTML5 With JavaServer Faces 2.0&amp;quot; slides are  available at Slideshare: Available at: &lt;a rel="nofollow" target="_blank" href="http://www.slideshare.net/rkitain/jsf2-html5jazoon" title="http://www.slideshare.net/rkitain/jsf2-html5jazoon"&gt;http://www.slideshare.net/rkitain/jsf2-html5jazoon&lt;/a&gt;&lt;/p&gt;</description>
         <guid isPermaLink="false">427935 at http://www.java.net</guid>
         <pubDate>Wed, 09 Jun 2010 15:06:10 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2010/06/09/jsf-2-html-5-jazoon-2010-slides-posted</feedburner:origLink></item>
      <item>
         <title>Testing HTML5 Feature Availability In Browsers</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/I1cyPpsnWwA/testing-html5-feature-availability-browsers</link>
         <description>&lt;p&gt;The ongoing &lt;a rel="nofollow" target="_blank" href="http://dev.w3.org/html5/spec/Overview.html"&gt;HTML5 specification&lt;/a&gt; offers many features to promote a &amp;quot;rich&amp;quot;   web user experience.&amp;nbsp; If you've worked wth HTML5, you know that some   features are available in some browsers and not available in others.&amp;nbsp;   Here's a handy tool to tell you the HTML5 features that are available in   your favorite browser.&amp;nbsp; All you need to do is fire up a browser and  visit: &lt;a rel="nofollow" title="http://html5test.com" target="_blank" href="http://html5test.com/"&gt;http://html5test.com&lt;/a&gt;  .&amp;nbsp; With this,  you'll see a nice breakdown of the features that are  available in the  current browser version.&amp;nbsp; It will also tell you, the  strengh of support  for each feature.&amp;nbsp; For example, for the current  version of Firefox I'm  using (3.6.3), it says it has a total score of  101 out of 160.&amp;nbsp; Here's a breakdown for each of the current browsers I'm using:&lt;/p&gt;
&lt;table cellspacing="1" cellpadding="1" border="1" width="200"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Firefox 3.6.3&lt;/td&gt;
&lt;td&gt;101/160&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Safari 4.0.3&lt;/td&gt;
&lt;td&gt;115/160&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Opera 10.10&lt;/td&gt;
&lt;td&gt;&amp;nbsp; 38/160&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chrome 5.0.375.55 beta&lt;/td&gt;
&lt;td&gt;142/160&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Of course if you really like an HTML5 feaure that is not available in your favorite browser, you can always check the &amp;quot;development&amp;quot; versions for the browser - as HTML5 support is still a work in progress.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
         <guid isPermaLink="false">418723 at http://www.java.net</guid>
         <pubDate>Tue, 25 May 2010 09:55:22 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2010/05/25/testing-html5-feature-availability-browsers</feedburner:origLink></item>
      <item>
         <title>JavaOne CFP Opens</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/9muZEKKBJxI/javaone-cfp-opens</link>
         <description>&lt;p&gt;Although I'm not involved in the talk selection process this year, I'm still paying attention to JavaOne.&lt;/p&gt;
&lt;p&gt;The &lt;a rel="nofollow" target="_blank" href="https://www28.cplan.com/cfp_prod/CFPLogin.jsp?wId=268225"&gt;Call For Papers&lt;/a&gt; appears to be open now, through March 14th. &lt;/p&gt;
&lt;p&gt;Be sure to read the &lt;a rel="nofollow" target="_blank" href="https://www28.cplan.com/cfp_prod/criteria.do?wId=72T23"&gt;Submission Criteria&lt;/a&gt; before submitting a proposal for a paper.  Trust me, it'll help your ideas get noticed.&lt;/p&gt;
&lt;p&gt;Good luck, everyone.&lt;/p&gt;</description>
         <guid isPermaLink="false">352221 at http://www.java.net</guid>
         <pubDate>Thu, 11 Feb 2010 20:15:56 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2010/02/11/javaone-cfp-opens</feedburner:origLink></item>
      <item>
         <title>HTML5 Semantic Tags</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/vccvsNuR9W0/html5-semantic-tags</link>
         <description>&lt;p&gt;Over the weekend, I was reading &lt;a rel="nofollow" target="_blank" href="http://diveintohtml5.org/"&gt;Mark Pilgrim's great book on HTML5&lt;/a&gt; - and when I got to the &lt;a rel="nofollow" target="_blank" href="http://diveintohtml5.org/semantics.html#new-elements"&gt;part about the semantic tags&lt;/a&gt;, I thought it might be worth a quick mention.&lt;/p&gt;
&lt;p&gt;In case you've missed out on HTML5 in general (and don't want to take the time to read that book I linked above), the idea behind semantic tags is that many sites use div blocks to mark out the same kinds of content, over and over.  Content like headers, footers, and nav bars.  Changing straight &amp;lt;div&amp;gt; tags to tags like &amp;lt;header&amp;gt;, &amp;lt;footer&amp;gt;, and &amp;lt;nav&amp;gt; is granting these tags semantic meaning, hence the name - semantic tags.&lt;/p&gt;
&lt;p&gt;Semantic tags are a great idea.  They offer a lot advantages over plain vanilla divs, especially for screen readers... but support in IE is pretty broken...  The essential problem is this:  unlike all other major browsers, IE doesn't know how to style unknown tags.  So the following code won't work:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;amp;lt;style&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .border {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; border: solid black;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;amp;lt;/style&amp;amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;amp;lt;section class=&amp;amp;quot;border&amp;amp;quot;&amp;amp;gt;test3&amp;amp;lt;/section&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ah, I hear the more informed folks in the audience say, there exists a library to fix this problem: &lt;a rel="nofollow" target="_blank" href="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt;the HTML5 Shiv&lt;/a&gt;.  You can use it like so:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;amp;lt;!--[if IE]&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;script src=&amp;amp;quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;![endif]--&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This simple script will allow styles to be placed on unknown tags in IE... So, that's a good start, but there are a few problems with it.  For one thing, it relies on JavaScript, so if JavaScript is disabled, your styling will fail catastrophically.  Similarly, applying print styles may not work, since JavaScript won't necessarily be run as part of the print process (note:  I haven't tested this fully, but that's sure what it looks like in brief testing).  There are reports that nesting seems to mess stuff up applying styles correctly, but my testing hasn't found anything broken in this way that isn't already broken in IE's CSS support.&lt;/p&gt;
&lt;p&gt;Of course, there is a way around even that:  If you are running JSF or some other server side processing on your backend, you could do User Agent detection, and emit &amp;lt;div&amp;gt;'s to IE and the semantic tags to all other browsers.  Then, by styling the tags solely with classes and ID's, it should be possible to make something that gets around the client side issues.  Here's a section from a component that does just that.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;@FacesComponent(value = &amp;amp;quot;navtag&amp;amp;quot;)&lt;br /&gt;public class NavTag extends UIComponentBase {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void encodeBegin(FacesContext context) throws IOException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolean isIE = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UIComponent component = getCurrentComponent(context);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String style = (String) component.getAttributes().get(&amp;amp;quot;style&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String styleClass = (String) component.getAttributes().get(&amp;amp;quot;styleClass&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ResponseWriter responseWriter = context.getResponseWriter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String ua = context.getExternalContext().getRequestHeaderMap().get(&amp;amp;quot;User-Agent&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ua != null &amp;amp;amp;&amp;amp;amp; ua.contains(&amp;amp;quot;MSIE&amp;amp;quot;) &amp;amp;amp;&amp;amp;amp; !ua.contains(&amp;amp;quot;Opera&amp;amp;quot;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isIE = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isIE) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.startElement(&amp;amp;quot;div&amp;amp;quot;, null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.startElement(&amp;amp;quot;nav&amp;amp;quot;, null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.writeAttribute(&amp;amp;quot;id&amp;amp;quot;, getClientId(context), &amp;amp;quot;id&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.writeAttribute(&amp;amp;quot;name&amp;amp;quot;, getClientId(context), &amp;amp;quot;clientId&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (styleClass != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.writeAttribute(&amp;amp;quot;class&amp;amp;quot;, styleClass, &amp;amp;quot;styleClass&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (style != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseWriter.writeAttribute(&amp;amp;quot;style&amp;amp;quot;, style, &amp;amp;quot;style&amp;amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Should JSF add these tags to JSF 2.1?  I'd love to hear your comments, below...&lt;/p&gt;</description>
         <guid isPermaLink="false">348831 at http://www.java.net</guid>
         <pubDate>Tue, 09 Feb 2010 02:06:46 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2010/02/08/html5-semantic-tags</feedburner:origLink></item>
      <item>
         <title>Progressive Enhancement with JSF</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/DjQLGeCDNsg/progressive-enhancement-jsf</link>
         <description>&lt;p&gt;&lt;a rel="nofollow"&gt;Progressive Enhancement&lt;/a&gt; is a philosophy of web design - start with simple pages, and build them up based on the capabilities of the browser viewing the page. It&amp;rsquo;s related to (and in some ways, the opposite of) the idea of Graceful Degradation, starting with a nice, fancy page, and dealing with any browser faults in an elegant manner.&lt;/p&gt;
&lt;p&gt;Prehaps the simplest example to see this in action is the case of JavaScript being disabled in the browser - this is occasionally true for certain corporate clients concerned about security, and sometimes the case for very old browsers.&lt;/p&gt;
&lt;p&gt;JSF handles this usecase pretty well - consider the following code:&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp; 1 &lt;br /&gt;
&amp;nbsp;&amp;nbsp; 2 &amp;lt;f:ajax render=&amp;quot;grace :text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; &amp;lt;h:selectBooleanCheckbox value=&amp;quot;#{grace.checked}&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 4 &amp;lt;/f:ajax&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This creates a checkbox input with an onclick event handler registered. If there&amp;rsquo;s no JavaScript enabled, it will continue to function as thought the ajax tag wasn&amp;rsquo;t there at all. But the user will need to submit the form with a button press...&lt;/p&gt;
&lt;p&gt;There is another way to handle this: we could instead create a link, which uses view parameters:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; 1 &amp;amp;lt;f:metadata&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;f:viewParam name=&amp;amp;quot;checked&amp;amp;quot; value=&amp;amp;quot;#{grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 3 &amp;amp;lt;/f:metadata&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 4 &amp;amp;lt;h:link value=&amp;amp;quot;check me&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;f:param name=&amp;amp;quot;checked&amp;amp;quot; value=&amp;amp;quot;#{!grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 6 &amp;amp;lt;/h:link&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That works, but isn&amp;rsquo;t as clean looking as the first, ajax method. Combining these approachs should provide a better user experience - and doing so isn&amp;rsquo;t especially difficult:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; 1 &amp;amp;lt;f:metadata&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;f:viewParam name=&amp;amp;quot;checked&amp;amp;quot; value=&amp;amp;quot;#{grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 3 &amp;amp;lt;/f:metadata&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 4 &amp;amp;lt;h:outputText id=&amp;amp;quot;text&amp;amp;quot; value=&amp;amp;quot;Checked: #{grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 5 &amp;amp;lt;h:form id=&amp;amp;quot;form&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;h:panelGroup id=&amp;amp;quot;grace&amp;amp;quot; layout=&amp;amp;quot;block&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;h:panelGroup id=&amp;amp;quot;default&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;h:link value=&amp;amp;quot;check me&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;f:param name=&amp;amp;quot;checked&amp;amp;quot; value=&amp;amp;quot;#{!grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/h:link&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/h:panelGroup&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;h:panelGroup id=&amp;amp;quot;enhanced&amp;amp;quot; style=&amp;amp;quot;display: none&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;f:ajax render=&amp;amp;quot;grace :text&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;h:selectBooleanCheckbox value=&amp;amp;quot;#{grace.checked}&amp;amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/f:ajax&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/h:panelGroup&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;script type=&amp;amp;quot;text/javascript&amp;amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var def = document.getElementById(&amp;amp;quot;form:default&amp;amp;quot;);&lt;br /&gt;&amp;nbsp; 19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var enh = document.getElementById(&amp;amp;quot;form:enhanced&amp;amp;quot;); &lt;br /&gt;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def.style.display = &amp;amp;quot;none&amp;amp;quot;;&lt;br /&gt;&amp;nbsp; 21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enh.style.display = &amp;amp;quot;block&amp;amp;quot;;&lt;br /&gt;&amp;nbsp; 22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/script&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/h:panelGroup&amp;amp;gt;&lt;br /&gt;&amp;nbsp; 24 &amp;amp;lt;/h:form&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;First, create two divs, one with the link and the other with the checkbox, which is hidden by default. If JavaScript is enabled, then hide the link and show the checkbox. This is the basic idea behind Progressive Enhancement - first, create something that you&amp;rsquo;ll be happy with in any browser, then add features (in this case, an Ajaxified checkbox) as needed.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all for today. One personal note: Today is my last day officially employed by Sun Microsystems - I wasn&amp;rsquo;t offered a position at Oracle, and I&amp;rsquo;m currently actively looking for something. Please feel free to checkout &lt;a rel="nofollow" target="_blank" href="http://jamesgdriscoll.com"&gt;my resume&lt;/a&gt;, and let me know if you know of any openings that you think might be a fit for me.&lt;/p&gt;</description>
         <guid isPermaLink="false">347539 at http://www.java.net</guid>
         <pubDate>Sun, 07 Feb 2010 08:09:49 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2010/02/07/progressive-enhancement-jsf</feedburner:origLink></item>
      <item>
         <title>IE, Memory Management, and You</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/T28bn3VTx1Q/ie-memory-management-and-you</link>
         <description>&lt;p&gt;In a &lt;a rel="nofollow" target="_blank" href="http://weblogs.java.net/blog/driscoll/archive/2009/10/19/request-aggregation-jsf-2-ajax"&gt;recent blog&lt;/a&gt;, commenters took me to task for a perceived IE 6 memory leak.  It wasn't actually there (they were wrong), but in attempting to prove myself right, I found a couple of memory leaks under IE in JSF's Ajax support.  Since I just spent a week learning how all this functioned, I thought I'd set it down so that others could learn from my efforts.&lt;/p&gt;
&lt;p&gt;
Now, none of the information that I'll present here is new - it's been discussed among Ajax programmers for at least the last 4 years.  If you're a web guru, it's likely that you're not going to learn anything new here (thought I'd welcome any additional information and corrections).   But at least a couple of the points I'll illustrate below are either poorly communicated or misunderstood.   I'll include a number of links at the end of this article.  There are also very significant differences between IE 8 (which mostly works), IE 7 (which is bad), and IE 6 (which is just awful).  I'll try to point out the differences as they matter for each.&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;Tools&lt;/h3&gt;
&lt;p&gt;First - use the right tool for the job:  In order to spot leaks, you'll need to download a tool that can detect them.  By all accounts, &lt;a rel="nofollow" target="_blank" href="http://home.orange.nl/jsrosman/"&gt;sIEve&lt;/a&gt; is the way to go.  It uses IE itself, and introspects to get it's data.  The UI is pretty primitive, but I can't recommend it enough - it's truely invaluable.  Since it uses IE for it's work, you'll need to run it on a machine that has IE6 installed - presumably in a VM.  You'll also want to have it running on a machine that has IE 7 and IE 8 as well, just to be sure.  XP fits nicely on a VM that runs on my Mac, and this is how I use it.&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;Cyclic Leak&lt;/h3&gt;
&lt;p&gt;Now that that's out of the way, it's time to talk about the very worst of the memory leaks in IE - the dreaded cyclic reference, which the commenters thought that I'd committed.  Under certain conditions, IE 6 will "leak" DOM nodes, retaining them, and the javascript objects that point to them, until the browser is either shut down, or crashes entirely due to lack of memory.  Ugh!  To understand how this happens, you really only need to know two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;IE 6 (and 7!) reportedly has very primitive garbage collection using reference counting&lt;/li&gt;
&lt;li&gt;There are two memory spaces in IE, one for JavaScript, and the other for the DOM, and they don't communicate well.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What could go wrong?  Well, lots.  The commenters thought that the rule was: A leak will occur if any reference is made in JavaScript to an element that isn't eventually set to null.  That's close, but not quite correct.  The real rule is: A leak will occur if the JavaScript code contains any reference to the DOM that isn't released in some way, either by going out of scope or being explicitly unset.  &lt;/p&gt;
&lt;p&gt;
When IE 6 sees a JavaScript variable that is pointing to something in the DOM (typically, an element or node), it will record that reference, and not collect it - even when you surf over to a new page.  And the DOM won't be collected, since there's a reference to it from JavaScript.   These two objects, and all the stuff that references them, will stick around until shutdown.  In IE 7, the geniuses at Microsoft saw the bug, and said "Hey, I know how to fix that, let's garbage collect everything when we leave the page.".  Nice improvement, but it still doesn't fix the bug, since if you're developing a page that is designed to be used for a long period of time (like many page-as-application apps are now), it'll still crash the browser.  Apparently, they saw the error of their ways eventually, since this behavior is no longer present in IE8.  (All this is confirmed by my testing with sIEve.)&lt;/p&gt;
&lt;p&gt;
So, in the example that had in my previous blog, there was no memory leak, because the variable that pointed to the element eventually went out of scope.  So - how to you create variables that don't go out of scope?  The easiest way is to put them in an object - this was the leak that I eventually found in JSF.  The fix there was to null out the object manually.  But there's another, more insidious way to create an object - create a closure.  That creates a function object implicitly under the window object, and that will never go out of scope.   But the key thing to remember is that you need to be aware of when things go out of scope when coding in IE, and act accordingly.&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;But wait!  There's more&lt;/h3&gt;
&lt;p&gt;If that was the only problem, life would have been fairly easy for me the last week.  But that's not the only bug that the Web Wizards of Redmond chose to deliver to their unsuspecting consumers.  There's another bug in IE (again, only in IE 6 and 7 - IE 8 appears to have fixed it per my testing), which also leaks DOM nodes that aren't cleaned up until you leave the page.  Apparently, when the IE DOM receives a call from the removeChild or replaceChild functions, it doesn't actually, err, remove the nodes.  It just leaves them there, hanging around the DOM like party guests that don't have the sense to leave after the host has started handing out coats.  While these nodes will eventually be cleaned up when the user leaves the page, this still causes problems for page-as-app programs, as in the cyclic leak for IE 7, above.  While the removeChild call is fairly notorious for this, I had to find out about replaceChild with my own testing (though I did find a few obscure references once I went looking for it).  &lt;/p&gt;
&lt;p&gt;
That means that instead of saying &lt;code class="prettyprint"&gt;node.parentNode.replaceChild(newNode, node)&lt;/code&gt;, you instead should  say something like: &lt;code class="prettyprint"&gt;node.parentNode.insertBefore(newNode, node); deleteNode(node);&lt;/code&gt; (with an appropriate if statement for isIE(), and a deleteNode function that doesn't use removeChild).  And instead of saying node.parentNode.removeChild(node); you instead are reduced to coding something like:  node.outerHTML = ''; (again, with browser check).  Except that when you combine that with IE's horrible problems with manipulating tables, it may fail.  So instead, you're probably better off with something like this:&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;lt;pre&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var temp = document.createElement(&amp;#039;div&amp;#039;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp.appendChild(node.parentNode.removeChild(node));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp.innerHTML = &amp;quot;&amp;quot;; // Prevent leak in IE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // at least we tried&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; deleteNode(temp);&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
Again, possibly with an isIE() check.&lt;/p&gt;
&lt;p&gt;
Hopefully you found this description of IE's Memory "Management" useful.  Here's a few of the links that I used for research, that I found the most helpful.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://home.orange.nl/jsrosman/"&gt;sIEve - the tool you should already have.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://www.quirksmode.org/blog/archives/2005/10/memory_leaks_li.html"&gt;Quirks blog link roundup of memory leak info.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/bb250448%28VS.85%29.aspx"&gt;Microsoft MSDN article on the topic.&lt;/a&gt;  Useful, even if it insultingly implies that it's your fault the browser is leaking.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
As always, I look forward to any comments.  Especially about this topic - I'm far from expert in this area.&lt;/p&gt;
&lt;p&gt;
UPDATE:  John Resig just posted about &lt;a rel="nofollow" target="_blank" href="http://ejohn.org/blog/deep-tracing-of-internet-explorer/"&gt;a very interesting looking tool&lt;/a&gt;.  Haven't checked it out yet, but if it's got him excited... &lt;/p&gt;</description>
         <guid isPermaLink="false">317866 at http://www.java.net</guid>
         <pubDate>Fri, 13 Nov 2009 20:59:01 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2009/11/13/ie-memory-management-and-you</feedburner:origLink></item>
      <item>
         <title>Mojarra 2.0.1 has shipped</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/FO_P9H5aPnU/mojarra-201-has-shipped</link>
         <description>&lt;p&gt;Just a short post to note that we've now shipped Mojarra 2.0.1.  This version fixes a very serious bug when running on Tomcat.  You can pick up the files from the &lt;a rel="nofollow" target="_blank" href="https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=11863&amp;amp;expandFolder=11863&amp;amp;folderID=11852"&gt;usual places&lt;/a&gt;, see the &lt;a rel="nofollow" target="_blank" href="https://javaserverfaces.dev.java.net/nonav/rlnotes/2.0.1/index.html"&gt;release notes&lt;/a&gt; for more information.&lt;/p&gt;
&lt;p&gt;If you're using GlassFish, and already running 2.0.0 (you leading edge adopter!), there's probably no reason to upgrade - though the new v3 (b69) has the updated jar, and it will be propagated via the usual Update Center distribution.&lt;/p&gt;</description>
         <guid isPermaLink="false">300040 at http://www.java.net</guid>
         <pubDate>Fri, 23 Oct 2009 21:10:46 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/driscoll/archive/2009/10/23/mojarra-201-has-shipped</feedburner:origLink></item>
      <item>
         <title>Context And Dependency Injection (JSR 299) And Servlets</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/vOPUgXEjydY/context-and-dependency-injection-jsr-299-and-servlets</link>
         <description>&lt;p&gt;I've had questions about how to inject Web Beans into servlets and whether that is supported.&amp;nbsp; In this entry I'll outline a method of accomplishing just that.&lt;br /&gt;
This is a simple login application that communicates to a servlet using Ajax calls from a JSP view.&amp;nbsp; I'm not going to focus on the view or the protocol (Ajax) that&amp;nbsp; is used to communicate with the servlet.&amp;nbsp; If you are interested in that, you can check out the source (instructions at the end of this post).&amp;nbsp; I'm going to focus on the servlet code and the supporting classes for the application.&amp;nbsp; The application just prompts for a user name / pasword, and pressing the submit button sends those values to a servlet.&amp;nbsp; First, let's take a look at some of the supporting code for the application:&lt;/p&gt;
&lt;h3&gt;Listing 1: Login Credentials&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:1277px;background-color:rgb(240, 248, 255);height:486px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansservlet;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import javax.enterprise.context.RequestScoped;&lt;/li&gt;
&lt;li&gt;import javax.enterprise.inject.Default;&lt;/li&gt;
&lt;li&gt;import javax.inject.Named;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;/**&lt;/li&gt;
&lt;li&gt;&amp;nbsp;* This is just a simple container class Web Bean for the username &lt;/li&gt;
&lt;li&gt;&amp;nbsp;*&amp;nbsp; and password entry values.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;*/&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@Named&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@RequestScoped&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@Default&lt;/li&gt;
&lt;li&gt;public class Credentials {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String username = null;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String password = null;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getUsername() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return username;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setUsername(String username) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.username = username;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String getPassword() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return password;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setPassword(String password) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.password = password;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Line 11: The name of this Web Bean will be &lt;span style="font-style:italic;"&gt;credentials&lt;/span&gt; since we don't supply an argument to the Named annotation.&lt;/li&gt;
&lt;li&gt;Line 12: For the purposes of this simple application this Web Bean scope will be for the current request.&lt;/li&gt;
&lt;li&gt;Line 13: Specifies the default qualifier type for this Web Bean.&amp;nbsp; Note that you should not have to specify this if it's the only qualifier type being used.&amp;nbsp; In future implementations of Web Beans this should be fixed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Listing 2: Login&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:1277px;background-color:rgb(240, 248, 255);height:486px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansservlet;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import java.io.Serializable;&lt;/li&gt;
&lt;li&gt;import javax.enterprise.context.SessionScoped;&lt;/li&gt;
&lt;li&gt;import javax.enterprise.inject.Default;&lt;/li&gt;
&lt;li&gt;import javax.inject.Inject;&lt;/li&gt;
&lt;li&gt;import javax.inject.Named;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;/**&lt;/li&gt;
&lt;li&gt;&amp;nbsp;* A simple Web Bean that performs a login operation with user's&lt;/li&gt;
&lt;li&gt;&amp;nbsp;* credentials.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;*/&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@Named&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@SessionScoped&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@Default&lt;/li&gt;
&lt;li&gt;public class Login implements Serializable {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;@Inject Credentials credentials;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private boolean loggedIn = false;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * This is where you could potentially access a database.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void login() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((&lt;span style="color:rgb(51, 51, 255);"&gt;credentials&lt;/span&gt;.getUsername() != null &amp;amp;&amp;amp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;credentials&lt;/span&gt;.getUsername().trim().length() &amp;gt; 0) &amp;amp;&amp;amp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;span style="color:rgb(51, 51, 255);"&gt;credentials&lt;/span&gt;.getPassword() != null &amp;amp;&amp;amp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;credentials&lt;/span&gt;.getPassword().trim().length() &amp;gt; 0)) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; loggedIn = true;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean isLoggedIn() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return loggedIn;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Line 13: The name of this Web Bean will be &lt;span style="font-style:italic;"&gt;login&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Line 14: This Web Bean will exist for the session&lt;/li&gt;
&lt;li&gt;Line 15: Specifies the default qualifier type for this Web Bean.&lt;/li&gt;
&lt;li&gt;Line 18: We're injecting an instance of &lt;span style="font-style:italic;"&gt;Credentials &lt;/span&gt;so we can check the validity of the user name and password entries&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Listing 3: Login Servlet&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:1277px;background-color:rgb(240, 248, 255);height:486px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansservlet;&lt;/li&gt;
&lt;li&gt;import java.io.IOException;&lt;/li&gt;
&lt;li&gt;import java.io.PrintWriter;&lt;/li&gt;
&lt;li&gt;import javax.enterprise.inject.spi.BeanManager;&lt;/li&gt;
&lt;li&gt;import javax.inject.Inject;&lt;/li&gt;
&lt;li&gt;import javax.servlet.ServletException;&lt;/li&gt;
&lt;li&gt;import javax.servlet.annotation.WebServlet;&lt;/li&gt;
&lt;li&gt;import javax.servlet.http.HttpServlet;&lt;/li&gt;
&lt;li&gt;import javax.servlet.http.HttpServletRequest;&lt;/li&gt;
&lt;li&gt;import javax.servlet.http.HttpServletResponse;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;/**&lt;/li&gt;
&lt;li&gt;&amp;nbsp;* This Servlet class demonstrates Web Beans injection.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;*/&lt;/li&gt;
&lt;li&gt;@WebServlet(name=&amp;quot;LoginServlet&amp;quot;, urlPatterns={&amp;quot;/LoginServlet&amp;quot;})&lt;/li&gt;
&lt;li&gt;public class LoginServlet extends HttpServlet {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inject Web Beans Bean Manager.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;@Inject BeanManager m;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inject The Credentials Web Bean.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;@Inject Credentials credentials;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inject the Login Web Bean.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;@Inject Login login;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Processes requests for both HTTP &amp;lt;code&amp;gt;GET&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;POST&amp;lt;/code&amp;gt; methods.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param request servlet request&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param response servlet response&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @throws ServletException if a servlet-specific error occurs&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @throws IOException if an I/O error occurs&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void processRequest(HttpServletRequest request, HttpServletResponse response)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throws ServletException, IOException {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; response.setContentType(&amp;quot;text/html;charset=UTF-8&amp;quot;);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintWriter out = response.getWriter();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;credentials.setUsername&lt;/span&gt;(request.getParameter(&amp;quot;username&amp;quot;));&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;credentials.setPassword&lt;/span&gt;(request.getParameter(&amp;quot;password&amp;quot;));&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;login.login();&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;span style="color:rgb(51, 51, 255);"&gt;login.isLoggedIn()&lt;/span&gt;) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.println(&amp;quot;Successfully Logged In As: &amp;quot; + &lt;span style="color:rgb(51, 51, 255);"&gt;credentials.getUsername()&lt;/span&gt;);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.println(&amp;quot;Login Failed: Check username and/or password.&amp;quot;);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.close();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; .......&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Line 15: New for Servlet 3.0 - eliminates servlet entry in web.xml! Not relevant to this example, but worth mentioning.&lt;/li&gt;
&lt;li&gt;Line 19: The Web Beans &lt;span style="font-style:italic;"&gt;Bean Manager &lt;/span&gt;can also be injected.&amp;nbsp; The &lt;span style="font-style:italic;"&gt;Bean Manager &lt;/span&gt;api provides some useful methods for interrogating portions of a Web Beans application.&lt;/li&gt;
&lt;li&gt;Line 22: The &lt;span style="font-style:italic;"&gt;Credentials &lt;/span&gt;Web Bean is injected making it available to the servlet.&lt;/li&gt;
&lt;li&gt;Line 38: Now we can access the &lt;span style="font-style:italic;"&gt;Credentials &lt;/span&gt;Web Bean.&lt;/li&gt;
&lt;li&gt;Line 40: We can also use the injected &lt;span style="font-style:italic;"&gt;Login &lt;/span&gt;Web Bean&lt;span style="font-style:italic;"&gt; &lt;/span&gt;instance.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is just one example of Web Bean injection into a servlet.&amp;nbsp; There are more areas in the JavaEE6 platform that can be used as Web Bean injection points - topics that will certainly be covered in future posts.&amp;nbsp; The sample for this blog can be found under the &lt;a rel="nofollow" target="_blank" href="https://glassfish-samples.dev.java.net/"&gt;glassfish-samples&lt;/a&gt; project.&amp;nbsp; You can check out the code following these &lt;a rel="nofollow" target="_blank" href="https://glassfish-samples.dev.java.net/source/browse/glassfish-samples/"&gt;instructions&lt;/a&gt;.&amp;nbsp; Once the workspace is checked out, you can find this sample under &lt;span style="font-style:italic;"&gt;glassfish-samples/ws/javaee6/webbeans/webbeans-servlet&lt;/span&gt;.&amp;nbsp; You can find documentation for the sample under &lt;span style="font-style:italic;"&gt;glassfish-samples/ws/javaee6/webbeans/webbeans-servlet/docs.&amp;nbsp; &lt;/span&gt;As with all the Web Beans samples now, you should run with GlassFish V3 - any build after September 2 2009.&lt;/p&gt;</description>
         <guid isPermaLink="false">265331 at http://www.java.net</guid>
         <pubDate>Wed, 09 Sep 2009 14:34:21 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2009/09/09/context-and-dependency-injection-jsr-299-and-servlets</feedburner:origLink></item>
      <item>
         <title>Contexts and Dependency Injection (JSR 299)  and GlassFish</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/x5JzPpGciDE/contexts-and-dependency-injection-jsr-299-and-glassfish</link>
         <description>&lt;p&gt;Version 1.0.0.PREVIEW3 of Web Beans (the implementation for &lt;a rel="nofollow" target="_blank" href="http://jcp.org/en/jsr/summary?id=299"&gt;JSR 299&lt;/a&gt; Contexts and Dependency Injection For Java EE) now uses the annotations from &lt;a rel="nofollow" target="_blank" href="http://jcp.org/en/jsr/summary?id=330"&gt;JSR 330&lt;/a&gt; (Dependency Injection For Java) and it is available in GlassFish V3.&amp;nbsp; &lt;br /&gt;
In this entry, we'll look at a simple JSF 2 application that uses Web Beans and the JSR 330 annotations. There are other features available in this release of Web Beans which will be discussed in subsequent blog entries. This application is a simple &amp;quot;guess number&amp;quot; application which I'm sure we are probably all familiar with by now.&amp;nbsp; Let's start by taking a look at the application's UI markup.&lt;/p&gt;
&lt;h3&gt;Listing 1: User Interface Markup&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:1277px;background-color:rgb(240, 248, 255);height:518px;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:head&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=iso-8859-1&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;JSF 2.0 Web Beans Example&amp;lt;/title&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:head&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:body&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:form id=&amp;quot;NumberGuessMain&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:panelGrid styleClass=&amp;quot;title-panel&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText value=&amp;quot;Guess Number&amp;quot; styleClass=&amp;quot;title-panel-text&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText value=&amp;quot;Powered By JavaServer Faces 2.0 and Web Beans&amp;quot; styleClass=&amp;quot;title-panel-subtext&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:panelGrid&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div style=&amp;quot;color: black; font-size: 24px;&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm thinking of a number between &amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.smallest}&lt;/span&gt;&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.biggest}&lt;/span&gt;&amp;lt;/span&amp;gt;. You have &amp;lt;span style=&amp;quot;color: blue&amp;quot;&amp;gt;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.remainingGuesses}&lt;/span&gt;&amp;lt;/span&amp;gt; guesses.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:panelGrid border=&amp;quot;1&amp;quot; columns=&amp;quot;5&amp;quot; style=&amp;quot;font-size: 18px;&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number:&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:inputText id=&amp;quot;inputGuess&amp;quot; value=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess}&lt;/span&gt;&amp;quot; required=&amp;quot;true&amp;quot; size=&amp;quot;3&amp;quot; disabled=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.number eq &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess}&lt;/span&gt;&amp;quot; validator=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.validateNumberRange}&lt;/span&gt;&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:commandButton id=&amp;quot;GuessButton&amp;quot; value=&amp;quot;Guess&amp;quot; action=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.check}&lt;/span&gt;&amp;quot; disabled=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.number eq &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess}&lt;/span&gt;&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:commandButton id=&amp;quot;RestartButton&amp;quot; value=&amp;quot;Reset&amp;quot; action=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.reset}&lt;/span&gt;&amp;quot; immediate=&amp;quot;true&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText id=&amp;quot;Higher&amp;quot; value=&amp;quot;Higher!&amp;quot; rendered=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.number gt &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess and &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess ne 0}&amp;quot;&lt;/span&gt; style=&amp;quot;color: red&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText id=&amp;quot;Lower&amp;quot; value=&amp;quot;Lower!&amp;quot; rendered=&amp;quot;&lt;span style="color:rgb(255, 0, 0);"&gt;#{&lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.number lt &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess and &lt;span style="color:rgb(51, 51, 255);"&gt;game&lt;/span&gt;.guess ne 0}&amp;quot;&lt;/span&gt; style=&amp;quot;color: red&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:panelGrid&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div style=&amp;quot;color: red; font-size: 14px;&amp;quot;&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:messages id=&amp;quot;messages&amp;quot; globalOnly=&amp;quot;false&amp;quot;/&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputStylesheet name=&amp;quot;stylesheet.css&amp;quot; /&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:form&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:body&amp;gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;/html&amp;gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
Everything on this page is really just standard JSF 2.0 view markup.&amp;nbsp; I've emphasized&amp;nbsp; the&amp;nbsp; Expression Language&amp;nbsp; (EL) portions of the view, especially &lt;span style="font-style:italic;"&gt;game &lt;/span&gt;because it refers to a contextual bean instance also known as a &lt;span style="font-style:italic;"&gt;Web Bean&lt;/span&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Line 17: Binding to Web Bean properties&lt;/li&gt;
&lt;li&gt;Line 21: Binding to Web Bean properties and validation method&lt;/li&gt;
&lt;li&gt;Line 22, 23: Binding to Web Bean action method&lt;/li&gt;
&lt;li&gt;Line 24, 25: Binding to Web Bean properties&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, in JSF, binding to a Web Bean is no different than binding to a typical managed bean.&lt;/p&gt;
&lt;h2&gt;Supporting Classes And Annotations For The Applicaton&lt;/h2&gt;
&lt;p&gt;Let's take a look at some of the utility classes for the application, namely the classes that are used to generate a random number and some of the supporting annotations.&lt;/p&gt;
&lt;h3&gt;Listing 2: The &amp;quot;Random&amp;quot; Annotation&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:100%;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansguess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.FIELD;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.METHOD;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.PARAMETER;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.TYPE;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.RetentionPolicy.RUNTIME;&lt;/li&gt;
&lt;li&gt;import java.lang.annotation.Documented;&lt;/li&gt;
&lt;li&gt;import java.lang.annotation.Retention;&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;import javax.inject.Qualifier;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;@Target( { TYPE, METHOD, PARAMETER, FIELD })&lt;/li&gt;
&lt;li&gt;@Retention(RUNTIME)&lt;/li&gt;
&lt;li&gt;@Documented&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;@Qualifier&lt;/li&gt;
&lt;li&gt;public @interface Random {&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
The JSR 330 &lt;span style="font-style:italic;"&gt;@Qualifier &lt;/span&gt;annotation is used to make &lt;span style="font-style:italic;"&gt;Random &lt;/span&gt;a binding type.&amp;nbsp;&amp;nbsp; This will allow us to inject a random number into the application.&lt;/p&gt;
&lt;h3&gt;Listing 3: The &amp;quot;MaxNumber&amp;quot; Annotation&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:100%;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;background-color:rgb(240, 248, 255);"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansguess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.FIELD;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.METHOD;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.PARAMETER;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.ElementType.TYPE;&lt;/li&gt;
&lt;li&gt;import static java.lang.annotation.RetentionPolicy.RUNTIME;&lt;/li&gt;
&lt;li&gt;import java.lang.annotation.Documented;&lt;/li&gt;
&lt;li&gt;import java.lang.annotation.Retention;&lt;/li&gt;
&lt;li&gt;import java.lang.annotation.Target;&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;import javax.inject.Qualifier;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;@Target( { TYPE, METHOD, PARAMETER, FIELD })&lt;/li&gt;
&lt;li&gt;@Retention(RUNTIME)&lt;/li&gt;
&lt;li&gt;@Documented&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;@Qualifier&lt;/li&gt;
&lt;li&gt;public @interface MaxNumber {&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;
&lt;/span&gt;Likewise, the &lt;span style="font-style:italic;"&gt;@Qualifier &lt;/span&gt;annotation is used to make &lt;span style="font-style:italic;"&gt;MaxNumber &lt;/span&gt;a binding type that will allow us to inject the maximum number allowed (for a guess) in the application.&lt;/p&gt;
&lt;h3&gt;Listing 4: The &amp;quot;Generator&amp;quot; Class&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:100%;background-color:rgb(240, 248, 255);"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansguess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import java.io.Serializable;&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;import javax.enterprise.context.ApplicationScoped;&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;import javax.enterprise.inject.Produces;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@ApplicationScoped&lt;/li&gt;
&lt;li&gt;public class Generator implements Serializable {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long serialVersionUID = -7213673465118041882L;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp; private java.util.Random random = new java.util.Random( System.currentTimeMillis() );&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int maxNumber = 100;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; java.util.Random getRandom() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return random;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:rgb(51, 51, 255);"&gt; @Produces @Random&lt;/span&gt; int next() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; return getRandom().nextInt(maxNumber);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 51, 255);"&gt;@Produces @MaxNumber&lt;/span&gt; int getMaxNumber() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; return maxNumber;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Line 7: An instance of this class exists for the lifecycle of the application&lt;/li&gt;
&lt;li&gt;Line 15: &lt;span style="font-style:italic;"&gt;next() &lt;/span&gt;is a Web Beans &lt;span style="font-style:italic;"&gt;producer &lt;/span&gt;method.&amp;nbsp; It will get called by the Web Beans Manager to obtain an instance of the next random number.&lt;/li&gt;
&lt;li&gt;Line 18: &lt;span style="font-style:italic;"&gt;getMaxNumber() &lt;/span&gt;is also a Web Beans &lt;span style="font-style:italic;"&gt;producer &lt;/span&gt;method.&amp;nbsp; It will get called by the Web Beans Manager to obtain an instance of &lt;span style="font-style:italic;"&gt;maxNumber - &lt;/span&gt;essentially returning the maximum number to &amp;quot;guess&amp;quot; in the application (in this case &amp;quot;100&amp;quot;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The Anatomy of a Simple Contextual Bean&lt;/h2&gt;
&lt;p&gt;Now that we have are utility classes and annotations in place, we can use them in our Web Bean.&lt;/p&gt;
&lt;h3&gt;Listing 5: The &amp;quot;Game&amp;quot; Contextual Bean&lt;/h3&gt;
&lt;table cellspacing="2" cellpadding="2" border="1" style="text-align:left;width:1277px;height:1397px;background-color:rgb(240, 248, 255);"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="vertical-align:top;"&gt;
&lt;ol&gt;
&lt;li&gt;package webbeansguess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;import java.io.Serializable;&lt;/li&gt;
&lt;li&gt;import javax.annotation.PostConstruct;&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;import javax.enterprise.context.SessionScoped;&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;import javax.enterprise.inject.Instance;&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;import javax.inject.Inject;&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;import javax.inject.Named;&lt;/li&gt;
&lt;li&gt;import javax.faces.application.FacesMessage;&lt;/li&gt;
&lt;li&gt;import javax.faces.component.UIComponent;&lt;/li&gt;
&lt;li&gt;import javax.faces.component.UIInput;&lt;/li&gt;
&lt;li&gt;import javax.faces.context.FacesContext;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style="color:rgb(255, 0, 0);"&gt;@Named&lt;/li&gt;
&lt;li style="color:rgb(51, 51, 255);"&gt;@SessionScoped&lt;/li&gt;
&lt;li&gt;public class Game implements Serializable {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final long serialVersionUID = 1L;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int number;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int guess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int smallest;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(204, 51, 204);"&gt;@MaxNumber&lt;/span&gt; &lt;span style="color:rgb(255, 0, 0);"&gt;@Inject&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; private int maxNumber;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int biggest;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private int remainingGuesses;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(204, 51, 204);"&gt;@Random&lt;/span&gt; &lt;span style="color:rgb(255, 0, 0);"&gt;@Inject &lt;/span&gt;Instance&amp;lt;Integer&amp;gt; randomNumber;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Game() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; public int getNumber() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return number;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; public int getGuess() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return guess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void setGuess(int guess) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.guess = guess;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; public int getSmallest() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return smallest;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int getBiggest() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return biggest;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int getRemainingGuesses() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return remainingGuesses;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String check() throws InterruptedException {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (guess&amp;gt;number) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; biggest = guess - 1;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (guess&amp;lt;number) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smallest = guess + 1;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (guess == number) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(&amp;quot;Correct!&amp;quot;));&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remainingGuesses--;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @PostConstruct&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void reset() {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.smallest = 0;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; this.guess = 0;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; this.remainingGuesses = 10;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; this.biggest = maxNumber;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; this.number = &lt;span style="color:rgb(51, 51, 255);"&gt;randomNumber.get()&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void validateNumberRange(FacesContext context,&amp;nbsp; UIComponent toValidate, Object value) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (remainingGuesses &amp;lt;= 0) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FacesMessage message = new FacesMessage(&amp;quot;No guesses left!&amp;quot;);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.addMessage(toValidate.getClientId(context), message);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((UIInput)toValidate).setValid(false);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int input = (Integer) value;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (input &amp;lt; smallest || input &amp;gt; biggest) {&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((UIInput)toValidate).setValid(false);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FacesMessage message = new FacesMessage(&amp;quot;Invalid guess&amp;quot;);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.addMessage(toValidate.getClientId(context), message);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
I've color coded the areas of interest in this class.&amp;nbsp; The &lt;span style="color:rgb(51, 51, 255);"&gt;blue &lt;span style="color:rgb(0, 0, 0);"&gt;areas are JSR 299 (Web Beans) implementation details.&amp;nbsp; The &lt;span style="color:rgb(255, 0, 0);"&gt;red &lt;span style="color:rgb(0, 0, 0);"&gt;areas are JSR 330 (Dependency Injection For Java) areas.&amp;nbsp; The &lt;span style="color:rgb(204, 51, 204);"&gt;purple &lt;span style="color:rgb(0, 0, 0);"&gt;areas are the &lt;span style="font-style:italic;"&gt;binding types.&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 14: We are using the &lt;span style="font-style:italic;"&gt;Named &lt;/span&gt;annotation to associate a name with this bean.&amp;nbsp; Because there is no argument specified with the &lt;span style="font-style:italic;"&gt;Named &lt;/span&gt;annotation, its name will be the name of the bean itself with the first letter lowercase (game).&amp;nbsp;&amp;nbsp; This allows us to reference the bean by that name using the Expression Language in the view.&lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 15: We declare this bean as a session scoped bean, meaning it's lifecycle is the lifecycle of the session. &lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 23: The &lt;span style="font-style:italic;"&gt;producer &lt;/span&gt;method in the &lt;span style="font-style:italic;"&gt;Generator&lt;/span&gt; class (line 18) will service this injection point causing maxNumber to have a value of &amp;quot;100&amp;quot;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 29: The &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="font-style:italic;"&gt;producer &lt;/span&gt;method in the &lt;span style="font-style:italic;"&gt;Generator&lt;/span&gt; class (line 15) will service this injection point making a&amp;nbsp; &lt;span style="font-style:italic;"&gt;randomNumber &lt;/span&gt;instance available for this Web Bean.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 72: We use a standard &lt;span style="font-style:italic;"&gt;@PostConstruct &lt;/span&gt;annotation causing variable initialization (after this Web Bean is created).&lt;br /&gt;
    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Line 78: Our Web Bean has been created, so the &lt;span style="font-style:italic;"&gt;randomNumber.get() &lt;/span&gt;call will cause the &lt;span style="font-style:italic;"&gt;producer &lt;/span&gt;method in the &lt;span style="font-style:italic;"&gt;Generator &lt;/span&gt;class (line 15) to get called.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="color:rgb(51, 51, 255);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(255, 0, 0);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;&lt;span style="color:rgb(204, 51, 204);"&gt;&lt;span style="color:rgb(0, 0, 0);"&gt;Well, that's a quick overview of a simple JSF2 application that uses the Web Beans (JSR 299 implementation) and the Java Dependency Injection (JSR 330) annotations. You can find this version of Web Beans in any of the GlassFish V3 builds after September 2, 2009.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
         <guid isPermaLink="false">263829 at http://www.java.net</guid>
         <pubDate>Fri, 04 Sep 2009 19:34:20 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2009/09/04/contexts-and-dependency-injection-jsr-299-and-glassfish</feedburner:origLink></item>
      <item>
         <title>Latest functionality in GlassFish v3 logging.</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/a-ZTlB5Gb0c/latest-functionality-glassfish-v3-logging</link>
         <description>&lt;p&gt;This blog highlights some of the changes that are part of GlassFish v3 logging.&amp;nbsp; Since Prelude I have added 3 asadmin commands related to logging. I have updated the set-log-level command and changed the syntax. See below for details. The new commands are:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * &lt;em&gt;asadmin rotate-log&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * asadmin list-logger-levels&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * asadmin set-log-level&lt;/em&gt;  logger-name=level:logger-name=level&lt;/p&gt;
&lt;p&gt;The first command rotates the log files immediately.&amp;nbsp; Users can now use native scheduling software such as &lt;em&gt;cron&lt;/em&gt; to rotate the logs.&amp;nbsp; We still support rotating logs based on file size or elapsed time since the last log rotation and this new command allows more flexibility when rotating log files.&amp;nbsp; The second command lists the loggers and their current level.&amp;nbsp; This command reports on all the known loggers that are listed in &lt;em&gt;logging.properties&lt;/em&gt; file.&amp;nbsp; Note that in some cases the loggers may not have been created by the respective containers however they will still appear in the list. The third command,&amp;nbsp; asadmin set-log-level, sets the level for aone or more loggers.&amp;nbsp;&amp;nbsp; For example, to set the log level of the web container logger level to WARNING&amp;nbsp; simply type:&amp;nbsp; &lt;em&gt;asadmin set-log-level  javax.enterprise.system.container.web=WARNING.&lt;/em&gt; This command updates the logging.properties file which means that the values are persisted across server restart.&amp;nbsp; Use &lt;em&gt;asadmin list-logger-levels&lt;/em&gt;&amp;nbsp; to get the names of the loggers. &lt;/p&gt;
&lt;p&gt;Finally, I've added a property to &lt;em&gt;logging.properties&lt;/em&gt; file in the domain &lt;em&gt;config&lt;/em&gt; directory that controls&amp;nbsp; the number of message written to the server log file.&amp;nbsp; GlassFish v3 logging code writes messages to a queue instead of directly to&amp;nbsp; the server log file.&amp;nbsp; Log messages are taken off the queue and written to the server log file as cycles become available.&amp;nbsp; The property name is &lt;em&gt;com.sun.enterprise.server.logging.GFFileHandler.flushFrequency&lt;/em&gt;.&amp;nbsp; This propertys controls the number of messages that are taken off the queue and written to a file a time.&amp;nbsp; The actual number written is the value of this property or less depending on the number of messages in the queue.&amp;nbsp; The default value is 1.&lt;br /&gt;
&amp;nbsp;&lt;/p&gt;</description>
         <guid isPermaLink="false">263778 at http://www.java.net</guid>
         <pubDate>Thu, 03 Sep 2009 00:33:50 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2009/09/02/latest-functionality-glassfish-v3-logging</feedburner:origLink></item>
      <item>
         <title>Slides from our talk at JavaOne.</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/2t1gCu3B40w/slides_from_our.html</link>
         <description>&lt;p&gt;Jan Luehe, Greg Wilkins and I did a talk on Servlet 3.0 at JavaOne yesterday. Am attaching the &lt;a rel="nofollow" target="_blank" href="http://weblogs.java.net/blog/mode/servlet3.0/servlet3.0-javaone09.pdf"&gt;slides&lt;/a&gt; from the talk for those that didn't make it or did make it and want a copy of the slides :).&lt;/p&gt;</description>
         <guid isPermaLink="false">242363 at http://www.java.net</guid>
         <pubDate>Wed, 03 Jun 2009 18:05:44 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2009/06/slides_from_our.html</feedburner:origLink></item>
      <item>
         <title>ICEFaces 2.0 And JSF 2.0 Together</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/GAEaMVUe71Y/icefaces_20_and.html</link>
         <description>&lt;p&gt;JSF Ajax frameworks have been around for some time. JSF is all about&lt;br /&gt;
server side components that render&lt;br /&gt;
their state as markup to the client. JSF has a well defined lifecycle&lt;br /&gt;
that defines how component state&lt;br /&gt;
is handled on the server and when component state is rendered to the&lt;br /&gt;
client.&amp;nbsp; JSF Ajax frameworks can control which components are&lt;br /&gt;
processed on the server (known as partial processing), and which&lt;br /&gt;
components render themselves back to the client (known as partial&lt;br /&gt;
rendering) by sending Ajax requests with special parameters.&amp;nbsp; &lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;How ICEFaces Uses JSF 2.0&amp;nbsp; To&lt;br /&gt;
Send Ajax Requests&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;/span&gt;The JSF 2.0 Ajax JavaScript API &lt;br /&gt;
 style="font-style: italic;"&amp;gt;jsf.ajax.request&lt;br /&gt;
 style="font-style: italic;"&amp;gt; can be used to trigger Ajax&lt;br /&gt;
requests from an HTML event such as &lt;span style="font-style:italic;"&gt;onclick&lt;/span&gt;.&amp;nbsp;&lt;br /&gt;
This function can be called from within a JavaScript function&lt;br /&gt;
too.&amp;nbsp; ICEFaces uses the &lt;span style="font-style:italic;"&gt;jsf.ajax.request&lt;br /&gt;
&lt;/span&gt;function within their JavaScript library:&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;/p&gt;
&lt;table style="text-align:left;width:698px;height:204px;" border="1"&gt;
 cellpadding="2" cellspacing="2"&amp;gt;&lt;br /&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;br /&gt;
 style="vertical-align: top; background-color: rgb(204, 255, 255);"&amp;gt;&amp;nbsp;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; submitEvent = function(event, element, form) {&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
 style="color: rgb(51, 51, 255);"&amp;gt;jsf.ajax.request(element, event,&lt;br /&gt;
{execute: '@all', render: '@all'});&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(0, 0, 0);"&gt;...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&lt;br /&gt;
      &lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; submitForm = function(event, form) {&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
 style="color: rgb(51, 51, 255);"&amp;gt;jsf.ajax.request(form, event,&lt;br /&gt;
{execute: '@all', render: '@all'});&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(0, 0, 0);"&gt;...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&lt;br /&gt;
      &lt;/span&gt;&lt;/span&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br&gt;&lt;br /&gt;
ICEFaces uses &lt;span style="font-style:italic;"&gt;submitEvent &lt;/span&gt;and&lt;br /&gt;
&lt;span style="font-style:italic;"&gt;submitForm &lt;/span&gt;in their &lt;br /&gt;
 style="font-style: italic;"&amp;gt;iceSubmitPartial and &lt;br /&gt;
 style="font-style: italic;"&amp;gt;iceSubmit functions&lt;br /&gt;
respectively.&amp;nbsp; The &lt;span style="font-style:italic;"&gt;iceSubmitPartial&lt;br /&gt;
&lt;/span&gt;and &lt;span style="font-style:italic;"&gt;iceSubmit &lt;/span&gt;functions&lt;br /&gt;
are part of the ICEFaces Ajax Bridge that&amp;nbsp; communicate with the&lt;br /&gt;
server.&amp;nbsp; ICEFaces is using the keyword &lt;br /&gt;
 style="font-style: italic;"&amp;gt;@all for both &lt;br /&gt;
 style="font-style: italic;"&amp;gt;execute and &lt;br /&gt;
 style="font-style: italic;"&amp;gt;render which means that all&lt;br /&gt;
components are processed on the server, and all components are targeted&lt;br /&gt;
for rendering markup back to the client.&amp;nbsp; ICEFaces sends&lt;br /&gt;
everything because on the server the framework determines the "dirty"&lt;br /&gt;
regions in a view by comparing the current rendered view with the view&lt;br /&gt;
that was rendered as a result of the Ajax request.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;How ICEFaces Uses JSF 2.0 To Process&lt;br /&gt;
Ajax Requests On The Server&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;/span&gt;JSF 2.0 provides extensibility points that allow JSF Ajax&lt;br /&gt;
frameworks to perform customized partial processing and partial&lt;br /&gt;
rendering on the server.&amp;nbsp; The JSF 2.0 API provides the &lt;br /&gt;
 style="font-style: italic;"&amp;gt;javax.faces.context.PartialViewContext.processPartial&lt;br /&gt;
method for this purpose.&amp;nbsp; This method performs partial&lt;br /&gt;
processing and partial rendering on the components identified by the&lt;br /&gt;
identifiers in the &lt;span style="font-style:italic;"&gt;execute &lt;/span&gt;and&lt;br /&gt;
&lt;span style="font-style:italic;"&gt;render &lt;/span&gt;lists from the&lt;br /&gt;
request.&amp;nbsp; ICEFaces extends &lt;span style="font-style:italic;"&gt;javax.faces.context.PartialViewContext&lt;br /&gt;
&lt;/span&gt;with their &lt;span style="font-style:italic;"&gt;DOMPartialViewContext&lt;br /&gt;
&lt;/span&gt;impementation:&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;/p&gt;
&lt;table style="text-align:left;width:692px;height:28px;" border="1"&gt;
 cellpadding="2" cellspacing="2"&amp;gt;&lt;br /&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;br /&gt;
 style="vertical-align: top; background-color: rgb(204, 255, 255);"&amp;gt;import&lt;br /&gt;
javax.faces.context.PartialViewContextWrapper;&lt;br&gt;&lt;br /&gt;
...&lt;br&gt;&lt;br /&gt;
public class DOMPartialViewContext extends PartialViewContextWrapper {&lt;br&gt;&lt;br /&gt;
...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:rgb(51, 102, 255);"&gt;&lt;br /&gt;
 style="color: rgb(51, 51, 255);"&amp;gt;public void processPartial(PhaseId&lt;br /&gt;
phaseId)&lt;/span&gt;&amp;nbsp; {&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isRenderAll() &amp;amp;&amp;amp;&lt;br /&gt;
PhaseId.RENDER_RESPONSE) {&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
Perform DOM Diffing ..&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;br /&gt;
Send updates as separate &amp;lt;update&amp;gt; elements using JSF 2.0&lt;br /&gt;
PartialResponseWriter&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
super.processPartial(phaseId);&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br /&gt;
...&lt;br&gt;&lt;br /&gt;
}&lt;br&gt;
      
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br&gt;&lt;br /&gt;
If the current processing phase is the &lt;br /&gt;
 style="font-style: italic;"&amp;gt;Render Response Phase, ICEFaces:&lt;br&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;retrieves the current DOM (for the view before rendering)&lt;br&gt;
  &lt;/li&gt;
&lt;li&gt;generates the new DOM by rendering the new view (using a special&lt;br /&gt;
DOMResponseWriter)&lt;/li&gt;
&lt;li&gt;determines if there are differences between the DOMs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If there are differences, then the JSF 2.0 &lt;br /&gt;
 style="font-style: italic;"&amp;gt;javax.faces.context.PartialResponseWriter implementation&lt;br /&gt;
is used to write &amp;lt;update&amp;gt; elements back to the client following&lt;br /&gt;
the specification defined partial response format:&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;/p&gt;
&lt;table style="text-align:left;width:688px;height:28px;" border="1"&gt;
 cellpadding="2" cellspacing="2"&amp;gt;&lt;br /&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;br /&gt;
 style="vertical-align: top; background-color: rgb(204, 255, 255);"&amp;gt;&amp;lt;partial-response&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;changes&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;update id="user"&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/update&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;update id="password"&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/update&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/changes&amp;gt;&lt;br&gt;&lt;br /&gt;
&amp;lt;/partial-response&amp;gt;&lt;br&gt;
      
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br&gt;&lt;br /&gt;
If there are no differences, then the JSF 2.0 &lt;br /&gt;
 style="font-style: italic;"&amp;gt;javax.faces.context.PartialResponseWriter implementation&lt;br /&gt;
is used to write the single &amp;lt;update&amp;gt; element containing the&lt;br /&gt;
entire view markup.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;Summary&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;ICEFaces 2.0 is still&lt;br /&gt;
under development, and it is one of the early component frameworks that&lt;br /&gt;
follow the JSF 2.0 Ajax standard.&amp;nbsp; It uses the JSF 2.0 Ajax&lt;br /&gt;
JavaScript API to initiate Ajax requests to the server.&amp;nbsp; It&lt;br /&gt;
leverages the JSF 2.0 Ajax extensibility points on the server to&lt;br /&gt;
process Ajax Requests and formulate the partial response to send back&lt;br /&gt;
to the client.&amp;nbsp; This version of ICEFaces (2.0) currently uses the &lt;br /&gt;
 href="https://javaserverfaces.dev.java.net/"&amp;gt;mojarra&amp;nbsp; implementation&lt;br /&gt;
of the JSF 2.0 specification.&amp;nbsp; There will surely be more component&lt;br /&gt;
frameworks on board with JSF 2.0, which should go a long way towards&lt;br /&gt;
component interoperability.&lt;br&gt;&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;References&lt;br&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br&gt;&lt;br /&gt;
&lt;br /&gt;
 href="http://www.jroller.com/tedgoddard/entry/on_the_road_to_icefaces"&amp;gt;ICEFaces&lt;br /&gt;
2.0&lt;br&gt;&lt;br /&gt;
&lt;a rel="nofollow" target="_blank" href="http://jcp.org/en/jsr/detail?id=314"&gt;JavaServer Faces 2.0&lt;br /&gt;
Specification&lt;/a&gt;&lt;br&gt;&lt;br /&gt;
&lt;a rel="nofollow" target="_blank" href="https://javaserverfaces.dev.java.net/"&gt;Project Mojarra&lt;/a&gt;&lt;br&gt;&lt;br /&gt;
&lt;a rel="nofollow" target="_blank" href="https://glassfish.dev.java.net"&gt;GlassFish&lt;/a&gt;&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;br&gt;&lt;br /&gt;
&lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
 style="font-style: italic;"&amp;gt;&lt;br&gt;&lt;/p&gt;</description>
         <guid isPermaLink="false">242252 at http://www.java.net</guid>
         <pubDate>Mon, 25 May 2009 23:40:29 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2009/05/icefaces_20_and.html</feedburner:origLink></item>
      <item>
         <title>Proposed Final Draft of Servlet 3.0 now available</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/KEPWYmYFa0A/proposed_final.html</link>
         <description>&lt;p&gt;The proposed final draft of the Servlet 3.0 specification is now available at the &lt;a rel="nofollow" target="_blank" href="http://jcp.org/en/jsr/detail?id=315"&gt;JCP site &lt;/a&gt;. In addition to the specification, also refer to Shing Wai's blog describing in detail the &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/swchan/entry/servlet_3_0_web_fragment"&gt;ordering solution for fragments&lt;/a&gt; and the &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/swchan/entry/servlet_3_0_security_annotations"&gt;use of security annotations&lt;/a&gt;.&lt;/p&gt;</description>
         <guid isPermaLink="false">242172 at http://www.java.net</guid>
         <pubDate>Fri, 08 May 2009 20:58:15 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2009/05/proposed_final.html</feedburner:origLink></item>
      <item>
         <title>Servlet 3.0 PFD draft coming soon.</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/3fHIyZw1mfk/servlet_30_pfd.html</link>
         <description>&lt;p&gt;It's been a while since my last update. However I am pleased to report that the Proposed Final Draft (PFD) of Servlet 3.0 is now been handed off to the JCP. Some highlights of what is in the PFD draft - &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; The issues around Async have been worked out and Greg will also be posting an update to his last set of comments. Basically there were some tweaks to the APIs and semantics of the proposal. However the proposal itself hasn't changed drastically. It has been implemented in GlassFish and I believe also in Jetty 7.0 pre release build.
&lt;li&gt; We now have an ordering solution for Servlets, Filters and Listeners that also allows users to control what jar files are looked up based on the pluggability feature described previously.
&lt;li&gt; In addition to the pluggability via fragments, annotations, we also introduced the concept of &lt;code class="prettyprint"&gt;ServletContainerInitializer&lt;/code&gt; which allows you to plugin providers based on either annotations or classes that a particular class implements. For example when plugging in JAX-WS into a web container to support web services, today most implementations require you to use a proprietary descriptor (unless you are writing a JSR 109 style web service) for using the web service library in a web container. I will provide more details of how framework authors can use the &lt;code class="prettyprint"&gt;ServletContainerInitializer&lt;/code&gt; in a separate blog soon to follow.
&lt;li&gt; Ability to load static resources and JSPs from a jar file. This feature enables users to bundle shared resources in a jar file in a special directory - &lt;code class="prettyprint"&gt;META-INF/resources&lt;/code&gt;. When included in the WEB-INF/lib directory of the webapp, if the container does not find a particular resource in the root directory of the webapp, it will look at the jar files in the WEB-INF/lib to see if the resource is bundled in META-INF/resources of any jar file and serve it up.
&lt;li&gt;Security enhancements - programmatic authenticate, login and logout support. Support for &lt;code class="prettyprint"&gt;@RolesAllowed, @PermitAll, @DenyAll&lt;/code&gt; annotations in the web container.
&lt;li&gt; Updated existing APIs to use generics where possible in a backward compatible manner.
&lt;li&gt;Default error pages for error codes.
&lt;li&gt;Clarified welcome files.
&lt;li&gt;File upload - We have a basic solution in place, which we will build upon in a future release of the Servlet specification.
&lt;/ul&gt;
&lt;p&gt;Look out for the specification release (I will post an update when relased) and provide feedback. &lt;/p&gt;
&lt;p&gt;
If you are attending JavaOne this year, Jan Luehe (from Sun), Greg Wilkins(Jetty / Webtide) and I will be presenting the Servlet 3.0 features in a technical session - TS-3790 "Javaâ„¢ Servlet 3.0: Empowering Your Web Applications With Async, Extensibility and More"&lt;/p&gt;</description>
         <guid isPermaLink="false">242085 at http://www.java.net</guid>
         <pubDate>Tue, 28 Apr 2009 20:20:13 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2009/04/servlet_30_pfd.html</feedburner:origLink></item>
      <item>
         <title>JSR 245 MR: Part 2 - JSP</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/ty3kYi17drU/jsr_245_mr_part_2</link>
         <description>&lt;p&gt;This is the second part of the update on JSP and EL specification.  
&lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/kchung/entry/jsr_245_mr_part_i"&gt;A previous blog
&lt;/a&gt; covers the EL MR.  This blog covers the JSP Specification MR.  The details can be
obtained from &lt;a rel="nofollow" target="_blank" href="http://jcp.org/aboutJava/communityprocess/maintenance/jsr245/245ChangeLog2.html"
&gt;here&lt;/a&gt;.  The close date for the MR is March 3, 2009. Please send comments
to &lt;a rel="nofollow" target="_blank" href="mailto:kin-man.chung@sun.com"&gt;me&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;
The proposed JSP MR fixes some typos and errors, and adds some minor enhancements to JSP.  This blog covers these enhancements.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;h5&gt;Declare Default Content Type&lt;/h5&gt;
&lt;p&gt;
Currently, the default content type is &lt;code&gt;text/html&lt;/code&gt; for JSP pages 
in standard syntax and &lt;code&gt;text/xml&lt;/code&gt; for pages in xml syntax.  This can be overridden by the use the page directives in individual JSP pages.  It would be sometimes desirable to set a content type, such as &lt;code&gt;text/xhtml&lt;/code&gt;, for the whole application.
&lt;/p&gt;
&lt;p&gt;The MR adds a JSP configuration element &lt;code&gt;default-content-type&lt;/code&gt;
to the &lt;code&gt;jsp-property-group&lt;/code&gt; element.  It can be used to set the
default content type for a group of JSP pages that matches the URL pattern defined in the &lt;code&gt;jsp-property-group&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h5&gt; Set Default Buffer Size&lt;/h5&gt;
&lt;p&gt;
Likewise, the MR adds a JSP configuration element &lt;code&gt;buffer&lt;/code&gt; to
the &lt;code&gt;jsp-property-group&lt;/code&gt;.  It can be used to set the buffering
model for a a group of JSP pages that matches the URL pattern defined in the &lt;code&gt;jsp-property-group&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h5&gt; Raise Errors for Undeclared Namespaces&lt;/h5&gt;
&lt;p&gt;
Currently, using an unknown namespace in standard JSP syntax is silently
ignored, but is an error in xml syntax.  This is somewhat inconsistent, to say the least.&lt;/p&gt;
&lt;p&gt;Moreover, it is a common mistaken to omit the declaration of a tag library using the taglib directive before it is used in a JSP page.  The
end result is that the tag library is not invoked, and nothing is displayed.
This often a source for confusion to page authors.&lt;/p&gt;
&lt;p&gt;As a remedy, we add a  &lt;code&gt;error-on-undeclared-namespace&lt;/code&gt;
element to the &lt;code&gt;jsp-property-group&lt;/code&gt;.  It can be used to force
an error at compile time when undeclared namespaces are used in a group
of JSP pages that matches the URL pattern defined in the &lt;code&gt;jsp-property-group&lt;/code&gt;.&lt;/p&gt;
&lt;li&gt;
&lt;h5&gt;Omit Generation of Attribute in &amp;lt;jsp:element&amp;gt;&lt;/h5&gt;
&lt;p&gt;
&lt;code&gt;&amp;lt;jsp:element&amp;gt;&lt;/code&gt; can be used to generate dynamic tag elements on
the fly, and &lt;code&gt;&amp;lt;jsp:attribute&amp;gt;&lt;/code&gt; can be used to generate
an attribute for the element.  However it is currently not possible
to conditionally omit the attribute.  The most we can do now is to
generate an attribute with a null value, but is not the same as an omitted
attribute, for some browsers.&lt;/p&gt;
&lt;p&gt;We now introduce an optional attribute &lt;code&gt;omit&lt;/code&gt; to &lt;code&gt;&amp;lt;jsp:attribute&amp;gt;&lt;/code&gt;.  When it evaluates to &lt;code&gt;true&lt;/code&gt;,
the attribute is not generated in the &lt;code&gt;&amp;lt;jsp:element&amp;gt;&lt;/code&gt;.
Consider the following:
&lt;pre&gt;
    &amp;lt;jsp:element name="image"&amp;gt;
        &amp;lt;jsp:attribute omit=${width eq null}&amp;gt;
            ${width}
        &amp;lt;/jsp:attribute&amp;gt;
        &amp;lt;jsp:body&amp;gt;
            body
        &amp;lt;/jsp:body&amp;gt;
    &amp;lt;/jsp:element&amp;gt;
&lt;/pre&gt;
When &lt;code&gt;width&lt;/code&gt; is "100", for instance, the following is generated:
&lt;pre&gt;
    &amp;lt;image width="100"&amp;gt;
        body
    &amp;lt;/image&amp;gt;
&lt;/pre&gt;
When &lt;code&gt;width&lt;/code&gt; is null, the following is generated:
&lt;pre&gt;
    &amp;lt;image&amp;gt;
        body
    &amp;lt;/image&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The sources for the API and implementation will be done at the
&lt;a rel="nofollow" target="_blank" href="https://jsp.dev.java.net"&gt;jsp project&lt;/a&gt; and will be bundled
with &lt;a rel="nofollow" target="_blank" href="https://glassfish.dev.java.net"&gt;Glassfish&lt;/a&gt; V3 release.
&lt;/p&gt;</description>
         <author>kchung</author>
         <guid isPermaLink="false">https://blogs.oracle.com/kchung/entry/jsr_245_mr_part_2</guid>
         <pubDate>Tue, 03 Feb 2009 16:54:19 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/kchung/entry/jsr_245_mr_part_2</feedburner:origLink></item>
      <item>
         <title>JSR 245 MR: Part I - Expression Language (EL)</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/yLl2wbG5bfo/jsr_245_mr_part_i</link>
         <description>&lt;p&gt;
This is a quick update on JSP and EL (Expression Language) specification.
&lt;/p&gt;
&lt;p&gt;
Although the EL specification has been separated from the JSP specification,
for various reasons, we have not taken the last step to create a new JSR for EL.  The proposed work on the JSP MR and EL MR has been filed under JSR-245.  The
details can be obtained from &lt;a rel="nofollow"
 target="_blank" href="http://jcp.org/aboutJava/communityprocess/maintenance/jsr245/245ChangeLog2.html"&gt;
here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;The close date for the MR is March 3, 2009.  Please send comments to
&lt;a rel="nofollow" target="_blank" href="mailto:kin-man.chung@sun.com"&gt;me&lt;/a&gt;.
&lt;p&gt;
This blog covers the EL MR.&lt;/p&gt;
&lt;p&gt;
One of the most requested feature enhancement to EL is the ability to invoke
methods in EL expressions.  The &lt;code&gt;MethodExpression&lt;/code&gt; in the current EL can be
used to specify a method in the EL expression.  For instance, in the following
JSF code fragment,
&lt;pre&gt;
    &amp;lt;h:commandButton action="#{trader.buy}" value="buy"/&amp;gt;
&lt;/pre&gt;

the method &lt;code&gt;buy&lt;/code&gt; in the bean &lt;code&gt;trader&lt;/code&gt; is specified in EL.  This method is
is not invoked here, but instead, it is passed to the tag handler, and
can only be invoked from Java codes.  Also, the parameter types of the method cannot be
obtained from the EL expression, but must be specified in the TLD (Tag Library
Descriptor).  At the method invocation, the actual arguments (also not
specified in the EL expression) are coerced to the corresponding parameter
types and passed to the method.  As you can see, there are a lot things
that need to be done in Java code to make a method call.&lt;/p&gt;
&lt;p&gt;
The proposed EL MR allows for specifying the method arguments, as well as
the invocation of the method in the EL expression itself.  The required
changes in EL syntax to do this is surprisingly little.  All we need to do
to is add (what else) a list of arguments in parenthesis to the method
calls.  For instance, we can added the argument "JAVA" to above JSF fragment:
&lt;pre&gt;
    &amp;lt;h:commandButton action="#{trader.buy('JAVA')}" value="buy"/&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;
One thing nice about this new syntax is that you can tell immediately that this is a method call, and that the method
takes one parameter of the type &lt;code&gt;String&lt;/code&gt;.  Furthermore, we also specify the actual argument
to pass to the method when invoked.  There is no need to specify the parameter types in the TLD, and there is no hidden arguments in the method
call.&lt;/p&gt;
&lt;p&gt;
Note in the above code, the EL expression, being a deferred method
expression, does not cause the method to be invoked.  To actually invoke the
method and retrieve the method return value, we can write in a JSP page:
&lt;pre&gt;
    The stock price bought: ${trader.buy('JAVA')}
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Very nice!&lt;/p&gt;
&lt;p&gt;
Included in the EL MR is another feature that is related to method invocation,
namely that of customization of method invocations with the use of custom
&lt;code&gt;ELResolver&lt;/code&gt;s.  The default behavior for method calls, such as
&lt;code&gt;#{trader.buy('JAVA')}&lt;/code&gt; is to look for the method &lt;code&gt;buy&lt;/code&gt;, using reflection,
in the bean &lt;code&gt;trader&lt;/code&gt;.  This default behavior can be altered with custom
&lt;code&gt;ELResovler&lt;/code&gt;.  A new method &lt;code&gt;invoke&lt;/code&gt; is thus added to &lt;code&gt;ELResolver&lt;/code&gt; and this
method is used to resolve the evaluation of method calls in expressions,
much like the method &lt;code&gt;getValue&lt;/code&gt; is used to resolve the evaluation of
properties in expressions.  By providing custom &lt;code&gt;ELResolver&lt;/code&gt;s, one can
make "calls" to methods that are not in the bean class.  In a sense, this
feature enables the definition and invocation of macros, and can lead to some interesting
applications.&lt;/p&gt;
&lt;p&gt;
The default behavior for method calls is handled by the class
&lt;code&gt;javax.el.BeanELResolver&lt;/code&gt;.  Using reflection, it looks up the method in the bean class.
Currently overloaded methods are not supported, and the number of arguments
specified in the EL expression must matched that in the method signature.
This is so because we don't want to specify complicated overload resolution
rules in the EL specification.&lt;/p&gt;
&lt;p&gt;
However, the method &lt;code&gt;ELResolver.invoke&lt;/code&gt; has a &lt;code&gt;paramTypes&lt;/code&gt; argument that can be
used to specify the formal parameter types for the method.  If this argument
is non-null, then the method with the same name and parameter types will be
selected for invocation.  Although the EL syntax does not allow the
specification of parameter types in the method call, it can be done quite
easily with an extended syntax.  Borrowing from Javascript (I think) one
can write, for instance
&lt;pre&gt;
    #{trader['buy(java.lang.String)']('JAVA')}
&lt;/pre&gt;
to indicate a call to the method &lt;code&gt;buy&lt;/code&gt; with &lt;code&gt;String&lt;/code&gt; argument.  This is
currently not included in the MR, but if there are enough interest, it can
be considered for the next version of the specification.
&lt;/p&gt;
&lt;p&gt;The source for the changes to EL api and implementation can be found from
&lt;a rel="nofollow" target="_blank" href="https://uel.dev.java.net"&gt;Unified Expression Language project&lt;/a&gt;.  
The basic functionalities have been implemented.  The area that needs further work is in the overloaded method resolution, and performance.
&lt;/p&gt;</description>
         <author>kchung</author>
         <guid isPermaLink="false">https://blogs.oracle.com/kchung/entry/jsr_245_mr_part_i</guid>
         <pubDate>Tue, 03 Feb 2009 10:42:21 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/kchung/entry/jsr_245_mr_part_i</feedburner:origLink></item>
      <item>
         <title>Rebuttal of Greg Wilkin's Blog about Servlet 3.0 PR</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/6QYGrDfTjGA/rebuttal_of_gre.html</link>
         <description>&lt;p&gt;Someone just pointed me to Greg Wilkin's latest blog &lt;a rel="nofollow" target="_blank" href="http://blogs.webtide.com/gregw/entry/servlet_3_0_public_review"&gt;entry&lt;/a&gt;. I tried posting my response in his comments however it was tagged as spam and not displayed. So I am making the comments available her.&lt;br /&gt;
&lt;br&gt;&lt;/p&gt;
&lt;p&gt;I am REALLY surprised at this blog. Let me try to answer some of these questions in the public forum.&lt;/p&gt;
&lt;p&gt;
"This public draft of the servlet-3.0 represents a thought experiment in API design unhindered by the complexities of implementation, trial usage or community feedback."&lt;/p&gt;
&lt;p&gt; &lt;b&gt;An implementation of this is available in GlassFish in the trunk.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"As a member of this Expert Group, I've been as guilty as the other members by looking at uncompiled/untested APIs and believing them to solve the issues at hand, only to later discover that these APIs prove to be unworkable when implemented and/or used."&lt;/p&gt;
&lt;p&gt; &lt;b&gt;The APIs are implementable. Take a look at the GlassFish trunk.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Requests for test implementations have been denied"&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;I never saw a request from you. In fact YOU offered to implement some of the features in Jetty and showcase the technology.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Any feedback received on the &lt;a rel="nofollow" target="_blank" href="mailto:jsr-315-comments@jcp.org"&gt;jsr-315-comments@jcp.org&lt;/a&gt; list have been kept private and not shared even with the EG, despite several requests. "&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Please check your email carefully. All the mails that I have received I have forwarded to the EG. Also I never saw  a request from you to share feedback that is received.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"EG members and community feedback raised concerns about the security and ordering aspects of the automatic deployment possible with the  Annotations and Pluggability feature (see below).  The response was not the "How can we address these concerns" discussion that I was expecting.   Instead the response was more along the lines of Obe-wan Kenobi saying "these are not the concerns you are looking for. Move along!" "&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;br /&gt;
Looking into the security concerns we introduced the enabled, flag that can enable and disable servlets. Also like some of the other EG members pointed out that if a user does not know how a framework works he shouldn't be using it in the first place. Or if a framework is authored badly then it shouldn't be used in the first place. The problem is that you never get PAST what YOU suggest as a solution and YOU always think of solutions keeping that in mind.&lt;br /&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Alternately, some unsubstantiated requirements (eg. wrapped asynchronous requests) have been included at a late stage without any use-cases or user demand, which have introduced whole new dimensions of complexity so that discussions have been ratholed for months chasing marginal edge cases."&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;br /&gt;
I don't believe that you say this. Late in the game and we rat holed more on the use case that you had as opposed to the wrapped use case. In fact if you remember, members of the EG were opposed to the re-dispatch semantics that we had. So please don't provide an incorrect picture to the people reading your blogs.&lt;br /&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Accidental Deployment"&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;br /&gt;
We have had no such experience with the use of annotations in JAX-WS, EJB, and other places in the Java EE platform. Also there are ways to turn off the accidental deployment - use the enable flag to enable / disable servlets. Are you even paying attention to the solutions that the EG is working on providing?&lt;br /&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Slow Deployment"&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;br /&gt;
Please provide numbers of how deployment is slowed down. If you just "feel" that deployment will slow down significantly it isn't good enough. In the Java EE 5 days we did the analysis of scanning of annotations and the result was that we didn't see any significant slowing down. I can share the numbers in the EG if you are REALLY interested in the problem.&lt;br /&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
"Ordering"&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;br /&gt;
Yes this is a problem for the fragments. However there is a solution to use the web.xml to do the ordering. Also your blog seems to be getting confusing. On one hand you criticize the feature of pluggability with accidental deployment, slowing down deployment with scanning, and on the other hand you want to use the feature and not define everything in the web.xml? Make up your mind what you want? Use the feature or just keep using the web.xml as before.&lt;br /&gt;
&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
As for the async rebuttal and everything else about the Async proposal just a few quotes from emails to the EG.&lt;/p&gt;
&lt;p&gt;
Quoting you -&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
"Excellent!    This proposal is definitely better than suspend/resume!"&lt;/p&gt;
&lt;p&gt;Quoting another EG member -&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
"Greg, I think you're being too aggressive. I do realize you care about the subject.&lt;/p&gt;
&lt;p&gt;I think Rajiv's design is now quite fine, so using the "flood until he&lt;br /&gt;
agrees to my stuff" tactic is unfair. From what I've seen many have&lt;br /&gt;
stated a preference for his design (I have a coworker who's also not&lt;br /&gt;
very comfortable with your design). And the adapted code example looks&lt;br /&gt;
good to me too."&lt;/p&gt;
&lt;p&gt;
You have just taken this tactic outside the EG now because the EG members were starting to point this out to you. &lt;/p&gt;
&lt;p&gt;
I am really starting to agree with Bill Burke about the statement he made in his &lt;a rel="nofollow" target="_blank" href="http://bill.burkecentral.com/2008/11/12/buggybroken-tomcat-6-comet-nio-apis/"&gt;blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;h3&gt;Update:&lt;/h3&gt;
&lt;p&gt;Maxim MoldenHauer, the IBM representative on the EG has also &lt;a rel="nofollow" target="_blank" href="http://maximmoldenhauer.blogspot.com/2008/12/servlet-30-public-draft.html"&gt;blogged&lt;/a&gt; on the issue.&lt;/p&gt;</description>
         <guid isPermaLink="false">241299 at http://www.java.net</guid>
         <pubDate>Tue, 16 Dec 2008 07:34:54 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/12/rebuttal_of_gre.html</feedburner:origLink></item>
      <item>
         <title>Servlet 3.0 webinar</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/VEhLVqxTeq8/servlet_30_webi.html</link>
         <description>&lt;p&gt;I will be presenting 3.0 in a webinar on December 18th. For details and logistics about the webinar go to &lt;a rel="nofollow" target="_blank" href="http://wikis.sun.com/display/TheAquarium/Servlet3.0"&gt;http://wikis.sun.com/display/TheAquarium/Servlet3.0&lt;/a&gt;. If you would like to learn about the new features in servlet 3.0 I would definitely encourage you to attend the webinar.&lt;/p&gt;</description>
         <guid isPermaLink="false">241278 at http://www.java.net</guid>
         <pubDate>Thu, 11 Dec 2008 01:58:25 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/12/servlet_30_webi.html</feedburner:origLink></item>
      <item>
         <title>Asynchronous support in Servlet 3.0</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/Xh5QVEjmCIg/asynchronous_su.html</link>
         <description>&lt;p&gt;After the last couple of entries I have gotten requests for more details on how the async works. So I decided to write this up in a blog to share what the async support looks like in the Servlet 3.0 public review draft.&lt;/p&gt;
&lt;p&gt;There are a couple of use cases that we are trying to handle with the async support in Servlet 3.0 - &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Wait for a resource to become available (JDBC, call to webservice)
&lt;li&gt; Generate response asynchronously
&lt;li&gt; Use the existing frameworks to generate responses after waiting for the async operation to complete
&lt;/ul&gt;
&lt;p&gt;Keeping this in mind the API that the expert group has agreed upon for async is as follows.&lt;/p&gt;
&lt;p&gt;&lt;ul&gt;
&lt;li&gt;Annotation attributes in the &lt;code class="prettyprint"&gt;@WebServlet&lt;/code&gt; and &lt;code class="prettyprint"&gt;@ServletFilter&lt;/code&gt; annotations that indicates if a Servlet or a Filter supports async. The attribute is &lt;code class="prettyprint"&gt;asyncSupported&lt;/code&gt;.
&lt;li&gt;To initiate an async operation there are methods on &lt;code class="prettyprint"&gt;ServletRequest&lt;/code&gt; - &lt;code class="prettyprint"&gt;startAsync(req, res)&lt;/code&gt; and &lt;code class="prettyprint"&gt;startAsync()&lt;/code&gt; (difference described below).
&lt;li&gt; Call to &lt;code class="prettyprint"&gt;startAsync&lt;/code&gt; returns an &lt;code class="prettyprint"&gt;AsyncContext&lt;/code&gt; initialized with the request and response objects passed to the &lt;code class="prettyprint"&gt;startAsync&lt;/code&gt; call.
&lt;li&gt;&lt;code class="prettyprint"&gt;AsyncContext.forward(path)&lt;/code&gt; and &lt;code class="prettyprint"&gt;AsyncContext.forward()&lt;/code&gt; that forwards the request back to the container so you can use frameworks like JSP to generate the response.
&lt;li&gt;&lt;code class="prettyprint"&gt;AsyncContext.complete()&lt;/code&gt; indicates that the developer is done processing the request and generating the appropriate response.
&lt;li&gt;There are a few more methods in &lt;code class="prettyprint"&gt;ServletRequest&lt;/code&gt; like &lt;code class="prettyprint"&gt;isAsyncSupported&lt;/code&gt; and &lt;code class="prettyprint"&gt;isAsyncStarted&lt;/code&gt; that can be used by applications to determine if async operations are supported or started.
&lt;li&gt; There is also a new listener - &lt;code class="prettyprint"&gt;AsyncListener&lt;/code&gt; that applications can use to get notified of when async processing is completed or if a timeout occurs.
&lt;/ul&gt;
&lt;p&gt;To initiate async processing there are two methods available - one that takes a request and response (startAsync(req, res) ) and one that does not take any parameters (startAsync()). The difference between the two method signatures is that the startAsync() with no parameters implicitly uses the original request and response while the startAsync(req, res) uses the request and response objects passed in. The request and response passed in can be wrapped by filters or other servlets earlier in the request processing chain. The AsyncContext is initialized appropriately with the request and response depending on the method used. Caution must be taken when wrapping the response and calling the no arguments startAsync(). If any data has been written to the wrapped response and not flushed to the underlying response stream you could lose the data.&lt;/p&gt;
&lt;p&gt;
Similarly after the async processing is over if you choose to forward the request back to run in the context of the web container there are three methods that are available in the AsyncContext that enable this. forward(path), forward(ServletContext, path) and forward().&lt;/p&gt;
&lt;p&gt;&lt;ul&gt;
&lt;li&gt;forward() no args forwards back to the "original url" or if a forward (AsyncContext or RequestDispatcher forward) has occured after an async context has been initialized then the no args forward will forward to the path that was used by the AsyncContext / RequestDispatcher to forward to.
&lt;li&gt;forward(path) forwards to the path relative to the context of the request
&lt;li&gt;forward(ServletContext, path) forwards to the path relative to the context specified.
&lt;p&gt;Below is an example that shows a simple web application that is waiting for a webservice call to return and then rendering the response. Note the actual code for calling the web service itself is not included.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;@WebServlet(&amp;quot;/foo&amp;quot; asyncSupported=true)&lt;br /&gt;public class MyServlet extends HttpServlet {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doGet(HttpServletRequest req, HttpServletResponse res) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AsyncContext aCtx = request.startAsync(req, res);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScheduledThreadPoolExecutor executor = new ThreadPoolExecutor(10);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; executor.execute(new AsyncWebService(aCtx));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;public class AsyncWebService implements Runnable {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AsyncContext ctx;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public AsyncWebService(AsyncContext ctx) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ctx = ctx;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Invoke web service and save result in request attribute&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Forward the request to render the result to a JSP. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctx.forward(&amp;quot;/render.jsp&amp;quot;); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you would like to try it out use the nightly build of the &lt;a rel="nofollow" target="_blank" href="https://glassfish.dev.java.net"&gt;GlassFish&lt;/a&gt; trunk and post any issues that you run into at &lt;a rel="nofollow" target="_blank" href="mailto:webtier@glassfish.dev.java.net"&gt;webtier@glassfish.dev.java.net&lt;/a&gt; which the GlassFish webtier team monitors closely.&lt;/p&gt;&lt;/ul&gt;</description>
         <guid isPermaLink="false">241233 at http://www.java.net</guid>
         <pubDate>Thu, 11 Dec 2008 01:50:22 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/12/asynchronous_su.html</feedburner:origLink></item>
      <item>
         <title>Adding custom handlers to GlassFish v3 loggers</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/QrlYexV8o3k/adding_custom_h.html</link>
         <description>&lt;p&gt;&lt;p&gt;
I recently blogged about the &lt;a rel="nofollow" target="_blank" href="http://weblogs.java.net/blog/carlavmott/archive/2008/10/glassfish_v3_lo.html"&gt;changes to logging GlassFish Prelude&lt;/a&gt;. Building on that I wanted to show how to add custom handlers to your installation of v3.  You may find that you want to log messages to a database, send them to a remote server or log messages from specific loggers to your own file. This can be done by writing a custom log handler. It is pretty straight forward and actually there are two approaches you can take to add the handler.  Either you can write an HK2 service for the handler or a Java class as specified by the JDK. Either approach will work in GlassFish  v3 Prelude so I have examples for both approaches in this blog. In the examples below I simple print some messages to a specific file but you can replace that code with something that interests you.  &lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Option 1&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
First I'll implement the handler as a simple Java class.  This requires for me to write a class that implements the Handler APIs, package it in a jar file and add the jar to the GlassFish classpath.  The last step is to update the &lt;b&gt;logging.properties&lt;/b&gt; file to include the name of the class of the handler.  At server startup the handler is added to the root logger automatically. Since the handler is added to root logger it is available to all loggers.  &lt;/p&gt;
&lt;p&gt;My NewHandler class implements the &lt;b&gt;publish, close&lt;/b&gt; and &lt;b&gt; flush&lt;/b&gt; Handler APIs.  In the publish method, my handler simply writes to a file all messages that come from the web and deployment loggers as those are the ones that I'm interested in seeing.  All messages are still logged to server.log so nothing is lost.&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;package logging;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author cmott&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;import java.util.logging.*;&lt;br /&gt;import java.io.BufferedWriter;&lt;br /&gt;import java.io.FileWriter;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * New Handler&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class NewHandler extends Handler {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static BufferedWriter f = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String webLogger = &amp;quot;javax.enterprise.system.container.web&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String deployLogger = &amp;quot;javax.enterprise.system.tools.deployment&amp;quot;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public NewHandler(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userDir = System.getProperty(&amp;quot;user.dir&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f = new BufferedWriter(new FileWriter(userDir + &amp;quot;/mylogging.log&amp;quot;));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;not able to create log file.&amp;quot;+e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Overridden method used to capture log entries&amp;nbsp;&amp;nbsp; *&lt;br /&gt;&amp;nbsp; * @param record The log record to be written out.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void publish(LogRecord record)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; // first see if this entry should be filtered out&lt;br /&gt;&amp;nbsp; // the filter should keep anything&lt;br /&gt;&amp;nbsp; if ( getFilter()!=null ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; if ( !getFilter().isLoggable(record) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; try { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (webLogger.equals(record.getLoggerName()) || deployLogger.equals(record.getLoggerName()) ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write (&amp;quot;NewHandler output - &amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot;logger name: &amp;quot;+record.getLoggerName());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot; source classname: &amp;quot;+record.getSourceClassName());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot; message: &amp;quot;+record.getMessage());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.newLine();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.flush();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } catch (IOException ex){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;not able to write to log file.&amp;quot;+ex);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Called to close this log handler.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void close()&lt;br /&gt; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.close();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException ex){&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Called to flush any cached data &lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void flush()&lt;br /&gt; {&lt;br /&gt;// not used&lt;br /&gt; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Next I need to do is to package it in a jar file and copy that jar to glassfish/lib directory.  By default the handler is associated with the root logger so all loggers will have messages send to the handler.  &lt;/p&gt;
&lt;p&gt;
Update the property &lt;b&gt;handler&lt;/b&gt; in the &lt;b&gt;logging.properties&lt;/b&gt; file to include the name of the new handler as below.    &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;handlers= java.util.logging.ConsoleHandler, logging.NewHandler&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Restarting the server with the new jar file on the classpath will include the new handler. To test this out I deployed a simple web app and looked at the log file.  There you will see the messages from the new handler we just wrote.  &lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Option 2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
The other option is to create service using HK2. See &lt;a rel="nofollow" target="_blank" href="http://docs.sun.com/app/docs/doc/820-6583/ghmna?a=view"&gt;Chapter 2 Writing HK2 Components&lt;/a&gt; of the GlassFish documentation for more information on writing an HK2 component. Again you need to implement the handler code much like the example above.  I started with that example and added code to make it an HK2 service.  I had to implement PostConstruct and specify that the service contract is provided by the Handler.class which is part of the JDK.  I built the module and then add the jar file to the GlassFish modules directory.  At server startup the module is found and the handler is added to the root logger.  The handler code now looks like:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;package logging;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author cmott&lt;br /&gt; */&lt;br /&gt;import org.jvnet.hk2.annotations.Inject;&lt;br /&gt;import org.jvnet.hk2.annotations.Scoped;&lt;br /&gt;import org.jvnet.hk2.annotations.Service;&lt;br /&gt;import org.jvnet.hk2.annotations.*;&lt;br /&gt;import org.jvnet.hk2.component.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.util.logging.*;&lt;br /&gt;import java.io.BufferedWriter;&lt;br /&gt;import java.io.FileWriter;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * New Handler&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;//specify that the contract is provided by handler.class in the JDK&lt;br /&gt;@Service&lt;br /&gt;@ContractProvided(Handler.class) &lt;br /&gt;@Scoped(Singleton.class)&lt;br /&gt;public class NewHandler extends Handler implements PostConstruct {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Inject&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Habitat habitat;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static BufferedWriter f = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String webLogger = &amp;quot;javax.enterprise.system.container.web&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String deployLogger = &amp;quot;javax.enterprise.system.tools.deployment&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void postConstruct(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 	try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userDir = System.getProperty(&amp;quot;user.dir&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f = new BufferedWriter(new FileWriter(userDir + &amp;quot;/mylogging.log&amp;quot;));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 	} catch (IOException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 		System.out.println(&amp;quot;not able to create log file.&amp;quot;+e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 	}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Overridden method used to capture log entries&amp;nbsp;&amp;nbsp; *&lt;br /&gt;&amp;nbsp; * @param record The log record to be written out.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void publish(LogRecord record)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; // first see if this entry should be filtered out&lt;br /&gt;&amp;nbsp; // the filter should keep anything&lt;br /&gt;&amp;nbsp; if ( getFilter()!=null ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; if ( !getFilter().isLoggable(record) )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (webLogger.equals(record.getLoggerName()) || deployLogger.equals(record.getLoggerName()) ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write (&amp;quot;NewHandler output - &amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot;logger name: &amp;quot;+record.getLoggerName());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot; source classname: &amp;quot;+record.getSourceClassName());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&amp;quot; message: &amp;quot;+record.getMessage()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.newLine();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.flush();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } catch (IOException ex){&lt;br /&gt;&amp;nbsp; 	System.out.println(&amp;quot;not able to write to log file.&amp;quot;+ex);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Called to close this log handler.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void close()&lt;br /&gt; {&lt;br /&gt; 	try {&lt;br /&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp; f.close();&lt;br /&gt; 	} catch (IOException ex){&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;&amp;nbsp; * Called to flush any cached data that&lt;br /&gt;&amp;nbsp; * this log handler may contain.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt; public void flush()&lt;br /&gt; {&lt;br /&gt;// not used&lt;br /&gt; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
I created this as its own module and included the pom files I used to build the module below.  In the example I have a very simple directory structure with handler-module as the parent containing one directory, handler. I've zipped up the standalone module, &lt;a rel="nofollow" target="_blank" href="http://weblogs.java.net/blog/carlavmott/archive/handler-module.zip"&gt;handler-module.zip &lt;/a&gt; rather than include the pom.xml files needed to create it.  &lt;/p&gt;
&lt;p&gt; There is no need to update the logging.properties file when creating a service. All that is needed is to drop the newly created jar file in the modules directory of the v3 installation.  GlassFish detects the service in the modules directory automatically.  Again I deployed a simple web app to test and look at mylogging.log file to see the expected messages.  &lt;/p&gt;
&lt;p&gt;
That's it.&lt;/p&gt;</description>
         <guid isPermaLink="false">241049 at http://www.java.net</guid>
         <pubDate>Tue, 09 Dec 2008 22:08:19 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/12/adding_custom_h.html</feedburner:origLink></item>
      <item>
         <title>Servlet 3.0 - from the source</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/1KZ59Z7-MSw/servlet_30_from.html</link>
         <description>&lt;p&gt;Since the Early draft of the specification for Servlet 3.0 (JSR 315) the expert group has been working on refining and improving the specificaiton in a couple of areas - Ease of Development (EoD), pluggability and asynchronous support. Below is a description of things that are in the soon to be available public review to enable each of these features.&lt;/p&gt;
&lt;p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;h3&gt; Ease of Development (Eod)&lt;/h3&gt;
&lt;p&gt;In the early draft we added the annotations that allowed you to essentially write a Servlet as a POJO. However after some discussions in the expert group and feedback from some folks in the community, we decided to actually remove the method level annotations like @GET, @POST etc and keep the doGet, doPost method contracts and require extending an HttpServlet. However the top level annotations which are renamed for better usage in applications still exist. The @WebServlet annotation is used to declare a servlet, @ServletFilter to declare a filter and @WebServletContextListener to define ServletContextListeners. In addition to these annotations, other annotations like @Resource, which have been supported in web applications since Servlet 2.5 will continue to work as before. As an example a servlet declaration using Servlet 3.0 will now look like - &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;@WebServlet(&amp;quot;/foo&amp;quot;)&lt;br /&gt;public class MyServlet extends HttpServlet {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doGet(...) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;li&gt;
&lt;h3&gt;Pluggability&lt;/h3&gt;
&lt;p&gt; Web frameworks built on top of servlets are very popular for developers and there are a lot of them that address various different problems. In order to better support frameworks for developers writing webapps we are adding ways in the servlet 3.0 specification to make it easier to use and configure frameworks of their choice. There are a couple of ways that enable pluggability - &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Methods to add Servlets and Filters - If a ServletContextListener is registered and wants to add a Servlet or Filter, then at the time of context initialization the event that is fired to the Listener can add Servlets and Filters to the context. The methods are addServlet and addFilter. For more details look for the javadocs when the specification is published.
&lt;li&gt; Web.xml fragments - Instead of having just one monolithic web.xml that is used by the developer to declare servlets, filters and other configuration for using the framework, the framework can now include a web-fragment.xml with all it's configuration. A web-fragment is almost identical to the web.xml and can contain all the configuration needed by the framework in the META-INF directory of the framework's jar file. The container will use the information to assembe the descriptor for the application and the application needn't have to use any of the boilerplate configuration in their app for the framework. There are rules that are defined int the specification for conflict resolution, overriding and disabling fragment scanning. Along with the annotations which also can be in libraries the feature is very compelling not only for the developers that use frameworks but also for framework authors to be self sufficient in defining the configuration needed.
&lt;/ul&gt;
&lt;li&gt;
&lt;h3&gt;Asynchronous processing&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This is the biggest change that we have made in the servlet 3.0 specification. In the early draft we had suspend and resume and certain semantics that were defined. However after the early draft the expert group had a lot of discussions on solving various use cases for asynchronous processing and the changes that are made to the specification in this area now also address the various use cases.
&lt;li&gt;Instead of suspend and resume we now have a startAsync method on request and there are two variations of these. One that takes a request and response in which case the AsyncContext that is created when you call startAsync will be initialized with the request and response passed in. The other is a startAsync() that takes no parameters, in which case the AsyncContext is initialized with the original request and response. Also the Servlets and Filters that support asynchronous processing must be annotated appropriately with asyncSupport attribute set. It is illegal to call startAsync if anywhere in the request processing chain you have  have a servlet or a filter that does not support async.
&lt;li&gt;In addition to the AsyncContext there is also an AsyncListener that can be registered to get notifications on timeout and completion of async processing of a request. The event listener can be used to clean up resources if wrapped request and responses were used to initialize the AsyncContext.
&lt;/ul&gt;
&lt;/ul&gt;
&lt;p&gt;Please take a look at the specification when it is published on the jcp.org website and send us your feedback at &lt;a rel="nofollow" target="_blank" href="mailto:jsr-315-comments@jcp.org"&gt;jsr-315-comments@jcp.org&lt;/a&gt;.&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
An early access implementation of some of the features are available in the &lt;a rel="nofollow" target="_blank" href="https://glassfish.dev.java.net"&gt;GlassFish &lt;/a&gt; nightly build. For further discussion please post your questions about the implementation to &lt;a rel="nofollow" target="_blank" href="mailto:webtier@glassfish.dev.java.net"&gt;webtier@glassfish.dev.java.net&lt;/a&gt;&lt;br /&gt;
&lt;br&gt; Jetty 7 pre-release also has some of the features implemented for those interested.&lt;br /&gt;
&lt;br&gt; Look for more blogs about these features from my colleagues &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/swchan"&gt;Shing Wai&lt;/a&gt; and &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/jluehe"&gt;Jan Luehe&lt;/a&gt; on specifics of some of the implementation.&lt;/p&gt;</description>
         <guid isPermaLink="false">241227 at http://www.java.net</guid>
         <pubDate>Wed, 03 Dec 2008 02:13:17 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/12/servlet_30_from.html</feedburner:origLink></item>
      <item>
         <title>Servlet 3.0 (JSR 315) update</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/-4O0jf3gIms/servlet_30_jsr_2.html</link>
         <description>&lt;p&gt;It's been a while since I gave an update about servlet 3.0. However while I haven't been blogging we at the expert group are working through refining and making the specification better for the web community. We are in the process of making the Public Review available and was waiting to push out a blog after that. However I have seen a few people write about the 3.0 work based on the Early Draft Review (EDR) (like &lt;a rel="nofollow" target="_blank" href="http://www.theserverside.com/tt/tss"&gt;http://www.theserverside.com/tt/tss&lt;/a&gt;)and thought it was best to clarify this so that there isn't any confusion arising from this.&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
The specification has evolved since the EDR and things have changed. the EDR is an early review to get feedback from the community. It is not the final version of the specification. Some of the changes that have happened since the EDR are :&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The annotations to define the http methods (GET, POST, etc) are no longer there. One would still have the extend HttpServlet and use the contract specified there. The top level annotations for declaring a Servlet and Filter are still there and that the expert group still feels is needed and useful to the community. However they are no longer POJOs.
&lt;li&gt;The fragments have evolved since the EDR and the rules for merging the fragments have been specified in the upcoming Public Review.
&lt;li&gt;The asynchronous (or what people are referring to as continuations) has also evolved. First off the notion of continuations is different than async. We now have what the expert group considers a cleaner proposal that will be able to handle a lot more use cases.
&lt;/ol&gt;
&lt;p&gt;&lt;br&gt;&lt;br /&gt;
As an example of some of the things that you will have to do as a developer -&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;@WebServlet(&amp;quot;/foo&amp;quot;)&lt;br /&gt;public class MyServlet extends HttpServlet {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doGet(HttpServletRequest req, HttpServletResponse res) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
The suspend and resume APIs are no longer there. Instead we have a startAsync on request that returns an AsyncContext that the users then can use to do async operations and not have to block a thread to complete the processing.&lt;br /&gt;
&lt;br&gt;&lt;br /&gt;
These are just a sneak peak at what is coming and would encourage users to look at the public review when it becomes avaialble at the jcp.org site and send feedback. In the mean time I also encourage people writing articles / blogs about servlet 3.0 to contact us at &lt;a rel="nofollow" target="_blank" href="mailto:jsr-315-comments@jcp.org"&gt;jsr-315-comments@jcp.org&lt;/a&gt; to get an update from the expert group so they can reflect the status of the specification correctly. I will be writing a more detailed blog with more samples show casing the features in the servlet 3.0 specification in the coming days so stay tuned.&lt;/p&gt;</description>
         <guid isPermaLink="false">241225 at http://www.java.net</guid>
         <pubDate>Tue, 02 Dec 2008 19:24:22 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/12/servlet_30_jsr_2.html</feedburner:origLink></item>
      <item>
         <title>jMaki 1.8.1  and GlassFish V3 released</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/ja56441GWMs/jmaki_181_and_g.html</link>
         <description>&lt;p&gt;You may be seen the announcement yesterday about the &lt;a rel="nofollow" target="_blank" href="http://developers.sun.com/appserver/reference/techart/glassfishv3prelude/"&gt;GlassFish V3 Prelude&lt;/a&gt; release.  At the same time, we released jMaki 1.8.1. jMaki provides a framework for building Ajax applications and was fully tested on GlassFish V3 Prelude.   &lt;/p&gt;
&lt;p&gt;
Highlights of the new features in jMaki include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Drag and Drop widget support into HTML, PHP, Ruby pages
&lt;li&gt; Performance enhancer
&lt;li&gt; Widget Customizer
&lt;li&gt; jMaki CSS Page Templates
&lt;li&gt; Yahoo UI 2.6 Widgets
&lt;li&gt; Dojo Dijit 1.2 Widgets
&lt;li&gt; Scriptaculous 1.8.1 Widgets
&lt;li&gt; jQuery UI 1.5b Widgets
&lt;li&gt; Google 1.8.1 Widgets
&lt;li&gt; jMaki 1.8.1 Widgets
&lt;li&gt; jMaki Extras 1.8.1 Widgets
&lt;/ul&gt;
&lt;p&gt;
You can get jMaki from the &lt;a rel="nofollow" target="_blank" href="https://ajax.dev.java.net/download.html"&gt;download page&lt;/a&gt; or from the GlassFish update center.  Enjoy!&lt;/p&gt;</description>
         <guid isPermaLink="false">241119 at http://www.java.net</guid>
         <pubDate>Fri, 07 Nov 2008 17:50:54 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/11/jmaki_181_and_g.html</feedburner:origLink></item>
      <item>
         <title>GlassFish V3 logging changes</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/BPTfFdrMIZ8/glassfish_v3_lo.html</link>
         <description>&lt;p&gt;
Logging in GlassFish V3 has undergone some changes to leverage the logging utility in JDK. This blogs reviews where we are with the logging mechanism in GlassFish Prelude and since not all of the features are implemented in the Prelude release yet, I'll go over how to make use of the functionality that is there. &lt;/p&gt;
&lt;p&gt;
The most significant change is that for now we don't have support in the Admin GUI or the command line tool asadmin.  That support will be provided in the final release of GlassFish V3.  For now, developers using Prelude will have to edit the &lt;b&gt;logging.properties&lt;/b&gt; file found in the domain config directory where you find the domain.xml file.  Let's take a look at what can be done.&lt;/p&gt;
&lt;p&gt;
Developers can update the logger level, change the log filename and set rotation of log files based on file size or a time limit.  Some of these changes require a restart of the server and some don't.  &lt;/p&gt;
&lt;p&gt;
First let's talk about setting log levels on loggers.  Changes to logger levels are dynamic and don't require a server restart.  At the end of the &lt;b&gt;logging.properties&lt;/b&gt; file you will find a list of loggers in GlassFish.  I have included the most common loggers so developers can easily find what they want.  Below is an excerpt from that file.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;#Tools Logger&lt;br /&gt;#javax.enterprise.system.tools.level=FINE&lt;br /&gt;# EJB Logger&lt;br /&gt;#javax.enterprise.system.container.ejb.level=FINE&lt;br /&gt;#JAVAMAIL_LOGGER&lt;br /&gt;#javax.enterprise.resource.javamail.level=FINE&lt;br /&gt;#JMS_LOGGER&lt;br /&gt;#javax.enterprise.resource.jms.level=FINE&lt;br /&gt;#WEB LOGGER&lt;br /&gt;#javax.enterprise.system.container.web.level=FINE&lt;br /&gt;#CMP_LOGGER&lt;br /&gt;#javax.enterprise.system.container.cmp.level=FINE&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
By default all the logger levels are set to &lt;b&gt;INFO&lt;/b&gt; because the root level is set to &lt;b&gt;INFO&lt;/b&gt;.  If the log level is not set on a logger then it inherits the level of its parent going up the chain until it finds a logger with the level set or it reaches the root logger.  To set the level on a specific logger you simply uncomment the line in &lt;b&gt;logging.properties&lt;/b&gt; corresponding to the logger and set the level appropriately.  Upon saving the file the logging mechanism is notified of a change to the file and resets the log levels for all known loggers based on the information in the file.  Note that you can create your own logger, specify the level in the &lt;b&gt;logging.properties&lt;/b&gt; file and it will be updated too.&lt;/p&gt;
&lt;p&gt;
The log level values are &lt;b&gt;SEVERE, WARNING, INFO, CONFIG, FINE, FINER,&lt;/b&gt; and &lt;b&gt;FINEST&lt;/b&gt;.  Each level includes messages of the level above it so if you set a logger to level &lt;b&gt;INFO&lt;/b&gt; you will also get the &lt;b&gt;SEVERE&lt;/b&gt; and &lt;b&gt;WARNING&lt;/b&gt; messages in addition to the &lt;b&gt;INFO&lt;/b&gt;.  &lt;/p&gt;
&lt;p&gt;
One last note about log levels, it is valid to set the level of the loggers at any point in the logger name.  For example, say you want all the loggers under javax.enterprise.system.container to print at the &lt;b&gt;FINE&lt;/b&gt; level. You simply create a line as follows and save the file.&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;javax.enterprise.system.container.level=FINE&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  Once set, the logger level must be explicitly reset to change the level.  &lt;/p&gt;
&lt;p&gt;
Setting file rotation is also done by changing properties in &lt;b&gt;logging.properties&lt;/b&gt;.  Changing these properties does require a server restart to take affect.  There are two ways to set file rotation in Prelude.  You can request files be rotated based on a file size or based on a time limit.  The properties associated with file rotation are below.&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;# 0 for no rotation based on time&lt;br /&gt;com.sun.enterprise.server.logging.FileandSyslogHandler.rotationTimelimitInMinutes=0&lt;br /&gt;# rotation limit in bytes, 0 means no rotation, 500000 is the minimum&lt;br /&gt;com.sun.enterprise.server.logging.FileandSyslogHandler.rotationLimitInBytes=0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
By default both are set to 0 or no file rotation. If both are set then rotation will be based on time.  You can specify the max size of the log file reached to rotate or create the next log file or the max elapsed time reached to rotate the log file.  &lt;/p&gt;
&lt;p&gt;
For now developers will need to edit the &lt;b&gt;logging.properties&lt;/b&gt; file and it should be pretty straight forward. But remember that the team is working on providing tool support for GlassFish V3 final so it will be easier soon.&lt;/p&gt;</description>
         <guid isPermaLink="false">241021 at http://www.java.net</guid>
         <pubDate>Tue, 28 Oct 2008 21:30:51 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/10/glassfish_v3_lo.html</feedburner:origLink></item>
      <item>
         <title>Ajax Waiter</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/qXSL-2oGhaM/ajax_waiter.html</link>
         <description>&lt;p id="block1"&gt;
I came across a situation where I needed an Ajax style spinner but could not download any images. I extended concepts from the &lt;a rel="nofollow" target="_blank" href="https://ajax.dev.java.net/samples/"&gt;jMaki Revolver&lt;/a&gt; to make an image free spinner all in JavaScript.
&lt;/p&gt;
&lt;div style="height:60px;width:100px;" id="spinme"&gt;&lt;/div&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;nbsp; window.waiter.show({ speed: 1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay : 40,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; targetId : &amp;#039;body&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; textColor : &amp;#039;#FFF&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background: &amp;#039;green&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opacity : 85,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message : &amp;#039;Please wait 2&amp;#039;});&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a rel="nofollow"&gt;Test on this page&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
For detailed documentation on all the properties and more examples see the &lt;a rel="nofollow" target="_blank" href="http://gregmurray.org/waiter"&gt;Ajax Waiter&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;If there are features or enhancements you would like to see let me know.&lt;/p&gt;</description>
         <guid isPermaLink="false">241061 at http://www.java.net</guid>
         <pubDate>Mon, 27 Oct 2008 00:28:42 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/gmurray71/archive/2008/10/ajax_waiter.html</feedburner:origLink></item>
      <item>
         <title>Enabling performance feature in jMaki</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/e6QXemxDrP4/enabling_perfor.html</link>
         <description>&lt;p&gt;
Last spring we added performance enhancements to jMaki based on well known guidelines for improving page load times.  The &lt;a rel="nofollow" target="_blank" href="http://developer.yahoo.com/performance/"&gt;guidelines are from Yahoo&lt;/a&gt; and we have automated several of them.  Now developers can combine JavaScript code and place it at the end of the page, place combine CSS code and place it at the beginning of the page, use minified resources and set the max age header by simply setting some properties in their web app. For more information about the performance enhancements and what is happening under the hood, see the &lt;a rel="nofollow" target="_blank" href="https://ajax.dev.java.net/performance.html"&gt;jMaki performance page&lt;/a&gt;.  This blog details how to take advantage of those performance enhancements in your application.  &lt;/p&gt;
&lt;p&gt;I used Netbeans to create the web application but you can use Eclispe or a plain editor. In this example, I have the jMaki menu, tag cloud and blocklist widgets.  You can use any jMaki wrapped widgets or custom jMaki widgets that you have created to take advantage of this feature. The page looks like:&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;amp;lt;%@ taglib prefix=&amp;quot;a&amp;quot; uri=&amp;quot;http://jmaki/v1.0/jsp&amp;quot; %&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;amp;lt;html&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;head&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;jmaki-2column-footer.css&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;amp;gt;&amp;amp;lt;/link&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;title&amp;amp;gt;Page Title&amp;amp;lt;/title&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=UTF-8&amp;quot; /&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:page&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/head&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;body&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;border&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;header&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;banner&amp;quot;&amp;amp;gt;Application Name&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;subheader&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div&amp;amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;amp;lt;a:widget name=&amp;quot;jmaki.menu&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=&amp;quot;{menu : [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {label: &amp;#039;Links&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu: [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Sun.com&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; href : &amp;#039;http://www.sun.com&amp;#039;},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;jMaki.com&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; href : &amp;#039;http://www.jmaki.com&amp;#039;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {label: &amp;#039;Actions&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; menu: [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Select&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action :{topic: &amp;#039;/foo/select&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message: { targetId : &amp;#039;bar&amp;#039;}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label :&amp;#039;Set Content&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action :{topic: &amp;#039;/foo/setContent&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message: { value : &amp;#039;test.jsp&amp;#039;}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;quot; /&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- sub-header --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- header --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;main&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColumn&amp;quot; style=&amp;quot;height:400px&amp;quot;&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;amp;lt;a:widget name=&amp;quot;jmaki.blockList&amp;quot; value=&amp;quot;[&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {title : &amp;#039;jMaki Project Home&amp;#039;, link : &amp;#039;https://ajax.dev.java.net&amp;#039;, description : &amp;#039;Where to go for the latest jMaki.&amp;#039; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {title : &amp;#039;jMaki Widgets Home&amp;#039;, link : &amp;#039;https://widgets.dev.java.net&amp;#039;, description : &amp;#039;The source for the latest jMaki widgets.&amp;#039; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {title : &amp;#039;jMaki-Charting Home&amp;#039;, link : &amp;#039;https://jmaki-charting.dev.java.net&amp;#039;, description : &amp;#039;Enables complex charts rendered on the client in any modern browser.&amp;#039; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&amp;quot;&amp;nbsp; /&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- end leftColumn --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;leftColumn&amp;quot; style=&amp;quot;height:400px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;a:widget name=&amp;quot;jmaki.tagcloud&amp;quot; value=&amp;quot;{&lt;br /&gt;&amp;nbsp; items : [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;jMaki&amp;#039;, weight : 70},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Web2.0&amp;#039;, weight : 150},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;JSON&amp;#039;, weight : 80},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;JavaScript&amp;#039;, weight : 145},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Java&amp;#039;, weight : 100},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;RSS&amp;#039;, weight : 85},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Autocomplete&amp;#039;, weight : 75},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Sun&amp;#039;, weight : 65, href : &amp;#039;http://www.sun.com&amp;#039;},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;jMaki&amp;#039;, weight : 150},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Web3.0&amp;#039;, weight : 70},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Phobos&amp;#039;, weight : 105},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Glassfish&amp;#039;, weight : 120},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;RSS2.0&amp;#039;, weight : 75},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Web1.0&amp;#039;, weight : 50},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;JavaEE&amp;#039;, weight : 75},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Jersey&amp;#039;, weight : 115},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Roller&amp;#039;, weight : 150},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;CSS&amp;#039;, weight : 105},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;DHTML&amp;#039;, weight : 65},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label : &amp;#039;Netbeans&amp;#039;, weight : 115, href : &amp;#039;http://www.netbeans.com&amp;#039;}&lt;br /&gt;&amp;nbsp; ]&lt;br /&gt;}&amp;quot; /&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- leftColumn --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- main --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;footer&amp;quot;&amp;amp;gt;Footer&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- border --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/a:page&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/body&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
This is a typical jMaki page expect I added 2 new tags.  The &amp;lt;a:page&amp;gt; tag at the beginning tells the jMaki performance code to drop the CSS code and should be in the header.  The closing &amp;lt;/a:page&amp;gt; tag tells jMaki where to drop the combined JavaScript code and should be the last line in the body typically.&lt;/p&gt;
&lt;p&gt;
One other change required is to the web.xml file.  You will need to set some properties to true and to configure the servlet that does the work.  The following needs to be added to the web.xml file.  &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;amp;lt;context-param&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;param-name&amp;amp;gt;jmaki-combinescripts&amp;amp;lt;/param-name&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;param-value&amp;amp;gt;true&amp;amp;lt;/param-value&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/context-param&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;context-param&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;param-name&amp;amp;gt;jmaki-combinestyles&amp;amp;lt;/param-name&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;param-value&amp;amp;gt;true&amp;amp;lt;/param-value&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/context-param&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;servlet&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;servlet-name&amp;amp;gt;Combined Resource Servlet&amp;amp;lt;/servlet-name&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;servlet-class&amp;amp;gt;jmaki.runtime.CombinedResourceServlet&amp;amp;lt;/servlet-class&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;load-on-startup&amp;amp;gt;2&amp;amp;lt;/load-on-startup&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/servlet&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;servlet-mapping&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;servlet-name&amp;amp;gt;Combined Resource Servlet&amp;amp;lt;/servlet-name&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;url-pattern&amp;amp;gt;/cr&amp;amp;lt;/url-pattern&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/servlet-mapping&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
That's it.  Look at the page source of the deployed application and you will see that things have been moved around.  One application reported a 30% improvement in page load time by simply setting these properties.  &lt;/p&gt;
&lt;p&gt;
Try it out and let us know what improvements you see.&lt;/p&gt;</description>
         <guid isPermaLink="false">241044 at http://www.java.net</guid>
         <pubDate>Thu, 23 Oct 2008 03:48:29 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/10/enabling_perfor.html</feedburner:origLink></item>
      <item>
         <title>Happy Birthday NetBeans from jMaki</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/n7XBheniKps/happy_birthday.html</link>
         <description>&lt;p&gt;
I was happy to see that the NetBeans birthday celebration page uses the jMaki revolver widget.   Go to &lt;a rel="nofollow" target="_blank" href="http://www.netbeans.org/birthday/"&gt;netbeans.org/birthday&lt;/a&gt; and you will find the revolver used to easily access an interview with James Gosling, pages pointing to community members, a contest and more. It's a great use of the widget.&lt;/p&gt;
&lt;p&gt;
Happy Birthday NetBeans!&lt;/p&gt;</description>
         <guid isPermaLink="false">241046 at http://www.java.net</guid>
         <pubDate>Wed, 22 Oct 2008 00:00:41 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/10/happy_birthday.html</feedburner:origLink></item>
      <item>
         <title>"JSF and Ajax Past, Present and Future" @ AjaxWorld</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/Ybv_GOy1pqA/jsf_and_ajax_pa.html</link>
         <description>&lt;p&gt;Andy Schwartz (Oracle Corp/JSF 2.0 EG member) and I will be speaking at &lt;a rel="nofollow" target="_blank" href="http://ajaxworld.com"&gt;Ajax World&lt;/a&gt; next week on &lt;a rel="nofollow" target="_blank" href="http://ajaxworld.com/event/session/47"&gt;JSF and Ajax Past, Present and Future&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
The session will explore the variety of JSF Ajax frameworks available today.  Then you will get a preview of the Ajax work that is being standardized in the JSF 2.0 specification.
&lt;/p&gt;</description>
         <guid isPermaLink="false">241016 at http://www.java.net</guid>
         <pubDate>Fri, 17 Oct 2008 14:13:34 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2008/10/jsf_and_ajax_pa.html</feedburner:origLink></item>
      <item>
         <title>JavaServer Faces 2.0 Early Draft Review 2 And JavaScript?</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/LiJuMq_uhck/javaserver_face.html</link>
         <description>&lt;p&gt;
The JavaScript public API is the beginnings of the client side portion of&lt;br /&gt;
the JavaServer Faces / Ajax standard.  The JavaServer Faces 2.0 Expert Group includes members representing other JavaServer Faces / Ajax frameworks such as RichFaces, ADF Faces (Trinidad) and ICEfaces.
&lt;/p&gt;
&lt;p&gt;
We're definitely exploring new territory here, as this is the first time&lt;br /&gt;
that a public JavaScript API has been introduced with JavaServer Faces to  the JCP.  It may be the first time a public JavaScript API has been&lt;br /&gt;
introduced to the JCP, period.&lt;/p&gt;</description>
         <guid isPermaLink="false">240863 at http://www.java.net</guid>
         <pubDate>Mon, 15 Sep 2008 13:41:20 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/rogerk/archive/2008/09/javaserver_face.html</feedburner:origLink></item>
      <item>
         <title>Getting server side data into a jMaki widget</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/JnAyRkz5JvE/getting_server.html</link>
         <description>&lt;img border="0" align="left"/&gt;&lt;p&gt;I got to help out with the EJB 3.1 keynote demo for JavaOne.  Although the demo shows how simple it is to perform CRUD operations using EJB 3.1, this blog focuses on the communication between the client side jMaki components and server side servlet.  &lt;/p&gt;
&lt;p&gt;
For more information on the new EJB features in &lt;a rel="nofollow" target="_blank" href="https://glassfish.dev.java.net//downloads/v3-techPreview-2.html"&gt;GlassFish v3&lt;/a&gt; see &lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/MaheshKannan/"&gt;Mahesh's blog&lt;/a&gt;.   The demo uses some of the latest features in EJB 3.1 and MySQL for a backend data store. I will discuss the client side code for passing data to the server and getting data from the server and displaying it in a widget.  The demo shows how simple it is to perform CRUD operations using EJB 3.1. &lt;/p&gt;
&lt;p&gt;
One requirement was to use the Dojo's Fisheye widget since it looks cool and so I created a set of pages, one each for the operations create, update and delete.  The appropriate page is selected using the fisheye widget so the user could provide the necessary data.  Once the user submitted the data I could then send the request to the server to update the database.  &lt;/p&gt;
&lt;p&gt;
In this demo, I used the Dojo fisheye widget for navigation, html forms for collecting data from the user, Yahoo dialog for displaying errors and a Dojo table to display the data.  The server side code is specific to EJB 3.1 and so must run on GlassFish V3 with the EJB module installed.  MySQL data base is used for storing data.
&lt;p&gt;
A screen shot of the demo:&lt;/p&gt;
&lt;p&gt;&lt;img alt="crudapp.jpeg" src="http://weblogs.java.net/blog/carlavmott/archive/crudapp.jpeg" width="823" height="350"/&gt;&lt;/p&gt;
&lt;p&gt;
Let's look at some of the details. The code for the index.jsp page follows.  Notice that the table is getting data from the servlet "/AuthorServlet" which is returning data in JSON format.  The data base is prepopulated with data so the table is rendered with some rows of data.  I dropped the Yahoo dialogs in the page and made them not visible. The fisheye widget is used for navigation and there are three other pages in the application which are loaded by the dcontainer based on the selection by the fisheye.  More details on that below.&lt;br /&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;&amp;amp;lt;%@ taglib prefix=&amp;quot;a&amp;quot; uri=&amp;quot;http://jmaki/v1.0/jsp&amp;quot; %&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;br /&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;amp;lt;html&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;head&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;jmaki-2column-footer.css&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;amp;gt;&amp;amp;lt;/link&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;title&amp;amp;gt;Page Title&amp;amp;lt;/title&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=UTF-8&amp;quot; /&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/head&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;body&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;border&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;header&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;banner&amp;quot;&amp;amp;gt;CRUD operations using EJB 3.1 &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- header --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;main&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColumn&amp;quot; style=&amp;quot;height:600px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColumnTop&amp;quot; style=&amp;quot;height:180px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColunmTopTable&amp;quot; style=&amp;quot;height:180px&amp;quot;&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:widget&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=&amp;quot;jmaki.dcontainer&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subscribe=&amp;quot;/jmaki/forms&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=&amp;quot;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; items : [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { id : &amp;#039;create&amp;#039;,include : &amp;#039;create.jsp&amp;#039;, overflow : &amp;#039;hidden&amp;#039;}, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { id : &amp;#039;update&amp;#039;, include : &amp;#039;update.jsp&amp;#039;, overflow : &amp;#039;hidden&amp;#039;, lazyLoad : true},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { id : &amp;#039;delete&amp;#039;, include : &amp;#039;delete.jsp&amp;#039;, overflow : &amp;#039;hidden&amp;#039;, lazyLoad : true}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;quot;/&amp;amp;gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColumnTopImages&amp;quot; style=&amp;quot;height:180px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Powered by:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;img src=&amp;quot;images/glassfish-logo.jpg&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;img src=&amp;quot;images/jmaki-seal.png&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- end leftColumn --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;rightColumnBottom&amp;quot; style=&amp;quot;height:415px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;!--&amp;amp;lt;center&amp;amp;gt;Author Table &amp;amp;lt;/center&amp;amp;gt;--&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:widget name=&amp;quot;dojo.table&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service=&amp;quot;/AuthorServlet&amp;quot; /&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- end leftColumn --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- end leftColumn --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;div id=&amp;quot;leftColumn&amp;quot; style=&amp;quot;height:600px&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:widget name=&amp;quot;dojo.fisheye&amp;quot; args=&amp;quot;{orientation:&amp;#039;vertical&amp;#039;}&amp;quot; value=&amp;quot;[ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {iconSrc:&amp;#039;images/document-new.png&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label : &amp;#039;Create&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action : { topic : &amp;#039;/jmaki/forms/select&amp;#039;, message : {targetId : &amp;#039;create&amp;#039;}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {iconSrc:&amp;#039;images/edit-find-replace.png&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label : &amp;#039;Update&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action : { topic : &amp;#039;/jmaki/forms/select&amp;#039;, message : {targetId : &amp;#039;update&amp;#039;}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {iconSrc:&amp;#039;images/edit-delete.png&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label : &amp;#039;Delete&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action : { topic : &amp;#039;/jmaki/forms/select&amp;#039;, message : {targetId : &amp;#039;delete&amp;#039;}}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&amp;quot;/&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:widget id=&amp;quot;dialog1&amp;quot; name=&amp;quot;yahoo.simpledlg&amp;quot;args=&amp;quot;{header : &amp;#039;Error Found&amp;#039;, visible: false, text: &amp;#039;Duplicate Author Id entry found.&amp;nbsp; Provide a unique Author Id&amp;#039;}&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=&amp;quot;{buttons: [ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label:&amp;#039;ok&amp;#039;, isDefault:true }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ] }&amp;quot;/&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;a:widget id=&amp;quot;dialog2&amp;quot; name=&amp;quot;yahoo.simpledlg&amp;quot;args=&amp;quot;{header : &amp;#039;Error Found&amp;#039;, visible: false, text:&amp;nbsp; &amp;#039;Author Id entry not found.&amp;nbsp; Provide a Author Id&amp;#039;}&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=&amp;quot;{buttons: [ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { label:&amp;#039;ok&amp;#039;, isDefault:true }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ] }&amp;quot;/&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- leftColumn --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- main --&amp;amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/div&amp;amp;gt; &amp;amp;lt;!-- border --&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;/body&amp;amp;gt;&lt;br /&gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
Now lets look at how to create an entry in the data which will be reflected in the table.  First let's look at the page create.jsp.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; Enter Data to Create Author Entry: &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;lt;form name=&amp;quot;create&amp;quot;&amp;nbsp; &amp;amp;gt;&lt;br /&gt;&amp;nbsp; Author Id: &amp;amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;authorId&amp;quot; name=authorId/&amp;amp;gt; &amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;&amp;nbsp; Author: &amp;amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;authorName&amp;quot; name=authorName/&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;&amp;nbsp; Organization: &amp;amp;lt;input type=&amp;quot;text&amp;quot; id=&amp;quot;organization&amp;quot; name=organization/&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;&amp;nbsp; &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;amp;lt;input type=&amp;quot;hidden&amp;quot;&amp;nbsp; id=&amp;quot;hidden&amp;quot; name=&amp;quot;create&amp;quot; value=&amp;quot;create&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;doCreate()&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;create&amp;quot;&amp;amp;gt;&lt;br /&gt;&amp;nbsp; &amp;amp;lt;/form&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
As you can see this is a simple form which calls the doCreate function to extract the data.  The doCreate function is in glue.js.  &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;var Service=&amp;quot;/crud/AuthorServlet&amp;quot;;&lt;br /&gt;var rowId;&lt;br /&gt;&lt;br /&gt;function doCreate(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var opName = &amp;quot;create&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var authorName = document.getElementById(&amp;quot;authorName&amp;quot;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var authorId = document.getElementById(&amp;quot;authorId&amp;quot;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var orgName = document.getElementById(&amp;quot;organization&amp;quot;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jmaki.doAjax({method: &amp;quot;POST&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: &amp;quot;/crud/AuthorServlet&amp;quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; content :&amp;nbsp; { authorName: authorName, authorId : authorId, orgName : orgName, opName: opName }, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; callback: function(_req) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tmp = _req.responseText;&lt;br /&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!tmp)&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var a = jmaki.getWidget(&amp;quot;dialog1&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.setVisible(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; else {&lt;br /&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var obj = eval(&amp;quot;(&amp;quot; + tmp + &amp;quot;)&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( opName == &amp;quot;create&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jmaki.publish(&amp;#039;/table/addRow&amp;#039;, obj);&lt;br /&gt;		else {&lt;br /&gt;		&amp;nbsp;&amp;nbsp;&amp;nbsp; jmaki.publish(&amp;#039;/table/updateRow&amp;#039;, obj);&lt;br /&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;	&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onerror: function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var a = jmaki.getWidget(&amp;quot;dialog1&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.setVisible(true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.forms.create.reset();&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; After extracting the data from the form I use jmaki.doAjax to send the data to the server.  I use the property "content" with the values I extracted because this property will pass the data to the server correctly regardless of the platform.  In other words the right thing happens if the server is Java or PHP.  The callback function is called if there were no errors on the server and if so the data received is passed to the table using the standard jMaki publish and subscribe mechanism.  If there was an error on the server the onerror function is called and in this case I set the error dialog to visible.  &lt;/p&gt;
&lt;p&gt;Here is a screen shot of the application with the error dialog:&lt;/p&gt;
&lt;p&gt;&lt;img alt="cruderror.jpeg" src="http://weblogs.java.net/blog/carlavmott/archive/cruderror.jpeg" width="824" height="359"/&gt;&lt;/p&gt;
&lt;p&gt;
Finally I wanted to describe how the fisheye is used to display the correct form.  Looking at the fisheye widget tag you see that each icon will publish to the "/jmaki/forms/select" and the payload contains a string used to identify the operation selected.   The dcontainer subscribes the the "/jmaki/forms" topic.  The dcontainer contains a select handler which looks up the id that it was passed, in this case 'create' and the includes the page create.jsp.  &lt;/p&gt;
&lt;p&gt;
I have posted the war file on the documents and files &lt;a rel="nofollow" target="_blank" href="https://ajax.dev.java.net/servlets/ProjectDocumentList?folderID=9263"&gt; demo area&lt;/a&gt;.  I also have the processRequest method from the AuthorServlet code below so it is easier to see what the server is doing.  There are several helper classes that update the data base or convert Java objects into JSON that are not shown.  &lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;@PersistenceUnit(name=&amp;quot;myAuthorEMF&amp;quot;, unitName = &amp;quot;WebEjbJpaPU&amp;quot;)&lt;br /&gt;public class AuthorServlet extends HttpServlet {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @EJB private AuthorBean authorRef;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //private AuthorHelper authorRef = new AuthorHelper();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Processes requests for both HTTP [prettify]GET&lt;/code&gt;&lt;/pre&gt; and &lt;code class="prettyprint"&gt;POST&lt;/code&gt; methods.&amp;#10;    * @param request servlet request&amp;#10;    * @param response servlet response&amp;#10;    */&amp;#10;    protected void processRequest(HttpServletRequest request, HttpServletResponse response)&amp;#10;    throws ServletException, IOException {&amp;#10;        PrintWriter out = response.getWriter();&amp;#10;        try {&amp;#10;            String opName = request.getParameter(&amp;quot;opName&amp;quot;);&amp;#10;            &amp;#10;            int matchID = -1;&amp;#10;            &amp;#10;            Author author = null;&amp;#10;            &amp;#10;            if (opName == null) {&amp;#10;                opName = &amp;quot;list&amp;quot;;&amp;#10;            } else {&amp;#10;                author = new Author();&amp;#10;                author.setAuthorId(&amp;#10;                        Integer.valueOf(request.getParameter(&amp;quot;authorId&amp;quot;)));&amp;#10;                author.setName(request.getParameter(&amp;quot;authorName&amp;quot;));&amp;#10;                author.setOrganisation(request.getParameter(&amp;quot;orgName&amp;quot;));&amp;#10;            }&amp;#10;            &amp;#10;            if (&amp;quot;update&amp;quot;.equals(opName)) {                &amp;#10;                authorRef.updateAuthor(author);&amp;#10;            } else  if (&amp;quot;create&amp;quot;.equals(opName)) {&amp;#10;                authorRef.createAuthor(author);&amp;#10;            } else if (&amp;quot;delete&amp;quot;.equals(opName)) {&amp;#10;                authorRef.deleteAuthor(author);&amp;#10;            }&amp;#10;            &amp;#10;            sendOutData(author, opName, out);&amp;#10;        } finally { &amp;#10;            out.close();&amp;#10;        }&amp;#10;    }&amp;#10;    &amp;#10;[/prettify]
&lt;p&gt;
That's it.&lt;/p&gt;</description>
         <guid isPermaLink="false">240230 at http://www.java.net</guid>
         <pubDate>Mon, 25 Aug 2008 16:53:15 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/08/getting_server.html</feedburner:origLink></item>
      <item>
         <title>Writing jMaki widgets in the real world</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/8OVE0HD7YGc/writing_jmaki_w.html</link>
         <description>&lt;p&gt;
I found that &lt;a rel="nofollow" target="_blank" href="http://www.travelmuse.com/"&gt;TravelMuse&lt;/a&gt; is a great site to help plan vacations and I was excited to learn that they use jMaki to build the site.   &lt;/p&gt;
&lt;p&gt;
Daniel Ziaoure is the lead Web developer for TravelMuse and uses jMaki extensively.  We were lucky enough to have him join us during our Community One day presentation on jMaki.  He recently started a series of articles explaining how he uses the jMaki widget model and communication mechanism to build the useful and impressive site. His first article &lt;a rel="nofollow" target="_blank" href="http://cybergeniusdz.wordpress.com/2008/07/14/building-an-ajax-login-with-jmaki/"&gt;Building an Ajax Login with jMaki&lt;/a&gt; shows how he used jMaki to build an Ajax enable login widget.  &lt;/p&gt;
&lt;p&gt;</description>
         <guid isPermaLink="false">240733 at http://www.java.net</guid>
         <pubDate>Wed, 20 Aug 2008 21:00:34 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/carlavmott/archive/2008/08/writing_jmaki_w.html</feedburner:origLink></item>
      <item>
         <title>irc channel for GlassFish webtier</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/6t3yM2YzWUA/irc_channel_for.html</link>
         <description>&lt;p&gt;We now have a dedicated irc channel for the GlassFish webtier where you can chat with the engineering team members. It is on irc.freenode.net. For help on how to use irc, the clients for the various OS  &lt;a rel="nofollow" target="_blank" href="http://irchelp.org"&gt;click here&lt;/a&gt;.&lt;br /&gt;
There is also a FAQ for freenode that you  should refer to for any questions regarding usage of freenode. It is located &lt;a rel="nofollow" target="_blank" href="http://freenode.net/faq.shtml"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt; Update&lt;/b&gt;: Someone pointed out that I forgot to put the channel name - it is glassfish-webtier.&lt;/p&gt;</description>
         <guid isPermaLink="false">240649 at http://www.java.net</guid>
         <pubDate>Tue, 05 Aug 2008 17:51:58 +0000</pubDate>
      <feedburner:origLink>http://www.java.net/blog/mode/archive/2008/08/irc_channel_for.html</feedburner:origLink></item>
      <item>
         <title>Job Opportunity in GlassFish Web Container Team</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/zUykDH75zIY/job_opportunity_in_glassfish_web</link>
         <description>What's common between&lt;br&gt;
&lt;ul&gt;
  &lt;li&gt;Close to 5 million downloads per year&lt;/li&gt;
  &lt;li&gt;&lt;a rel="nofollow"
 target="_blank" href="http://markmail.org/browse/net.java.dev.glassfish.users?q=list:net.java"&gt;&amp;gt;
1000 emails/month by users&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Continuously &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/theaquarium/tags/adoption"&gt;growing
adoption&lt;/a&gt; and&lt;/li&gt;
  &lt;li&gt;Hiring&lt;/li&gt;
&lt;/ul&gt;
You are right - &lt;a rel="nofollow" target="_blank" href="http://glassfish.org"&gt;GlassFish&lt;/a&gt;
is the answer! &lt;br&gt;
&lt;br&gt;
If you are a fresh graduate, then &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/exciting_job_opportunity_in_glassfish"&gt;apply
for GlassFish Scripting team&lt;/a&gt;. However if you have&lt;br&gt;
&lt;ul&gt;
  &lt;li&gt;Experience in Developing Web container and related web-tier
technologies such as JSP, Servlets, Java Server Faces and Java Standard
Tag Libraries&lt;/li&gt;
  &lt;li&gt;Like to define the direction of Web container in Java EE
platform and GlassFish Application Server&lt;/li&gt;
  &lt;li&gt;Worked in the Open Source &amp;amp; distributed teams&lt;/li&gt;
  &lt;li&gt;Like to play "follow the leader" where you are the leader :)&lt;/li&gt;
&lt;/ul&gt;
Then GlassFish team needs you. &lt;a rel="nofollow"
 target="_blank" href="http://www.sun.com/corp_emp/search.cgi?req=560051"&gt;Apply
now&lt;/a&gt;!
&lt;br&gt;&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/webtier"&gt;webtier&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/jsp"&gt;jsp&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/servlets"&gt;servlets&lt;/a&gt;&amp;nbsp;&lt;/small&gt;&lt;small&gt;&lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/jstl"&gt;jstl&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/javaserverfaces"&gt;javaserverfaces&lt;/a&gt;&lt;/small&gt;&lt;small&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/job"&gt;job&lt;/a&gt; &lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/job_opportunity_in_glassfish_web</guid>
         <pubDate>Thu, 24 Jul 2008 05:00:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/job_opportunity_in_glassfish_web</feedburner:origLink></item>
      <item>
         <title>Substruct on GlassFish v3 - Ruby-on-Rails E-Commerce Application</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/tiEo4LS01uM/substruct_on_glassfish_v3_ruby</link>
         <description>&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="5"
 cellspacing="5"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a rel="nofollow" target="_blank" href="http://code.google.com/p/substruct/"&gt;&lt;img
 style="border:0px solid;width:260px;height:71px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/substruct-logo.png"&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a rel="nofollow" target="_blank" href="http://code.google.com/p/substruct/"&gt;Substruct&lt;/a&gt;
is an open-source E-Commerce project written using &lt;a rel="nofollow"
 target="_blank" href="http://rubyonrails.org/"&gt;Ruby-on-Rails&lt;/a&gt;
framework. It provides a simple e-commerce platform, content management
system and customer response system - &lt;a rel="nofollow"
 target="_blank" href="http://code.google.com/p/substruct/wiki/ThoughtsBehindSubstruct"&gt;all
in one&lt;/a&gt;.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;br&gt;
I found out about this application from &lt;a rel="nofollow"
 target="_blank" href="http://javapassion.com/"&gt;Sang "Passion" Shin&lt;/a&gt;'s
&lt;a rel="nofollow" target="_blank" href="http://www.javapassion.com/handsonlabs/rails_substruct_app/"&gt;Lab
5542&lt;/a&gt; (part of &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/free_20_week_ruby_on"&gt;FREE
20-week course on Ruby-on-Rails&lt;/a&gt; starting on Jul 15, 2008).
But instead of using standard WEBrick/Mongrel deployment, I describe
the steps to deploy this application using &lt;a rel="nofollow"
 target="_blank" href="http://rubyforge.org/projects/glassfishgem/"&gt;GlassFish
v3 Gem&lt;/a&gt;. The GlassFish Gem installation is described 
&lt;a rel="nofollow" target="_blank" href="http://blogs.sun.com/arungupta/entry/rails_glassfish_gem_0_3"&gt; here&lt;/a&gt;.&lt;br&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a rel="nofollow"
 target="_blank" href="http://code.google.com/p/substruct/downloads/list"&gt;Download&lt;/a&gt;
and install Substruct&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/samples/jruby
&amp;gt;&lt;span style="font-weight:bold;"&gt;gunzip -c
substruct_rel_1-0-a3.tar.gz&amp;nbsp; | tar xvf -&lt;/span&gt;&lt;br&gt;
substruct_rel_1-0-a3/&lt;br&gt;
substruct_rel_1-0-a3/app/&lt;br&gt;
substruct_rel_1-0-a3/app/controllers/&lt;br&gt;
substruct_rel_1-0-a3/app/controllers/application.rb&lt;br&gt;
. . .&lt;br&gt;
substruct_rel_1-0-a3/vendor/rails/railties/test/rails_info_test.rb&lt;br&gt;
substruct_rel_1-0-a3/vendor/rails/railties/test/secret_key_generation_test.rb&lt;br&gt;
substruct_rel_1-0-a3/vendor/rails/Rakefile&lt;br&gt;
substruct_rel_1-0-a3/vendor/rails/release.rb&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
  &lt;li&gt;Install the required gems for Substruct&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/samples/jruby
&amp;gt;&lt;span style="font-weight:bold;"&gt;~/testbed/jruby-1.1.2/bin/jruby
-S gem install RedCloth fastercsv mime-types mini_magick ezcrypto
jruby-openssl
--no-ri --no-rdoc&lt;/span&gt;&lt;br&gt;
JRuby limited openssl loaded. gem install jruby-openssl for full
support.&lt;br&gt;
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL&lt;br&gt;
Bulk updating Gem source index for: http://gems.rubyforge.org/&lt;br&gt;
Successfully installed RedCloth-3.0.4&lt;br&gt;
Successfully installed fastercsv-1.2.3&lt;br&gt;
Successfully installed mime-types-1.15&lt;br&gt;
Successfully installed rubyforge-1.0.0&lt;br&gt;
Successfully installed hoe-1.5.3&lt;br&gt;
Successfully installed mini_magick-1.2.3&lt;br&gt;
Successfully installed ezcrypto-0.7&lt;br&gt;
Successfully installed jruby-openssl-0.2.3&lt;br&gt;
8&amp;nbsp;gems installed&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
  &lt;li&gt;Create the database&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/samples/jruby/substruct_rel_1-0-a3
&amp;gt;&lt;span style="font-weight:bold;"&gt;~/testbed/jruby-1.1.2/bin/jruby
-S rake db:create&lt;/span&gt;&lt;br&gt;
(in /Users/arungupta/samples/jruby/substruct_rel_1-0-a3)&lt;br&gt;
[SUBSTRUCT WARNING]&lt;br&gt;
Mail server settings have not been initialized.&lt;br&gt;
Check to make sure they've been set in the admin panel.&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
  &lt;li&gt;And bootstrap it as&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/samples/jruby/substruct_rel_1-0-a3
&amp;gt;&lt;span style="font-weight:bold;"&gt;~/tesbted/jruby-1.1.2/bin/jruby
-S rake substruct:db:bootstrap&lt;/span&gt;&lt;br&gt;
(in /Users/arungupta/samples/jruby/substruct_rel_1-0-a3)&lt;br&gt;
Checking requirements...&lt;br&gt;
Initializing database...&lt;br&gt;
[SUBSTRUCT WARNING]&lt;br&gt;
Mail server settings have not been initialized.&lt;br&gt;
Check to make sure they've been set in the admin panel.&lt;br&gt;
-- create_table("content_nodes", {:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.3020s&lt;br&gt;
-- add_index("content_nodes", ["name"], {:name=&amp;gt;"name"})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0140s&lt;br&gt;
-- add_index("content_nodes", ["type", "id"], {:name=&amp;gt;"type"})&lt;br&gt;
. . .&lt;br&gt;
-- initialize_schema_information()&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0200s&lt;br&gt;
-- columns("schema_info")&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0650s&lt;br&gt;
Clearing previous data...&lt;br&gt;
Removing all sessions...&lt;br&gt;
Loading default data...&lt;br&gt;
...done.&lt;br&gt;
================================================================================&lt;br&gt;
          &lt;br&gt;
Thanks for trying Substruct 1.0.a3&lt;br&gt;
          &lt;br&gt;
Now you can start the application with 'script/server' &lt;br&gt;
visit: http://localhost:3000/admin, and log in with admin / admin.&lt;br&gt;
          &lt;br&gt;
For help, visit the following:&lt;br&gt;
&amp;nbsp; Official Substruct Sites &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - http://substruct.subimage.com&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - http://code.google.com/p/substruct/&lt;br&gt;
&amp;nbsp; Substruct Google Group -
http://groups.google.com/group/substruct&lt;br&gt;
          &lt;br&gt;
- Subimage LLC - http://www.subimage.com&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
  &lt;li&gt;And finally run it on the GlassFish as:&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/samples/jruby
&amp;gt;&lt;span style="font-weight:bold;"&gt;~/testbed/jruby-1.1.2/bin/jruby
-S glassfish_rails substruct_rel_1-0-a3&lt;/span&gt;&lt;br&gt;
May 28, 2008 1:47:46 PM com.sun.enterprise.glassfish.bootstrap.ASMain
main&lt;br&gt;
INFO: Launching GlassFish on HK2 platform&lt;br&gt;
May 28, 2008 1:47:46 PM
com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient&lt;br&gt;
INFO: Cannot find javadb client jar file, jdbc driver not available&lt;br&gt;
May 28, 2008 1:47:47 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3000&lt;br&gt;
May 28, 2008 1:47:47 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL&lt;br&gt;
WARNING: pewebcontainer.all_ssl_protocols_disabled&lt;br&gt;
May 28, 2008 1:47:47 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL&lt;br&gt;
WARNING: pewebcontainer.all_ssl_ciphers_disabled&lt;br&gt;
May 28, 2008 1:47:47 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3131&lt;br&gt;
May 28, 2008 1:47:47 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3838&lt;br&gt;
May 28, 2008 1:47:48 PM
com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot&lt;br&gt;
INFO: Admin Console Adapter: context root: /admin&lt;br&gt;
May 28, 2008 1:47:48 PM com.sun.enterprise.rails.RailsDeployer
registerAdapter&lt;br&gt;
INFO: Loading application substruct_rel_1-0-a3 at /&lt;br&gt;
May 28, 2008 1:47:48 PM&amp;nbsp; &lt;br&gt;
INFO: Starting Rails instances&lt;br&gt;
May 28, 2008 1:47:56 PM com.sun.grizzly.jruby.RubyObjectPool$1 run&lt;br&gt;
INFO: Rails instance instantiation took : 8800ms&lt;br&gt;
May 28, 2008 1:47:56 PM com.sun.enterprise.v3.server.AppServerStartup
run&lt;br&gt;
INFO: Glassfish v3 started in 10403 ms&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
The welcome screenshot looks like&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-welcome.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:544px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-welcome.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Now copy &lt;a rel="nofollow" target="_blank" href="https://glassfish-theme.dev.java.net/logo.gif"&gt;GlassFish
logo image file&lt;/a&gt; to "public/images" directory of your
application and add the following line to
"app/views/layouts/main.rhtml" file (on line 36):&lt;br&gt;
&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;lt;a
href="http://glassfish.org"&amp;gt;&amp;lt;%=
image_tag('/images/glassfish-logo.gif', :alt =&amp;gt; 'GlassFish')
%&amp;gt;&amp;lt;/a&amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
The modified view looks like as shown below:&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-line36.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:71px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-line36.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
The updated output looks like:&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-with-gf-logo.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:554px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3gem-substruct-with-gf-logo.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I
tried only the basic deployment and that seem to work. If you try
slightly more advanced usecases then the functionality provided by &lt;a rel="nofollow"
 target="_blank" href="http://wiki.rubyonrails.org/rails/pages/RedCloth"&gt;RedCloth&lt;/a&gt;,
&lt;a rel="nofollow" target="_blank" href="http://rubyforge.org/projects/fastercsv/"&gt;fastercsv&lt;/a&gt;,
&lt;a rel="nofollow" target="_blank" href="http://rubyforge.org/projects/mime-types"&gt;mime-types&lt;/a&gt;,
&lt;a rel="nofollow" target="_blank" href="http://rubyforge.org/projects/mini-magick"&gt;mini_magick&lt;/a&gt;
and &lt;a rel="nofollow" target="_blank" href="http://rubyforge.org/projects/ezcrypto"&gt;ezcrypto&lt;/a&gt;
gems can be exercised as well. If you are running Substruct, try it and
&lt;a rel="nofollow" target="_blank" href="mailto:users@glassfish.dev.java.net"&gt;let us know&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
If your Rails application does not work on the gem, &lt;a rel="nofollow"
 target="_blank" href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT"&gt;file
bugs here&lt;/a&gt; with "jruby" as "subcomponent" (default version is
"v3").&lt;br&gt;
&lt;br&gt;
Also check out &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/redmine_on_glassfish_ruby_on"&gt;Redmine&lt;/a&gt;&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/redmine_on_glassfish_ruby_on"&gt;
on GlassFish v3&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/rubyonrails"&gt;rubyonrails&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/netbeans"&gt;netbeans&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/substruct"&gt;substruct&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/webtier"&gt;webtier&lt;/a&gt;&lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/substruct_on_glassfish_v3_ruby</guid>
         <pubDate>Mon, 30 Jun 2008 05:00:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/substruct_on_glassfish_v3_ruby</feedburner:origLink></item>
      <item>
         <title>GlassFish and jMaki @ RailsConf Today</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/p_zezF0GkbY/glassfish_and_jmaki_railsconf_today</link>
         <description>&lt;table style="text-align:left;width:100%;" cellpadding="5"
 cellspacing="5"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;span style="text-decoration:underline;"&gt;&lt;img
 style="width:126px;height:68px;" alt=""
 src="http://assets.en.oreilly.com/1/event/6/rails2008_logo_conf.gif"&gt;&lt;/span&gt;&lt;br&gt;
      &lt;/td&gt;
      &lt;td&gt;I was originally planning to give my first talk at &lt;a rel="nofollow"
 target="_blank" href="http://en.oreilly.com/rails2008/public/content/home"&gt;Rails
Conf&lt;/a&gt;&amp;nbsp;on "&lt;a rel="nofollow"
 target="_blank" href="http://en.oreilly.com/rails2008/public/schedule/detail/1061"&gt;Rails
powered by GlassFish and jMaki&lt;/a&gt;". But I cannot travel for
personal reasons and instead &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/craigmcc/entry/at_railsconf_2008"&gt;Craig
McClanahan&lt;/a&gt;, who is an excellent speaker, has graciously
agreed to speak. Craig has been involved with Rails, &lt;a rel="nofollow"
 target="_blank" href="http://glassfish.dev.java.net"&gt;GlassFish&lt;/a&gt; and
      &lt;a rel="nofollow" target="_blank" href="http://ajax.dev.java.net"&gt;jMaki&lt;/a&gt;
for a long time so feel free to poke hime at the talk, in the &lt;a rel="nofollow"
 target="_blank" href="http://en.oreilly.com/rails2008/public/content/exhibitors"&gt;exhibit
hall&lt;/a&gt; and afterwards.&lt;br&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
Thanks Craig for the &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/craigmcc/entry/at_railsconf_2008"&gt;wishes&lt;/a&gt;!
I had a great time @ RailsConf 2007 (&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/sun_rails_conf_2007_keep"&gt;here&lt;/a&gt;
and &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/tim_bray_s_keynote_session"&gt;here&lt;/a&gt;)
but life is about priorities :)&lt;br&gt;
&lt;br&gt;
More information about support for Dynamic Languages and their
Frameworks on GlassFish can be found on &lt;a rel="nofollow"
 target="_blank" href="http://glassfish-scripting.dev.java.net"&gt;glassfish-scripting.dev.java.net&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/conf"&gt;conf&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/railconf"&gt;railsconf&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/railconf08"&gt;railsconf08&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/jruby"&gt;jruby&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/ruby"&gt;ruby&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/rubyonrails"&gt;rubyonrails&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/jmaki"&gt;jmaki&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/webtier"&gt;webtier&lt;/a&gt;&lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/glassfish_and_jmaki_railsconf_today</guid>
         <pubDate>Fri, 30 May 2008 06:42:24 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/glassfish_and_jmaki_railsconf_today</feedburner:origLink></item>
      <item>
         <title>JRuby 1.1.2 released - Getting Started with v3 Gem</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/tNy5Zd9WlfA/jruby_1_1_2_released</link>
         <description>&lt;br&gt;
JRuby 1.1.2 was &lt;a rel="nofollow"
 target="_blank" href="http://www.bloglines.com/blog/ThomasEEnebo?id=52"&gt;released
yesterday&lt;/a&gt; - &lt;a rel="nofollow"
 target="_blank" href="http://dist.codehaus.org/jruby/jruby-bin-1.1.2.zip"&gt;download
here&lt;/a&gt;!&lt;br&gt;
&lt;br&gt;
The highlights are:&lt;br&gt;
&lt;ul&gt;
  &lt;li&gt;Startup time drastically reduced&lt;/li&gt;
  &lt;li&gt;YAML symbol parsing &amp;gt;100x faster&lt;/li&gt;
  &lt;li&gt;Performance, threading, and stack depth improvements for
method calls&lt;/li&gt;
  &lt;li&gt;Fixed several nested backref problems&lt;/li&gt;
  &lt;li&gt;Fixed bad data race (JRUBY-2483)&lt;/li&gt;
  &lt;li&gt;Gazillions of bigdecimal issues fixed&lt;/li&gt;
  &lt;li&gt;95 issues resolved since JRuby 1.1.1&lt;br&gt;
  &lt;/li&gt;
&lt;/ul&gt;
Getting started is really simple, just follow the steps listed below.&lt;br&gt;
&lt;br&gt;
Unzip &lt;a rel="nofollow" target="_blank" href="http://dist.codehaus.org/jruby/jruby-bin-1.1.2.zip"&gt;JRuby
1.1.2 zip bundle&lt;/a&gt; ...&lt;br&gt;
&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/
&amp;gt;&lt;span style="font-weight:bold;"&gt;unzip
~/Downloads/jruby-bin-1.1.2.zip&lt;/span&gt; &lt;br&gt;
Archive:&amp;nbsp; /Users/arungupta/Downloads/jruby-bin-1.1.2.zip&lt;br&gt;
&amp;nbsp;&amp;nbsp; creating: jruby-1.1.2/&lt;br&gt;
&amp;nbsp;&amp;nbsp; creating: jruby-1.1.2/bin/&lt;br&gt;
&amp;nbsp; inflating: jruby-1.1.2/bin/_jrubycleanup.bat&amp;nbsp; &lt;br&gt;
&amp;nbsp; inflating: jruby-1.1.2/bin/_jrubyvars.bat&amp;nbsp; &lt;br&gt;
&amp;nbsp; . . .&lt;br&gt;
&amp;nbsp; inflating:
jruby-1.1.2/share/ri/1.8/system/Zlib/crc_table-c.yaml&amp;nbsp; &lt;br&gt;
&amp;nbsp; inflating:
jruby-1.1.2/share/ri/1.8/system/Zlib/zlib_version-c.yaml&amp;nbsp; &lt;br&gt;
&amp;nbsp; inflating:
jruby-1.1.2/share/ri/1.8/system/created.rid&amp;nbsp; &lt;br&gt;
&amp;nbsp; inflating:
jruby-1.1.2/share/ri/1.8/system/fatal/cdesc-fatal.yaml&amp;nbsp; &lt;br&gt;
~/testbed &amp;gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
... and then install &lt;a rel="nofollow" target="_blank" href="http://rubyonrails.org"&gt;Rails&lt;/a&gt;
and&amp;nbsp;&lt;a rel="nofollow" target="_blank" href="http://rubyforge.org/projects/glassfishgem/"&gt;GlassFish
v3 gem&lt;/a&gt; ...&lt;br&gt;
&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/jruby-1.1.2
&amp;gt;&lt;span style="font-weight:bold;"&gt;bin/jruby -S gem
install rails glassfish --no-ri --no-rdoc&lt;/span&gt;&lt;br&gt;
JRuby limited openssl loaded. gem install jruby-openssl for full
support.&lt;br&gt;
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL&lt;br&gt;
Bulk updating Gem source index for: http://gems.rubyforge.org/&lt;br&gt;
Bulk updating Gem source index for: http://gems.rubyforge.org/&lt;br&gt;
Successfully installed activesupport-2.0.2&lt;br&gt;
Successfully installed activerecord-2.0.2&lt;br&gt;
Successfully installed actionpack-2.0.2&lt;br&gt;
Successfully installed actionmailer-2.0.2&lt;br&gt;
Successfully installed activeresource-2.0.2&lt;br&gt;
Successfully installed rails-2.0.2&lt;br&gt;
Successfully installed glassfish-0.2.0-universal-java&lt;br&gt;
6 gems installed&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
... and verify ...&lt;br&gt;
&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/jruby-1.1.2
&amp;gt;&lt;span style="font-weight:bold;"&gt;bin/jruby -S gem
list g&lt;/span&gt;
      &lt;br&gt;
      &lt;br&gt;
&amp;#92;*&amp;#92;*&amp;#92;* LOCAL GEMS &amp;#92;*&amp;#92;*&amp;#92;*&lt;br&gt;
      &lt;br&gt;
glassfish (0.2.0)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
... and now host any of your Rails application on v3 Gem (such as &lt;a rel="nofollow"
 target="_blank" href="http://www.redmine.org/"&gt;Redmine&lt;/a&gt;) ...&lt;br&gt;
&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine
&amp;gt;&lt;span style="font-weight:bold;"&gt;../jruby-1.1.2/bin/jruby
-S glassfish_rails redmine-0.7&lt;/span&gt;&lt;br&gt;
May 28, 2008 12:07:19 PM com.sun.enterprise.glassfish.bootstrap.ASMain
main&lt;br&gt;
INFO: Launching GlassFish on HK2 platform&lt;br&gt;
May 28, 2008 12:07:19 PM
com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient&lt;br&gt;
INFO: Cannot find javadb client jar file, jdbc driver not available&lt;br&gt;
May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3000&lt;br&gt;
May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL&lt;br&gt;
WARNING: pewebcontainer.all_ssl_protocols_disabled&lt;br&gt;
May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL&lt;br&gt;
WARNING: pewebcontainer.all_ssl_ciphers_disabled&lt;br&gt;
May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3131&lt;br&gt;
May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start&lt;br&gt;
INFO: Listening on port 3838&lt;br&gt;
May 28, 2008 12:07:21 PM
com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot&lt;br&gt;
INFO: Admin Console Adapter: context root: /admin&lt;br&gt;
May 28, 2008 12:07:21 PM com.sun.enterprise.rails.RailsDeployer
registerAdapter&lt;br&gt;
INFO: Loading application redmine-0.7 at /&lt;br&gt;
May 28, 2008 12:07:21 PM&amp;nbsp; &lt;br&gt;
INFO: Starting Rails instances&lt;br&gt;
May 28, 2008 12:07:26 PM&amp;nbsp; &lt;br&gt;
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for
full support.&lt;br&gt;
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL&lt;br&gt;
May 28, 2008 12:07:32 PM com.sun.grizzly.jruby.RubyObjectPool$1 run&lt;br&gt;
INFO: Rails instance instantiation took : 11481ms&lt;br&gt;
May 28, 2008 12:07:32 PM com.sun.enterprise.v3.server.AppServerStartup
run&lt;br&gt;
INFO: Glassfish v3 started in 12787 ms&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
Below is the screenshot from a &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/redmine_on_glassfish_ruby_on"&gt;previously
deployed&lt;/a&gt; Redmine application, now on the GlassFish gem:&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/jruby112-v3-gem-redmine.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:598px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/jruby112-v3-gem-redmine.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Simple isn't it ?&lt;br&gt;
&lt;br&gt;
If your Rails application does not work on the gem, &lt;a rel="nofollow"
 target="_blank" href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT"&gt;file
bugs here&lt;/a&gt; with "jruby" as "subcomponent" (default version is
"v3").&lt;br&gt;
&lt;br&gt;
Alternatively, you can download &lt;a rel="nofollow"
 target="_blank" href="http://glassfish.org/downloads/v3"&gt;GlassFish v3 TP2&lt;/a&gt;
and &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/rails_and_java_ee_integration2"&gt;deploy
your applications&lt;/a&gt; to leverage complete Java EE functionality.&lt;br&gt;
&lt;br&gt;
You can also configure JRuby 1.1.2 as a Ruby platform in NetBeans 6.1
as described in &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/totd_27_configurable_multiple_ruby"&gt;TOTD
#27&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/jruby"&gt;jruby&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/ruby"&gt;ruby&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/rubyonrails"&gt;rubyonrails&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/v3"&gt;v3&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/gem"&gt;gem&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/redmine"&gt;redmine&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/netbeans"&gt;netbeans&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/webtier"&gt;webtier&lt;/a&gt;&lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/jruby_1_1_2_released</guid>
         <pubDate>Wed, 28 May 2008 23:45:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/jruby_1_1_2_released</feedburner:origLink></item>
      <item>
         <title>Redmine on GlassFish - Ruby-on-Rails Project Management Application</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/4vWSUVz4jIw/redmine_on_glassfish_ruby_on</link>
         <description>&lt;br&gt;
&lt;a rel="nofollow" target="_blank" href="http://www.redmine.org/"&gt;&lt;br&gt;
Redmine&lt;/a&gt; is a flexible project management web application
written using &lt;a rel="nofollow" target="_blank" href="http://rubyonrails.org"&gt;Ruby on
Rails&lt;/a&gt; framework. The &lt;a rel="nofollow"
 target="_blank" href="http://www.redmine.org/wiki/redmine"&gt;feature list&lt;/a&gt;
is pretty comprehensive from the usual suspects like multiple projects,
role-based control, forums/wikis/SCM for each project to enterprise
level features such as LDAP-authentication and multiple languages. It
is cross-platform and cross-database and deploys very nicely on &lt;a rel="nofollow"
 target="_blank" href="http://glassfish.dev.java.net/downloads/v3"&gt;GlassFish
v3&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
GlassFish v3 modularity and extensibility allows Rails applications to
be deployed &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/rails_and_java_ee_integration2"&gt;without
any modification&lt;/a&gt; (no WARing). This blog explains the
steps on how to deploy Redmine on GlassFish and shows some screenshots
later.&amp;nbsp;More
documentation is available in &lt;a rel="nofollow"
 target="_blank" href="http://www.redmine.org/wiki/redmine/Guide"&gt;Redmine
Guide&lt;/a&gt;.
&lt;ol&gt;
  &lt;li&gt;Check out the most stable release of Redmine by giving the
command:&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine
&amp;gt;&lt;span style="font-weight:bold;"&gt;svn co
http://redmine.rubyforge.org/svn/branches/0.7-stable redmine-0.7&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
  &lt;li&gt;Configure the database&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Start your MySQL server&amp;nbsp;&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine
&amp;gt;&lt;span style="font-weight:bold;"&gt;sudo mysqld_safe
--user root&lt;/span&gt;&lt;br&gt;
Starting mysqld daemon with databases from /usr/local/mysql/data&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
    &lt;li&gt;Create the database as:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine/redmine-0.7
&amp;gt;&lt;span style="font-weight:bold;"&gt;../jruby-1.1.1/bin/jruby
-S rake db:create&lt;/span&gt;&lt;br&gt;
(in /Users/arungupta/testbed/redmine/redmine-0.7)&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
    &lt;li&gt;Migrate the database as:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine/redmine-0.7
&amp;gt;&lt;span style="font-weight:bold;"&gt;../jruby-1.1.1/bin/jruby
-S rake db:migrate&lt;/span&gt;&lt;br&gt;
(in /Users/arungupta/testbed/redmine/redmine-0.7)&lt;br&gt;
== 1 Setup: migrating
=========================================================&lt;br&gt;
-- create_table("attachments", {:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.2840s&lt;br&gt;
-- create_table("auth_sources", {:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0540s&lt;br&gt;
-- create_table("custom_fields", {:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0430s&lt;br&gt;
-- create_table("custom_fields_projects", {:id=&amp;gt;false,
:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0080s&lt;br&gt;
-- create_table("custom_fields_trackers", {:id=&amp;gt;false,
:force=&amp;gt;true})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0500s&lt;br&gt;
            &lt;br&gt;
. . .&lt;br&gt;
            &lt;br&gt;
== 90 ChangeVersionsNameLimit: migrating
======================================&lt;br&gt;
-- change_column(:versions, :name, :string, {:limit=&amp;gt;nil})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0220s&lt;br&gt;
== 90 ChangeVersionsNameLimit: migrated (0.0220s)
=============================&lt;br&gt;
            &lt;br&gt;
== 91 ChangeChangesetsRevisionToString: migrating
=============================&lt;br&gt;
-- change_column(:changesets, :revision, :string, {:null=&amp;gt;false})&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0210s&lt;br&gt;
== 91 ChangeChangesetsRevisionToString: migrated (0.0230s)
====================&lt;br&gt;
            &lt;br&gt;
== 92 ChangeChangesFromRevisionToString: migrating
============================&lt;br&gt;
-- change_column(:changes, :from_revision, :string)&lt;br&gt;
&amp;nbsp;&amp;nbsp; -&amp;gt; 0.0130s&lt;br&gt;
== 92 ChangeChangesFromRevisionToString: migrated (0.0150s)
===================&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Download, Install and Configure GlassFish v3&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Download GlassFish v3 from &lt;a rel="nofollow"
 target="_blank" href="https://glassfish.dev.java.net/downloads/v3"&gt;here&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Unzip the downloaded bundle.&lt;/li&gt;
    &lt;li&gt;Add the following fragment as the last line in
"glassfishv3-tp2/glassfish/config/asenv.conf" file:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;JRUBY_HOME="/Users/arungupta/testbed/redmine/jruby-1.1.1"&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Deploy Redmine as:&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;~/testbed/redmine
&amp;gt;&lt;span style="font-weight:bold;"&gt;./glassfishv3-tp2/glassfish/bin/asadmin
deploy redmine-0.7&lt;/span&gt;&lt;br&gt;
Command deploy executed successfully.&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;br&gt;
... and the GlassFish console shows:&lt;br&gt;
    &lt;br&gt;
    &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td style="background-color:rgb(204, 204, 255);"&gt;May
21, 2008 4:58:30 PM com.sun.enterprise.rails.RailsDeployer
registerAdapter&lt;br&gt;
INFO: Loading application redmine-0.7 at /redmine-0.7&lt;br&gt;
May 21, 2008 4:58:30 PM&amp;nbsp; &lt;br&gt;
INFO: Starting Rails instances&lt;br&gt;
May 21, 2008 4:58:37 PM&amp;nbsp; &lt;br&gt;
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for
full support.&lt;br&gt;
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL&lt;br&gt;
May 21, 2008 4:58:42 PM com.sun.grizzly.jruby.RubyObjectPool$1 run&lt;br&gt;
INFO: Rails instance instantiation took : 11979ms&lt;br&gt;
May 21, 2008 4:58:42 PM com.sun.enterprise.v3.deployment.DeployCommand
execute&lt;br&gt;
INFO: Deployment of redmine-0.7 done is 12091 ms&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/li&gt;
&lt;/ol&gt;
That's it, your application is ready to be used! Here are some screen
snapshots from my trial run:&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-first-screen.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-first-screen.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;img style="width:631px;height:404px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-login-screen.png"&gt;&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-admin-screen.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:222px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-admin-screen.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-admin-screen-personalize.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-admin-screen-personalize.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-new-project.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-new-project.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-2-projects-created.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-2-projects-created.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-project-settings.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-project-settings.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-new-user.png"&gt;&lt;img
 style="border:0px solid;width:700px;height:613px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/ror/v3-ror-redmine-new-user.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a rel="nofollow"
 target="_blank" href="http://developers.sun.com/appserver/reference/techart/rails_gf/"&gt;Rails
powered by the GlassFish Application Server&lt;/a&gt; provides all the
good reasons on why you should consider using GlassFish instead of the
traditional deployment models for Ruby-on-Rails applications.&lt;br&gt;
&lt;br&gt;
This application is also covered in &lt;a rel="nofollow"
 target="_blank" href="http://www.javapassion.com/handsonlabs/rails_redmine_app/"&gt;LAB
5539&lt;/a&gt; as part of &lt;a rel="nofollow"
 target="_blank" href="http://blogs.sun.com/arungupta/entry/free_20_week_ruby_on"&gt;FREE
20-week Ruby-on-Rails course&lt;/a&gt; by &lt;a rel="nofollow"
 target="_blank" href="http://javapassion.com"&gt;Sang "with Passion" Shin&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/web2.0"&gt;web2.0&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/rubyonrails"&gt;rubyonrails&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/jruby"&gt;jruby&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/ruby"&gt;ruby&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/redmine"&gt;redmine&lt;/a&gt;&lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/redmine_on_glassfish_ruby_on</guid>
         <pubDate>Fri, 23 May 2008 06:00:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/redmine_on_glassfish_ruby_on</feedburner:origLink></item>
      <item>
         <title>Socialsite @ Enterprise 2.0 Conference - Add social networking to your community</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/Gt1OoqdGBBg/socialsite_enterprise_2_0_conference</link>
         <description>&lt;br&gt;
&lt;table style="text-align:left;width:100%;" cellpadding="2"
 cellspacing="2"&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;img style="width:313px;height:72px;"
 alt=""
 src="http://blogs.sun.com/arungupta/resource/confs/enterprise2.0-conf-2008.png"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a rel="nofollow" target="_blank" href="http://sun.com"&gt;Sun Microsytems&lt;/a&gt;
is a sponsor of &lt;a rel="nofollow" target="_blank" href="http://enterprise2conf.com/"&gt;Enterprise
2.0 Conference&lt;/a&gt; (Jul 9-12, 2008, Boston).&lt;br&gt;
      &lt;br&gt;
The conference has regular &lt;a rel="nofollow"
 target="_blank" href="http://enterprise2conf.com/conference/tutorials.php"&gt;tutorials&lt;/a&gt;,
      &lt;a rel="nofollow"
 target="_blank" href="http://enterprise2conf.com/conference/general-sessions.php"&gt;keynotes
and general sessions&lt;/a&gt;, &lt;a rel="nofollow"
 target="_blank" href="http://enterprise2conf.com/conference/by-track.php"&gt;multiple
tracks&lt;/a&gt; and &lt;a rel="nofollow"
 target="_blank" href="http://enterprise2conf.com/exhibition/demo-pavilion.php"&gt;pavilion&lt;/a&gt;
(even a &lt;a rel="nofollow"
 target="_blank" href="http://enterprise2conf.com/registration/?priorityCode=CMBTEB03"&gt;free
pavilion pass&lt;/a&gt;). They also have &lt;a rel="nofollow"
 target="_blank" href="http://launchpad.enterprise2conf.com/"&gt;Launch Pad&lt;/a&gt;
that allow companies developing new social networking products to
compete for the chance to present them in front of the largest audience
in the Enterprise 2.0 community.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;br&gt;
There are 8 companies in Round 2 and each one of them has submitted a
video highlighting their offering. One of the semi-finalists
is&amp;nbsp;&lt;a rel="nofollow" target="_blank" href="https://socialsite.dev.java.net/"&gt;Project
Socialsite&lt;/a&gt; - an offering from &lt;a rel="nofollow" target="_blank" href="http://sun.com"&gt;Sun
Microsystems&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Project SocialSite makes it easy to add social networking features to
your existing web applications or community sites (running on Java, PHP
or Ruby) and turn it into an &lt;a rel="nofollow"
 target="_blank" href="http://code.google.com/apis/opensocial/"&gt;OpenSocial&lt;/a&gt;
container. It comes with a comprehensive and highly scalable
implementation of social graph, integrates seamlessly with existing
identity and authentication mechanism, make it easy to plug into
existing directory server or other user management systems.&lt;br&gt;
&lt;br&gt;
The &lt;a rel="nofollow" target="_blank" href="http://launchpad.enterprise2conf.com/node/39"&gt;submitted
video&lt;/a&gt; shows how easy it is add social networking features
(such as Profile, Friends and Activity) to &lt;a rel="nofollow"
 target="_blank" href="http://www.mediawiki.org/wiki/MediaWiki"&gt;MediaWiki&lt;/a&gt;
by adding simple tags. We hope you like the functionality shown and
give us a higher rating to help us qualify for finals :)&lt;br&gt;
&lt;br&gt;
Follow the &lt;a rel="nofollow" target="_blank" href="http://www.enterprise2blog.com/"&gt;conference
blog&lt;/a&gt;, &lt;a rel="nofollow"
 target="_blank" href="http://www.facebook.com/group.php?gid=5561504394"&gt;Facebook
group&lt;/a&gt; or participate using &lt;a rel="nofollow"
 target="_blank" href="http://www.socialtext.net/enterprise20conference/index.cgi"&gt;conference
wiki&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/conf"&gt;conf&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/enterprise2.0"&gt;enterprise2.0&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/socialsite"&gt;socialsite&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/web2.0"&gt;web2.0&lt;/a&gt;&lt;/small&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/socialsite_enterprise_2_0_conference</guid>
         <pubDate>Thu, 22 May 2008 06:00:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/socialsite_enterprise_2_0_conference</feedburner:origLink></item>
      <item>
         <title>Embeddable GlassFish in Action - Servlet in a Maven project</title>
         <link>http://feedproxy.google.com/~r/GlassFish-webtier/~3/XZqqBxrufos/embeddable_glassfish_in_action_servlet</link>
         <description>&lt;a rel="nofollow" target="_blank" href="http://weblogs.java.net/blog/kohsuke/"&gt;Kohsuke&lt;/a&gt;
announced the &lt;a rel="nofollow"
 target="_blank" href="http://weblogs.java.net/blog/kohsuke/archive/2008/04/glassfish_v3_ju.html"&gt;embedability
of GlassFish v3&lt;/a&gt; - this is really cool! Now you can run
GlassFish inside an existing JVM, without the need to start it
externally. The API javadocs are available &lt;a rel="nofollow"
 target="_blank" href="https://embedded-glassfish.dev.java.net/nonav/gf-embedded-api/apidocs/"&gt;here&lt;/a&gt;.
This blog explains how to host a Servlet using these APIs and write a
simple Maven test to invoke the Servlet - all within the same VM.&lt;br&gt;
&lt;br&gt;
The blog creates a Maven project using NetBeans but Maven CLI can be
used as well.&lt;br&gt;
&lt;br&gt;
In the &lt;a rel="nofollow" target="_blank" href="http://netbeans.org"&gt;NetBeans IDE&lt;/a&gt;,
if Maven plugin is not already installed, then install it using
"Tools", "Plugins","Available Plugins". &lt;br&gt;
&lt;ol&gt;
  &lt;li&gt;Create a new Maven project &lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Create a new project in NetBeans IDE and select "Maven"
types as shown below&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:721px;height:497px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-create-maven-project.png"&gt;&lt;br&gt;
      &lt;br&gt;
Click on "Next &amp;gt;".&lt;/li&gt;
    &lt;li&gt;Take the default "Archetype" as shown:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:723px;height:496px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-create-maven-project-archetype.png"&gt;&lt;br&gt;
      &lt;br&gt;
Click on "Next &amp;gt;".&lt;br&gt;
    &lt;/li&gt;
    &lt;li&gt;Enter the "Project Name" and "Artifact Id" as shown below:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:720px;height:497px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-create-maven-project-name-location.png"&gt;&lt;br&gt;
      &lt;br&gt;
and click on "Finish". The following output is shown in NetBeans Output
window:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:751px;height:637px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-create-maven-project-success.png"&gt;&lt;br&gt;
      &lt;br&gt;
This confirms the successful creation of the project.&lt;br&gt;
      &lt;br&gt;
The command-line equivalent for all the above steps&amp;nbsp;is:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;mvn
archetype:create -DarchetypeGroupId=org.apache.maven.archetypes
-DgroupId=org.glassfish.embedded.samples -DartifactId=webtier&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Update pom.xml with &lt;span style="font-style:italic;"&gt;repositories&lt;/span&gt;
&amp;amp; &lt;span style="font-style:italic;"&gt;dependencies&lt;/span&gt;&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Expand "Project Files" and open "pom.xml". Add the
following &lt;span style="font-style:italic;"&gt;repositories&lt;/span&gt;
(right after &amp;lt;url&amp;gt;...&amp;lt;/url&amp;gt; tags)&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;lt;repositories&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;repository&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;id&amp;gt;glassfish-repository&amp;lt;/id&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;name&amp;gt;Java.net Repository for
Glassfish&amp;lt;/name&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;url&amp;gt;http://download.java.net/maven/glassfish&amp;lt;/url&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/repository&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;repository&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;id&amp;gt;download.java.net&amp;lt;/id&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;name&amp;gt;Java.net Maven Repository&amp;lt;/name&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;url&amp;gt;http://download.java.net/maven/2&amp;lt;/url&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/repository&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/repositories&amp;gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
    &lt;li&gt;Add the following fragment after
"&amp;lt;repositories&amp;gt;" to set the target JDK as 1.5:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;lt;build&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugins&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;plugin&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;version&amp;gt;2.0.2&amp;lt;/version&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;configuration&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/configuration&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/plugins&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/build&amp;gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
    &lt;li&gt;Add the following &lt;span style="font-style:italic;"&gt;dependencies&lt;/span&gt;
(inside "&amp;lt;dependencies&amp;gt;" and after
"&amp;lt;/dependency&amp;gt;")&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;lt;dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;groupId&amp;gt;org.glassfish.distributions&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;artifactId&amp;gt;web-all&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;version&amp;gt;10.0-build-20080430&amp;lt;/version&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;groupId&amp;gt;org.glassfish.embedded&amp;lt;/groupId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;artifactId&amp;gt;gf-embedded-api&amp;lt;/artifactId&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;version&amp;gt;1.0-alpha-4&amp;lt;/version&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Add Servlet class&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Right-click on "Source packages", select "New", "Java
Class..." and
enter the value as shown below&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:720px;height:497px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-servlet-create.png"&gt;&lt;br&gt;
      &lt;br&gt;
and click on "Finish".&lt;/li&gt;
    &lt;li&gt;Replace the template class with the following
Servlet&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;package
org.glassfish.embedded.samples.webtier;&lt;br&gt;
            &lt;br&gt;
import java.io.IOException;&lt;br&gt;
import java.io.PrintWriter;&lt;br&gt;
import javax.servlet.ServletException;&lt;br&gt;
import javax.servlet.http.HttpServlet;&lt;br&gt;
import javax.servlet.http.HttpServletRequest;&lt;br&gt;
import javax.servlet.http.HttpServletResponse;&lt;br&gt;
            &lt;br&gt;
/&amp;#92;*&amp;#92;*&lt;br&gt;
&amp;nbsp;&amp;#92;* @author Arun Gupta&lt;br&gt;
&amp;nbsp;&amp;#92;*/&lt;br&gt;
public class SimpleServlet extends HttpServlet {&lt;br&gt;
            &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void doGet(HttpServletRequest
request, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
HttpServletResponse response) &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
throws ServletException, IOException {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
PrintWriter out = response.getWriter();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
out.println("Wow, I'm embedded!");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br&gt;
This is a simple Servlet class.&lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Add deployment descriptor (this step could be made optional
with possibly a default mapping)&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;In the "Files" window, expand "src", "main", right-click
and select
"New", "Folder..." as shown below ...&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:429px;height:385px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-resources-new-folder.png"&gt;&lt;br&gt;
      &lt;br&gt;
and give the folder name as "resources" as shown ...&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:724px;height:498px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-resources-new-folder-name.png"&gt;&lt;br&gt;
      &lt;br&gt;
... click on "Finish".&lt;/li&gt;
    &lt;li&gt;Using the same mechanism, create a new folder
"WEB-INF" in "resources". Right-click on "WEB-INF" and select "New",
"XML Document..." as shown:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:509px;height:379px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-resources-new-xml.png"&gt;&lt;/li&gt;
    &lt;li&gt;Enter the name as "web" as shown&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:723px;height:497px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-resources-webxml.png"&gt;&lt;br&gt;
    &lt;/li&gt;
    &lt;li&gt;Click on "Next &amp;gt;", take defaults and click on
"Finish".
Replace the content of generated "web.xml" with the following ...&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;lt;?xml
version="1.0" encoding="UTF-8"?&amp;gt;&lt;br&gt;
&amp;lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;servlet-name&amp;gt;SimpleServlet&amp;lt;/servlet-name&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;servlet-class&amp;gt;org.glassfish.embedded.samples.webtier.SimpleServlet&amp;lt;/servlet-class&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/servlet&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;servlet-mapping&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;servlet-name&amp;gt;SimpleServlet&amp;lt;/servlet-name&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;url-pattern&amp;gt;/SimpleServlet&amp;lt;/url-pattern&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/servlet-mapping&amp;gt;&lt;br&gt;
&amp;lt;/web-app&amp;gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Add a new test to invoke the Servlet&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;In "Projects", expand "Test Packages" and open
"org.glassfish.embedded.samples.webtier.AppTest" as shown:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:316px;height:210px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-apptest-open.png"&gt;&lt;/li&gt;
    &lt;li&gt;Add the following fragment at end of the class:&lt;br&gt;
      &lt;br&gt;
      &lt;table style="text-align:left;width:100%;"
 cellpadding="2" cellspacing="2"&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td style="background-color:rgb(204, 204, 255);"&gt;&amp;nbsp;
&amp;nbsp; private final String NAME = "AppTest";&lt;br&gt;
            &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void testServlet() throws
Exception {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
int port = 9999;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
GlassFish glassfish = newGlassFish(port);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
URL url = new URL("http://localhost:" + port + "/" + NAME +
"/SimpleServlet");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
BufferedReader br = new BufferedReader(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new InputStreamReader(&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
url.openConnection().getInputStream()));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
assertEquals("Wow, I'm embedded!", br.readLine());&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
glassfish.stop();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
            &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private GlassFish newGlassFish(int port)
throws Exception {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
GlassFish glassfish = new GlassFish(port);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
ScatteredWar war = new ScatteredWar(NAME,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new File("src/main/resources"),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
new File("src/main/resources/WEB-INF/web.xml"),&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Collections.singleton(new File("target/classes").toURI().toURL()));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
glassfish.deploy(war);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
System.out.println("Ready ...");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
return glassfish;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/li&gt;
    &lt;li&gt;Right-click in the editor window and select "Fix Imports"
as shown&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:511px;height:513px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-apptest-fix-imports.png"&gt;&lt;br&gt;
    &lt;/li&gt;
    &lt;li&gt;Take all the defaults as shown&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:577px;height:371px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-apptest-fix-all-imports.png"&gt;&lt;br&gt;
      &lt;br&gt;
and click on "OK".&lt;/li&gt;
    &lt;li&gt;The complete project structure looks like:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:346px;height:329px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-project-structure.png"&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;li&gt;Run the Test (mvn test)&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;In Projects window, right-click the project and select
"Test" as shown:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:341px;height:371px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-run-test.png"&gt;&lt;/li&gt;
    &lt;li&gt;The Output window shows the result as:&lt;br&gt;
      &lt;br&gt;
      &lt;img style="width:661px;height:632px;" alt=""
 src="http://blogs.sun.com/arungupta/resource/images/embed-gf-run-test-result.png"&gt;&lt;br&gt;
      &lt;br&gt;
Notice how GlassFish v3 started in 598 milliseconds (around 0.5 sec)
and all the tests passed.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/ol&gt;
This is a work in progress and we would like to hear your feedback at &lt;a rel="nofollow"
 target="_blank" href="mailto:users@glassfish.dev.java.net"&gt;users@glassfish&lt;/a&gt;
and &lt;a rel="nofollow"
 target="_blank" href="http://forums.java.net/jive/forum.jspa?forumID=56&amp;amp;start=0"&gt;GlassFish
Forum&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
How are you using GlassFish embeddability ?&lt;br&gt;&lt;br&gt;
&lt;small&gt;Technorati: &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/glassfish"&gt;glassfish&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/v3"&gt;v3&lt;/a&gt; &lt;a rel="nofollow"
 target="_blank" href="http://technorati.com/tag/embedded"&gt;embedded&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/servlet"&gt;servlet&lt;/a&gt;
&lt;a rel="nofollow" target="_blank" href="http://technorati.com/tag/netbeans"&gt;netbeans&lt;/a&gt;&lt;/small&gt;&lt;br&gt;</description>
         <author>arungupta</author>
         <guid isPermaLink="false">https://blogs.oracle.com/arungupta/entry/embeddable_glassfish_in_action_servlet</guid>
         <pubDate>Wed, 21 May 2008 23:45:00 +0000</pubDate>
      <feedburner:origLink>https://blogs.oracle.com/arungupta/entry/embeddable_glassfish_in_action_servlet</feedburner:origLink></item>
   </channel>
</rss><!-- fe2.yql.bf1.yahoo.com compressed/chunked Sat May 26 05:15:02 UTC 2012 -->

