<?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:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>samaxes</title>
	
	<link>http://www.samaxes.com</link>
	<description>Java developer, Web researcher, and an advocate for web standards and semantic technologies.</description>
	<lastBuildDate>Thu, 10 May 2012 14:53:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/samaxes" /><feedburner:info uri="samaxes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Java EE 6 Testing Part II – Introduction to Arquillian and ShrinkWrap</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/7r0_C_zt3bc/</link>
		<comments>http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/#comments</comments>
		<pubDate>Thu, 03 May 2012 13:51:55 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Arquillian]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=277</guid>
		<description><![CDATA[In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test. This post focus on Arquillian and ShrinkWrap and why they are awesome tools for integration [...] <a href="http://engine.influads.com/click/4fabd8d7353b275d54000010"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8d7353b275d54000010"/></a>]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/">Java EE 6 Testing Part I</a> I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test.</p>
<p>This post focus on <a href="http://www.jboss.org/arquillian" target="_blank">Arquillian</a> and <a href="http://www.jboss.org/shrinkwrap" target="_blank">ShrinkWrap</a> and why they are awesome tools for integration testing of enterprise Java applications.</p>
<p>The source code used for this post is available on <a href="https://github.com/samaxes/java-ee-testing" target="_blank">GitHub</a> under the folder <code>arquillian-shrinkwrap</code>.</p>
<h2>The tools</h2>
<dl>
<dt>Arquillian</dt>
<dd>
<blockquote cite="http://www.jboss.org/arquillian"><p>
    Arquillian brings test execution to the target runtime, alleviating the burden on the developer of managing the runtime from within the test or project build. To invert this control, Arquillian wraps a lifecycle around test execution that does the following:</p>
<ul>
<li>Manages the lifecycle of one or more containers</li>
<li>Bundles the test case, dependent classes and resources as ShrinkWrap archives</li>
<li>Deploys the archives to the containers</li>
<li>Enriches the test case with dependency injection and other declarative services</li>
<li>Executes the tests inside (or against) the containers</li>
<li>Returns the results to the test runner for reporting</li>
</ul>
</blockquote>
</dd>
<dt>ShrinkWrap</dt>
<dd>
<blockquote cite="http://www.jboss.org/shrinkwrap"><p>
    ShrinkWrap, a central component of Arquillian, provides a simple mechanism to assemble archives like JARs, WARs, and EARs with a friendly, fluent API.
</p></blockquote>
</dd>
</dl>
<p>One of the major benefits of using Arquillian is that you run the tests in a remote container (i.e. application server). That means you&#8217;ll be testing the <em>real deal</em>. No mocks. Not even embedded runtimes!</p>
<h2>Agenda</h2>
<p>The following topics will be covered on this post:</p>
<ul>
<li>Configure the Arquillian infrastructure in a Maven-based Java project</li>
<li>Inject EJBs and Managed Beans (CDI) directly in test instances</li>
<li>Test Java Persistence API (JPA) layer</li>
<li>Run Arquillian in client mode</li>
<li>Run and debug Arquillian tests inside your IDE</li>
</ul>
<p><span id="more-277"></span></p>
<h2>Configure Maven to run integration tests</h2>
<p>To run integration tests with Maven we need a different approach. By different approach I mean a different plugin: the <a href="http://maven.apache.org/plugins/maven-failsafe-plugin/" title="Maven Failsafe Plugin" target="_blank">Maven Failsafe Plugin</a>.</p>
<p>The Failsafe Plugin is a fork of the <a href="http://maven.apache.org/plugins/maven-surefire-plugin/" title="Maven Surefire Plugin" target="_blank">Maven Surefire Plugin</a> designed to run integration tests.</p>
<p>The Failsafe plugin goals are designed to run after the package phase, on the integration-test phase.</p>
<p>The Maven lifecycle has four phases for running integration tests:</p>
<ul>
<li><strong>pre-integration-test:</strong> on this phase we can start any required service or do any action, like starting a database, or starting a webserver, anything&#8230;</li>
<li><strong>integration-test:</strong> failsafe will run the test on this phase, so after all required services are started.</li>
<li><strong>post-integration-test:</strong> time to shutdown all services&#8230;</li>
<li><strong>verify:</strong> failsafe runs another goal that interprets the results of tests here, if any tests didn&#8217;t pass failsafe will display the results and exit the build.</li>
</ul>
<p>Configuring Failsafe in the POM:</p>
<pre class="brush: xml; title: pom.xml; notranslate">
&lt;!-- clip --&gt;
&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.12&lt;/version&gt;
    &lt;configuration&gt;
        &lt;skipTests&gt;true&lt;/skipTests&gt;
    &lt;/configuration&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.12&lt;/version&gt;
    &lt;configuration&gt;
        &lt;encoding&gt;UTF-8&lt;/encoding&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;id&gt;integration-test&lt;/id&gt;
            &lt;goals&gt;
                &lt;goal&gt;integration-test&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
        &lt;execution&gt;
            &lt;id&gt;verify&lt;/id&gt;
            &lt;goals&gt;
                &lt;goal&gt;verify&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;
&lt;!-- clip --&gt;
</pre>
<p>By default, the Surefire plugin executes <code>**/Test*.java</code>, <code>**/*Test.java</code>, and <code>**/*TestCase.java</code> test classes. The Failsafe plugin will look for <code>**/IT*.java</code>, <code>**/*IT.java</code>, and <code>**/*ITCase.java</code>. If you are using both the Surefire and Failsafe plugins, make sure that you use this naming convention to make it easier to identify which tests are being executed by which plugin.</p>
<h2>Configure Arquillian infrastructure in Maven</h2>
<p>Configure your Maven project descriptor to use Arquillian by appending the following XML fragment:</p>
<pre class="brush: xml; title: pom.xml; notranslate">
&lt;!-- clip --&gt;
&lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;jboss-public-repository-group&lt;/id&gt;
        &lt;name&gt;JBoss Public Repository Group&lt;/name&gt;
        &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public/&lt;/url&gt;
    &lt;/repository&gt;
&lt;/repositories&gt;

&lt;dependencyManagement&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.jboss.arquillian&lt;/groupId&gt;
            &lt;artifactId&gt;arquillian-bom&lt;/artifactId&gt;
            &lt;version&gt;1.0.0.CR8&lt;/version&gt;
            &lt;scope&gt;import&lt;/scope&gt;
            &lt;type&gt;pom&lt;/type&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
&lt;/dependencyManagement&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.arquillian.testng&lt;/groupId&gt;
        &lt;artifactId&gt;arquillian-testng-container&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.testng&lt;/groupId&gt;
        &lt;artifactId&gt;testng&lt;/artifactId&gt;
        &lt;version&gt;6.4&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jboss.spec&lt;/groupId&gt;
        &lt;artifactId&gt;jboss-javaee-6.0&lt;/artifactId&gt;
        &lt;version&gt;3.0.1.Final&lt;/version&gt;
        &lt;type&gt;pom&lt;/type&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;

&lt;profiles&gt;
    &lt;profile&gt;
        &lt;id&gt;jbossas-remote-7&lt;/id&gt;
        &lt;activation&gt;
            &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
        &lt;/activation&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.jboss.as&lt;/groupId&gt;
                &lt;artifactId&gt;jboss-as-arquillian-container-remote&lt;/artifactId&gt;
                &lt;version&gt;7.1.1.Final&lt;/version&gt;
                &lt;scope&gt;test&lt;/scope&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
    &lt;/profile&gt;
&lt;/profiles&gt;
&lt;!-- clip --&gt;
</pre>
<p>Arquillian has a vast list of <a href="https://docs.jboss.org/author/display/ARQ/Container+adapters" title="Arquillian container adapters" target="_blank">container adapters</a>. An Arquillian test can be executed in any container that is compatible with the programming model used in the test. However, throughout this post, only JBoss AS 7 is used.<br />
Similarly to <a href="http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/" title="EJB 3.1 Embeddable API">Java EE 6 Testing Part I</a>, I chose to use <a href="http://testng.org/">TestNG</a> testing framework, but again, <a href="http://www.junit.org/">JUnit</a> should work just as well.</p>
<h2>Create testable components</h2>
<p>Before looking at how to write integration tests with Arquillian we first need to have a component to test.<br />
A <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gipjg.html" title="What Is a Session Bean?" target="_blank">Session Bean</a> is a common component in Java EE stack and will serve as test subject. In this post, I&#8217;ll be creating a very basic backend for adding new users to a database.</p>
<pre class="brush: java; title: src/main/java/com/samaxes/arquillian/example/UserServiceBean.java; notranslate">
@Stateless
public class UserServiceBean {

    @PersistenceContext
    private EntityManager em;

    public User addUser(User user) {
        em.persist(user);
        return user;
    }

    // Annotation says that we do not need to open a transaction
    @TransactionAttribute(TransactionAttributeType.SUPPORTS)
    public User findUserById(Long id) {
        return em.find(User.class, id);
    }
}
</pre>
<p>In the code above I use <a href="http://docs.oracle.com/javaee/6/tutorial/doc/bnbpz.html" title="Java Persistence API" target="_blank">JPA</a> and so we need a persistence unit.<br />
A <a href="http://docs.oracle.com/javaee/6/tutorial/doc/bnbqw.html#bnbrj" title="Persistence Units" target="_blank">persistence unit</a> defines a set of all entity classes that are managed by <code>EntityManager</code> instances in an application. This set of entity classes represents the data contained within a single data store.<br />
Persistence units are defined by the <code>persistence.xml</code> configuration file:</p>
<pre class="brush: xml; title: src/main/resources/META-INF/persistence.xml; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence

http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd&quot;

    version=&quot;2.0&quot;&gt;
    &lt;persistence-unit name=&quot;example&quot;&gt;
        &lt;jta-data-source&gt;java:jboss/datasources/ExampleDS&lt;/jta-data-source&gt;
        &lt;properties&gt;
            &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;create-drop&quot; /&gt;
            &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot; /&gt;
        &lt;/properties&gt;
    &lt;/persistence-unit&gt;
&lt;/persistence&gt;
</pre>
<p>In this example I&#8217;m using an example data source that uses H2 database and comes already configured with JBoss AS 7.</p>
<p>Finally, we also need an entity that maps to a table in the database:</p>
<pre class="brush: java; title: src/main/java/com/samaxes/arquillian/example/User.java; notranslate">
@Entity
public class User {

    @Id
    @GeneratedValue
    private Long id;

    @NotNull
    private String name;

    // Removed constructors, getters and setters for brevity

    @Override
    public String toString() {
        return &quot;User [id=&quot; + id + &quot;, name=&quot; + name + &quot;]&quot;;
    }
}
</pre>
<h2>Test JPA with Arquillian</h2>
<p>We are now all set to write our first Arquillian test.<br />
An Arquillian test case looks just like a unit test with some extras. It must have three things:</p>
<ul>
<li>Extend Arquillian class (this is specific to TestNG, with JUnit you need a <code>@RunWith(Arquillian.class)</code> annotation on the class)</li>
<li>A public static method annotated with @Deployment that returns a ShrinkWrap archive</li>
<li>At least one method annotated with @Test</li>
</ul>
<pre class="brush: java; title: src/main/java/com/samaxes/arquillian/example/UserServiceBeanIT.java; notranslate">
public class UserServiceBeanIT extends Arquillian {

    private static final Logger LOGGER = Logger.getLogger(UserServiceBeanIT.class.getName());

    @Inject
    private UserServiceBean service;

    @Deployment
    public static JavaArchive createTestableDeployment() {
        final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, &quot;example.jar&quot;)
                .addClasses(User.class, UserServiceBean.class)
                .addAsManifestResource(&quot;META-INF/persistence.xml&quot;, &quot;persistence.xml&quot;)
                // Enable CDI
                .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create(&quot;beans.xml&quot;));

        LOGGER.info(jar.toString(Formatters.VERBOSE));

        return jar;
    }

    @Test
    public void callServiceToAddNewUserToDB() {
        final User user = new User(&quot;Ike&quot;);
        service.addUser(user);
        assertNotNull(user.getId(), &quot;User id should not be null!&quot;);
    }
}
</pre>
<p>This test is straightforward, it inserts a new user and checks that the <code>id</code> property has been filled with the generated value from the database.<br />
Since the test is enriched by Arquillian, you can inject EJBs and managed beans normally using <code>@EJB</code> or <code>@Inject</code> annotations.<br />
The method annotated with <code>@Deployment</code> uses ShrinkWrap to build a JAR archive which will be deployed to the container and to which your tests will be run against. ShrinkWrap isolates the classes and resources which are needed by the test from the remainder of the classpath, you should include every component needed for the test to run inside the deployment archive.</p>
<h2>Client mode</h2>
<p>Arquillian supports three test run modes:</p>
<ul>
<li><strong>In-container mode</strong> is to test your application internals. This gives Arquillian the ability to communicate with the test, enrich the test and run the test remotely. In this mode, the test executes in the remote container; Arquillian uses this mode by default.</li>
<li><strong>Client mode</strong> is to test how your application is used by clients. As opposed to in-container mode which repackages and overrides the test execution, the client mode does as little as possible. It does not repackage your <code>@Deployment</code> nor does it forward the test execution to a remote server. Your test case is running in your JVM as expected and you&#8217;re free to test the container from the outside, as your clients see it. The only thing Arquillian does is to control the lifecycle of your <code>@Deployment</code>.</li>
<li><strong>Mixed mode</strong> allows to mix the two run modes within the same test class.</li>
</ul>
<p>To run Arquillian in client mode lets first build a servlet to be tested:</p>
<pre class="brush: java; title: src/main/java/com/samaxes/arquillian/example/UserServlet.java; notranslate">
@WebServlet(&quot;/User&quot;)
public class UserServlet extends HttpServlet {

    private static final long serialVersionUID = -7125652220750352874L;

    @Inject
    private UserServiceBean service;

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType(&quot;text/plain&quot;);

        PrintWriter out = response.getWriter();
        out.println(service.addUser(new User(&quot;Ike&quot;)).toString());
        out.close();
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
            IOException {
        doGet(request, response);
    }
}
</pre>
<p>And now lets test it:</p>
<pre class="brush: java; title: src/main/java/com/samaxes/arquillian/example/UserServletIT.java; notranslate">
public class UserServletIT extends Arquillian {

    private static final Logger LOGGER = Logger.getLogger(UserServletIT.class.getName());

    // Not managed, should be used for external calls (e.g. HTTP)
    @Deployment(testable = false)
    public static WebArchive createNotTestableDeployment() {
        final WebArchive war = ShrinkWrap.create(WebArchive.class, &quot;example.war&quot;)
                .addClasses(User.class, UserServiceBean.class, UserServlet.class)
                .addAsResource(&quot;META-INF/persistence.xml&quot;)
                // Enable CDI
                .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create(&quot;beans.xml&quot;));

        LOGGER.info(war.toString(Formatters.VERBOSE));

        return war;
    }

    @RunAsClient // Same as @Deployment(testable = false), should only be used in mixed mode
    @Test(dataProvider = Arquillian.ARQUILLIAN_DATA_PROVIDER)
    public void callServletToAddNewUserToDB(@ArquillianResource URL baseURL) throws IOException {
        // Servlet is listening at &lt;context_path&gt;/User
        final URL url = new URL(baseURL, &quot;User&quot;);
        final User user = new User(1L, &quot;Ike&quot;);

        StringBuilder builder = new StringBuilder();
        BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
        String line;

        while ((line = reader.readLine()) != null) {
            builder.append(line);
        }
        reader.close();

        assertEquals(builder.toString(), user.toString());
    }
}
</pre>
<p>Although this test is very simple, it allows you to test multiple layers of you application with a single method call.</p>
<h2>Run tests inside Eclipse</h2>
<p>You can run an Arquillian test from inside your IDE just like a unit test.</p>
<h3>Run an Arquillian test</h3>
<p><small>(Click on the images to enlarge)</small></p>
<ol>
<li>
Install <a href="http://testng.org/" title="TestNG" target="_blank">TestNG</a> and <a href="http://www.jboss.org/tools" title="JBoss Tools" target="_blank">JBoss Tools</a> Eclipse plugins.
    </li>
<li>
Add a new JBoss AS server to Eclipse:<br />
<a href="http://samaxes.appspot.com/images/arquillian/add-jboss-server-big.png" title="Add JBoss AS server to Eclipse" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/add-jboss-server.png" alt="Add JBoss AS server to Eclipse" /></a>
    </li>
<li>
Start JBoss AS server:<br />
<a href="http://samaxes.appspot.com/images/arquillian/start-jboss-big.png" title="Start JBoss AS server" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/start-jboss.png" alt="Start JBoss AS server" /></a>
    </li>
<li>
Run the test case from Eclipse, right click on the test file on the Project Explorer and select <code>Run As > TestNG Test</code>:<br />
<a href="http://samaxes.appspot.com/images/arquillian/arquillian-testng-eclipse-test-big.png" title="Run TestNG Arquillian test" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/arquillian-testng-eclipse-test.png" alt="Run TestNG Arquillian test" /></a>
    </li>
</ol>
<p>The result should look similar to this:<br />
<a href="http://samaxes.appspot.com/images/arquillian/arquillian-testng-eclipse-result-big.png" title="TestNG Arquillian test result" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/arquillian-testng-eclipse-result.png" alt="TestNG Arquillian test result" /></a></p>
<h3>Debug an Arquillian test</h3>
<p><small>(Click on the images to enlarge)</small></p>
<p>Since we are using a remote container <code>Debug As > TestNG Test</code> does not cause breakpoints to be activated.<br />
Instead, we need to start the container in debug mode and attach the debugger. That&#8217;s because the test is run in a different JVM than the original test runner.<br />
The only change you need to make to debug your test is to start JBoss AS server in debug mode:</p>
<ol>
<li>
Start JBoss AS server debug mode:<br />
<a href="http://samaxes.appspot.com/images/arquillian/debug-jboss-big.png" title="Debug JBoss AS server" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/debug-jboss.png" alt="Debug JBoss AS server" /></a>
    </li>
<li>
Add the breakpoints you need to your code.
    </li>
<li>
And debug it by right clicking on the test file on the Project Explorer and selecting <code>Run As > TestNG Test</code>:<br />
<a href="http://samaxes.appspot.com/images/arquillian/debug-arquillian-test-big.png" title="Debug Arquillian test" target="_blank"><img src="http://samaxes.appspot.com/images/arquillian/debug-arquillian-test.png" alt="Debug Arquillian test" /></a>
    </li>
</ol>
<h2>More resources</h2>
<p>I hope to have been able to highlight some of the benefits of Arquillian.<br />
For more Arquillian awesomeness take a look at the following resources:</p>
<ul>
<li><a href="http://arquillian.org/guides/" title="Arquillian Guides" target="_blank">Arquillian Guides</a></li>
<li><a href="http://arquillian.org/community/" title="Arquillian Community" target="_blank">Arquillian Community</a></li>
<li><a href="https://github.com/arquillian" title="Arquillian Git Repository" target="_blank">Arquillian Git Repository</a></li>
</ul>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2009/09/test-jboss-microcontainer-services/" title="Unit Testing JBoss 5 Services">Unit Testing JBoss 5 Services</a></li><li><a href="http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/" title="Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API">Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API</a></li><li><a href="http://www.samaxes.com/2010/04/maven-2-cobertura-plugin-updated/" title="Maven 2 Cobertura Plugin &#8211; Updated">Maven 2 Cobertura Plugin &#8211; Updated</a></li><li><a href="http://www.samaxes.com/2009/03/jboss-pojocache-configuration/" title="JBoss PojoCache configuration">JBoss PojoCache configuration</a></li><li><a href="http://www.samaxes.com/2008/12/jboss-as-50-is-out/" title="JBoss AS 5.0 is out!">JBoss AS 5.0 is out!</a></li></ul> <a href="http://engine.influads.com/click/4fabd911e1f1dff60a000011"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd911e1f1dff60a000011"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=7r0_C_zt3bc:GSdJrFWNNLw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=7r0_C_zt3bc:GSdJrFWNNLw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=7r0_C_zt3bc:GSdJrFWNNLw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=7r0_C_zt3bc:GSdJrFWNNLw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=7r0_C_zt3bc:GSdJrFWNNLw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/7r0_C_zt3bc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/</feedburner:origLink></item>
		<item>
		<title>Java EE 6 Testing Part I – EJB 3.1 Embeddable API</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/YS7npLMbEF8/</link>
		<comments>http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 14:32:27 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[EJB]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=267</guid>
		<description><![CDATA[One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit/integration testing support. EJB 3.1 Specification introduced the EJB 3.1 Embeddable API for executing EJB components within a Java SE environment. Unlike traditional Java EE server-based execution, embeddable usage allows client code and its corresponding enterprise beans to run within [...] <a href="http://engine.influads.com/click/4fabd911e1f1df1b0b00000e"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd911e1f1df1b0b00000e"/></a>]]></description>
			<content:encoded><![CDATA[<p>One of the most common requests we hear from Enterprise JavaBeans developers is for improved unit/integration testing support.<br />
<a href="http://jcp.org/en/jsr/detail?id=318" target="_blank">EJB 3.1 Specification</a> introduced the EJB 3.1 Embeddable API for executing EJB components within a Java SE environment.</p>
<blockquote cite="http://jcp.org/aboutJava/communityprocess/mrel/jsr318/index.html"><p>
Unlike traditional Java EE server-based execution, embeddable usage allows client code and its corresponding enterprise beans to run within the same JVM and class loader. This provides better support for testing, offline processing (e.g. batch), and the use of the EJB programming model in desktop applications.<br />
[...]<br />
The embeddable EJB container provides a managed environment with support for the same basic services that exist within a Java EE runtime: injection, access to a component environment, container-managed transactions, etc. In general, enterprise bean components are unaware of the kind of managed environment in which they are running. This allows maximum reusability of enterprise components across a wide range of testing and deployment scenarios without significant rework.
</p></blockquote>
<p><span id="more-267"></span></p>
<p>Let&#8217;s look at an example.</p>
<p>Start by creating a Maven project and add the embeddable GlassFish dependency.<br />
I chose to use <a href="http://testng.org/" target="_blank">TestNG</a> testing framework, but <a href="http://www.junit.org/" target="_blank">JUnit</a> should work just as well.</p>
<pre class="brush: xml; title: pom.xml; notranslate">
&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.glassfish.extras&lt;/groupId&gt;
        &lt;artifactId&gt;glassfish-embedded-all&lt;/artifactId&gt;
        &lt;version&gt;3.1.2&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.testng&lt;/groupId&gt;
        &lt;artifactId&gt;testng&lt;/artifactId&gt;
        &lt;version&gt;6.4&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;!--
        The javaee-api is stripped of any code and is just used to
        compile your application. The scope provided in Maven means
        that it is used for compiling, but is also available when
        testing. For this reason, the javaee-api needs to be below
        the embedded Glassfish dependency. The javaee-api can actually
        be omitted when the embedded Glassfish dependency is included,
        but to keep your project Java-EE 6 rather than GlassFish,
        specification is important.
    --&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;javax&lt;/groupId&gt;
        &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
        &lt;version&gt;6.0&lt;/version&gt;
        &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;
</pre>
<p>Here&#8217;s a simple <code>Stateless</code> session bean:</p>
<pre class="brush: java; title: src/main/java/com/samaxes/embeddable/example/HelloWorld.java; notranslate">
@Stateless
public class HelloWorld {
    public String hello(String message) {
        return &quot;Hello &quot; + message;
    }
}
</pre>
<p>It exposes business methods through a <a href="http://java.sun.com/developer/technicalArticles/JavaEE/JavaEE6Overview_Part3.html#noiview" target="_blank">no-interface view</a>.<br />
There is no special API it must use to be capable of embeddable execution.</p>
<p>Here is some test code to execute the bean in an embeddable container:</p>
<pre class="brush: java; title: src/test/java/com/samaxes/embeddable/example/HelloWorldTest.java; notranslate">
public class HelloWorldTest {
    private static EJBContainer ejbContainer;

    private static Context ctx;

    @BeforeClass
    public static void setUpClass() throws Exception {
        // Instantiate an embeddable EJB container and search the
        // JVM class path for eligible EJB modules or directories
        ejbContainer = EJBContainer.createEJBContainer();

        // Get a naming context for session bean lookups
        ctx = ejbContainer.getContext();
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
        // Shutdown the embeddable container
        ejbContainer.close();
    }

    @Test
    public void hello() throws NamingException {
        // Retrieve a reference to the session bean using a portable
        // global JNDI name
        HelloWorld helloWorld = (HelloWorld)
                ctx.lookup(&quot;java:global/classes/HelloWorld&quot;);

        // Do your tests
        assertNotNull(helloWorld);
        String expected = &quot;World&quot;;
        String hello = helloWorld.hello(expected);
        assertNotNull(hello);
        assertTrue(hello.endsWith(expected));
    }
}
</pre>
<p>The source code is available on <a href="https://github.com/samaxes/java-ee-testing" target="_blank">GitHub</a> under the folder <code>ejb31-embeddable</code>.</p>
<p>For a step by step tutorial with a JPA example take a look at <a href="http://netbeans.org/kb/docs/javaee/javaee-entapp-junit.html" target="_blank">Using the Embedded EJB Container to Test Enterprise Applications</a> from NetBeans docs.</p>
<p>While this new API is a step forward, I still have an issue with this approach: you are bringing the container to the test. This requires a specialized container which is different from your production environment.</p>
<p>In <a href="http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/">Java EE 6 Testing Part II</a>, I will introduce <a href="http://www.jboss.org/arquillian" target="_blank">Arquillian</a> and <a href="http://www.jboss.org/shrinkwrap" target="_blank">ShrinkWrap</a>.<br />
Arquillian, a powerful container-oriented testing framework layered atop TestNG and JUnit, gives you the ability to create the production environment on the container of your choice and just execute tests in that environment (using the datasources, JMS destinations, and a whole lot of other configurations you expect to see in production environment). Instead of bringing your runtime to the test, Arquillian brings your test to the runtime.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/" title="Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap">Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap</a></li><li><a href="http://www.samaxes.com/2010/04/maven-2-cobertura-plugin-updated/" title="Maven 2 Cobertura Plugin &#8211; Updated">Maven 2 Cobertura Plugin &#8211; Updated</a></li><li><a href="http://www.samaxes.com/2009/09/test-jboss-microcontainer-services/" title="Unit Testing JBoss 5 Services">Unit Testing JBoss 5 Services</a></li><li><a href="http://www.samaxes.com/2008/01/stripes-and-ejb3/" title="Stripes framework and EJB3">Stripes framework and EJB3</a></li><li><a href="http://www.samaxes.com/2007/06/maven-2-cobertura-plugin/" title="Maven 2 Cobertura Plugin">Maven 2 Cobertura Plugin</a></li></ul> <a href="http://engine.influads.com/click/4fabd911e1f1dfdc0a00000d"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd911e1f1dfdc0a00000d"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=YS7npLMbEF8:kCCdhfufkUE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=YS7npLMbEF8:kCCdhfufkUE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=YS7npLMbEF8:kCCdhfufkUE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=YS7npLMbEF8:kCCdhfufkUE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=YS7npLMbEF8:kCCdhfufkUE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/YS7npLMbEF8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/</feedburner:origLink></item>
		<item>
		<title>Changing URL parameters with jQuery</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/JqdljFMNBUY/</link>
		<comments>http://www.samaxes.com/2011/09/change-url-parameters-with-jquery/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 14:32:39 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=255</guid>
		<description><![CDATA[You can find plenty of resources about this topic just by googling the web, most of which will point to jQuery plugins. But the fact is that it&#8217;s so easy to achieve this by simply using jQuery that you do not need a plugin. The code is pretty much self explanatory: You can clearly improve [...] <a href="http://engine.influads.com/click/4fabd8d8353b27815400000c"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8d8353b27815400000c"/></a>]]></description>
			<content:encoded><![CDATA[<p>You can find plenty of resources about this topic just by googling the web, most of which will point to jQuery plugins.<br />
But the fact is that it&#8217;s so easy to achieve this by simply using jQuery that you do not need a plugin.</p>
<p>The code is pretty much self explanatory:</p>
<pre class="brush: jscript; title: ; notranslate">
/*
 * queryParameters -&gt; handles the query string parameters
 * queryString -&gt; the query string without the fist '?' character
 * re -&gt; the regular expression
 * m -&gt; holds the string matching the regular expression
 */
var queryParameters = {}, queryString = location.search.substring(1),
    re = /([^&amp;=]+)=([^&amp;]*)/g, m;

// Creates a map with the query string parameters
while (m = re.exec(queryString)) {
    queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}

// Add new parameters or update existing ones
queryParameters['newParameter'] = 'new parameter';
queryParameters['existingParameter'] = 'new value';

/*
 * Replace the query portion of the URL.
 * Query.param() -&gt; create a serialized representation of an array or
 *     object, suitable for use in a URL query string or Ajax request.
 */
location.search = $.param(queryParameters);
</pre>
<p>You can clearly improve the regular expression, but the one above meet my needs.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2010/04/samaxesjs-javascript-library-updates/" title="samaxesJS JavaScript library updates">samaxesJS JavaScript library updates</a></li><li><a href="http://www.samaxes.com/2008/12/stripes-and-jquery-autocomplete/" title="Stripes framework and jQuery Autocomplete">Stripes framework and jQuery Autocomplete</a></li><li><a href="http://www.samaxes.com/2008/10/stripes-and-jquery-ajax-forms-and-http-session-validation/" title="Stripes framework and jQuery: AJAX forms and HTTP Session Validation">Stripes framework and jQuery: AJAX forms and HTTP Session Validation</a></li><li><a href="http://www.samaxes.com/2008/07/samaxesjs-javascript-controls/" title="samaxesJS JavaScript Controls">samaxesJS JavaScript Controls</a></li><li><a href="http://www.samaxes.com/2006/08/ie7-javascript-library/" title="IE7 JavaScript library">IE7 JavaScript library</a></li></ul> <a href="http://engine.influads.com/click/4fabd912e1f1df500b000010"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd912e1f1df500b000010"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=JqdljFMNBUY:pmzEmobhH6w:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=JqdljFMNBUY:pmzEmobhH6w:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=JqdljFMNBUY:pmzEmobhH6w:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=JqdljFMNBUY:pmzEmobhH6w:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=JqdljFMNBUY:pmzEmobhH6w:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/JqdljFMNBUY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2011/09/change-url-parameters-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2011/09/change-url-parameters-with-jquery/</feedburner:origLink></item>
		<item>
		<title>Improving web performance with Apache and htaccess</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/Lz8jePcLXLQ/</link>
		<comments>http://www.samaxes.com/2011/05/improving-web-performance-with-apache-and-htaccess/#comments</comments>
		<pubDate>Mon, 23 May 2011 14:44:40 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=251</guid>
		<description><![CDATA[Web performance is getting more and more attention from web developers and is one of the hottest topic in web development. Fred Wilson considered it at 10 Golden Principles of Successful Web Apps as the #1 principle for successful web apps. First and foremost, we believe that speed is more than a feature. Speed is [...] <a href="http://engine.influads.com/click/4fabd912e1f1dfe70a000073"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd912e1f1dfe70a000073"/></a>]]></description>
			<content:encoded><![CDATA[<p>Web performance is getting more and more attention from web developers and is one of the hottest topic in web development.</p>
<dl>
<dt><a href="http://www.avc.com/">Fred Wilson</a> considered it at <a href="http://thinkvitamin.com/web-apps/fred-wilsons-10-golden-principles-of-successful-web-apps/">10 Golden Principles of Successful Web Apps</a> as the #1 principle for successful web apps.</dt>
<dd>
<blockquote><p>First and foremost, we believe that speed is more than a feature. Speed is the most important feature. If your application is slow, people won’t use it.</p></blockquote>
</dd>
<dt>Faster website means more revenue and traffic</dt>
<dd>
<ul>
<li>Amazon: 100 ms of extra load time caused a 1% drop in sales (source: Greg Linden, Amazon).</li>
<li>Google: 500 ms of extra load time caused 20% fewer searches (source: Marrissa Mayer, Google).</li>
<li>Yahoo!: 400 ms of extra load time caused a 5–9% increase in the number of people who clicked &#8220;back&#8221; before the page even loaded (source: Nicole Sullivan, Yahoo!).</li>
</ul>
<p><a href="http://googleresearch.blogspot.com/2009/06/speed-matters.html">Google experiments</a> reached similar results:</p>
<blockquote><p>Our experiments demonstrate that slowing down the search results page by 100 to 400 milliseconds has a measurable impact on the number of searches per user of -0.2% to -0.6% (averaged over four or six weeks depending on the experiment). That&#8217;s 0.2% to 0.6% fewer searches for changes under half a second!</p></blockquote>
<p>And speed is now a factor contributing to Google Page Rank:</p>
<blockquote cite="http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/"><p>
Google, in their <a href="http://code.google.com/speed/">ongoing effort to make the Web faster</a>, <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">blogged</a> last month that “we’ve decided to take site speed into account in our search rankings.” This is yet another way in which improving web performance will have a positive impact on the bottom line.
</p></blockquote>
</dd>
</dl>
<p>The good news is that some of the most important speed optimizations can be easily done with simple <code><a href="http://httpd.apache.org/docs/current/howto/htaccess.html" title=".htaccess tutorial">.htaccess</a></code> rules.<br />
These rules can make any website faster by compressing content and enabling browser cache, and follow the <a href="http://developer.yahoo.com/performance/rules.html" title="Best Practices for Speeding Up Your Web Site">Best Practices for Speeding Up Your Web Site</a> from Yahoo!&#8217;s Exceptional Performance team.</p>
<p><span id="more-251"></span></p>
<h2>Compress content</h2>
<p>Compression reduces response times by reducing the size of the HTTP response.<br />
It&#8217;s worthwhile to gzip your HTML documents, scripts and stylesheets. In fact, it&#8217;s worthwhile to compress any text response including XML and JSON.<br />
Image and PDF files should not be gzipped because they are already compressed. Trying to gzip them not only wastes CPU but can potentially increase file sizes.</p>
<p>To compress your content, Apache 2 comes bundled with the <a href="http://httpd.apache.org/docs/current/mod/mod_deflate.html">mod_deflate</a> module.</p>
<blockquote cite="http://httpd.apache.org/docs/current/mod/mod_deflate.html"><p>The <code>mod_deflate</code> module provides the <code>DEFLATE</code> output filter that allows output from your server to be compressed before being sent to the client over the network.</p></blockquote>
<p>The following rule will gzip all your <code>*.css</code>, <code>*.js</code>, <code>*.html</code>, <code>*.html</code>, <code>*.xhtml</code>, and <code>*.php</code> files:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;ifModule mod_deflate.c&gt;
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
&lt;/ifModule&gt;
</pre>
<p>In previous versions of Apache, you can use <a href="http://schroepl.net/projekte/mod_gzip/">mod_gzip</a>.</p>
<h2>Enable browser cache</h2>
<p>Web page designs are getting richer and richer over time, which means more scripts, stylesheets and images in the page. A first-time visitor to your page will make several HTTP requests to download all your sites files, but by using the <code>Expires</code> and <code>Cache-Control</code> headers you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views.</p>
<p>Apache enables those headers thanks to <a href="http://httpd.apache.org/docs/current/mod/mod_expires.html">mod_expires</a> and <a href="http://httpd.apache.org/docs/current/mod/mod_headers.html">mod_headers</a> modules.</p>
<blockquote cite="http://httpd.apache.org/docs/current/mod/mod_expires.html"><p>
The <code>mod_expires</code> module controls the setting of the <code>Expires</code> HTTP header and the <code>max-age</code> directive of the <code>Cache-Control</code> HTTP header in server responses.<br />
To modify <code>Cache-Control</code> directives other than <code>max-age</code>, you can use the <code>mod_headers</code> module.
</p></blockquote>
<blockquote cite="http://httpd.apache.org/docs/current/mod/mod_headers.html"><p>
The <code>mod_headers</code> module provides directives to control and modify HTTP request and response headers. Headers can be merged, replaced or removed.
</p></blockquote>
<p>Rule for setting <code>Expires</code> headers:</p>
<pre class="brush: plain; title: ; notranslate">
# BEGIN Expire headers
&lt;ifModule mod_expires.c&gt;
  ExpiresActive On
  ExpiresDefault &quot;access plus 5 seconds&quot;
  ExpiresByType image/x-icon &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/jpeg &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/png &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/gif &quot;access plus 2592000 seconds&quot;
  ExpiresByType application/x-shockwave-flash &quot;access plus 2592000 seconds&quot;
  ExpiresByType text/css &quot;access plus 604800 seconds&quot;
  ExpiresByType text/javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType application/javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType application/x-javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType text/html &quot;access plus 600 seconds&quot;
  ExpiresByType application/xhtml+xml &quot;access plus 600 seconds&quot;
&lt;/ifModule&gt;
# END Expire headers
</pre>
<p>Rule for setting <code>Cache-Control</code> headers:</p>
<pre class="brush: plain; title: ; notranslate">
# BEGIN Cache-Control Headers
&lt;ifModule mod_headers.c&gt;
  &lt;filesMatch &quot;\.(ico|jpe?g|png|gif|swf)$&quot;&gt;
    Header set Cache-Control &quot;public&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(css)$&quot;&gt;
    Header set Cache-Control &quot;public&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(js)$&quot;&gt;
    Header set Cache-Control &quot;private&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(x?html?|php)$&quot;&gt;
    Header set Cache-Control &quot;private, must-revalidate&quot;
  &lt;/filesMatch&gt;
&lt;/ifModule&gt;
# END Cache-Control Headers
</pre>
<p><strong>Note 1:</strong> There is no need to set <code>max-age</code> directive with <code>Cache-Control</code> header since it is already set by <code>mod_expires</code> module.<br />
<strong>Note 2:</strong> <code>must-revalidate</code> means that <em>once a response becomes stale</em> it has to be revalidated; it doesn’t mean that it has to be checked every time.</p>
<h2>Disable HTTP ETag header</h2>
<p>ETags were added to provide a mechanism for validating entities that is more flexible than the last-modified date.</p>
<p>The problem with ETags is that they typically are constructed using attributes that make them unique to a specific server hosting a site.<br />
ETags won&#8217;t match when a browser gets the original component from one server and later tries to validate that component on a different server.</p>
<p>In Apache, this is done by simply adding the <code>FileETag</code> directive to your configuration file: </p>
<pre class="brush: plain; title: ; notranslate">
# BEGIN Turn ETags Off
FileETag None
# END Turn ETags Off
</pre>
<h2>Last-Modified header</h2>
<p>In my previous posts I stated that:</p>
<blockquote cite="/2008/04/htaccess-gzip-and-cache-your-site-for-faster-loading-and-bandwidth-saving/"><p>
If you remove the <code>Last-Modified</code> and <code>ETag</code> header, you will totally eliminate <code>If-Modified-Since</code> and <code>If-None-Match</code> requests and their <code>304 Not Modified</code> responses, so a file will stay cached without checking for updates until the Expires header indicates new content is available!
</p></blockquote>
<p>Well, I was wrong and this is why: we still want <code>Last-Modified</code> header for static files. If a user presses the <em>refresh</em> button, then browser will send a conditional request and server will respond a <code>304 Not Modified</code>. If you disable both <code>Last-Modified</code> and <code>ETag</code>, the browser will have to download the whole content again whenever a user presses <em>refresh</em>.</p>
<h2>Merge and minify your static files</h2>
<p>Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.<br />
Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times.</p>
<p>See <a href="http://www.samaxes.com/2009/05/combine-and-minimize-javascript-and-css-files-for-faster-loading/">Combine and minimize JavaScript and CSS files for faster loading</a> for more information on this topic.</p>
<h2>Web performance tools</h2>
<p>Always check your changes. Use either <a href="http://developer.yahoo.com/yslow/">YSlow</a> or <a href="http://code.google.com/speed/page-speed/">Page Speed</a> browser plugins.<br />
They are super easy to use and the best tools currently available for the job.</p>
<h2>Final file</h2>
<pre class="brush: plain; title: ; notranslate">
# BEGIN Compress text files
&lt;ifModule mod_deflate.c&gt;
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
&lt;/ifModule&gt;
# END Compress text files

# BEGIN Expire headers
&lt;ifModule mod_expires.c&gt;
  ExpiresActive On
  ExpiresDefault &quot;access plus 5 seconds&quot;
  ExpiresByType image/x-icon &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/jpeg &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/png &quot;access plus 2592000 seconds&quot;
  ExpiresByType image/gif &quot;access plus 2592000 seconds&quot;
  ExpiresByType application/x-shockwave-flash &quot;access plus 2592000 seconds&quot;
  ExpiresByType text/css &quot;access plus 604800 seconds&quot;
  ExpiresByType text/javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType application/javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType application/x-javascript &quot;access plus 216000 seconds&quot;
  ExpiresByType text/html &quot;access plus 600 seconds&quot;
  ExpiresByType application/xhtml+xml &quot;access plus 600 seconds&quot;
&lt;/ifModule&gt;
# END Expire headers

# BEGIN Cache-Control Headers
&lt;ifModule mod_headers.c&gt;
  &lt;filesMatch &quot;\.(ico|jpe?g|png|gif|swf)$&quot;&gt;
    Header set Cache-Control &quot;public&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(css)$&quot;&gt;
    Header set Cache-Control &quot;public&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(js)$&quot;&gt;
    Header set Cache-Control &quot;private&quot;
  &lt;/filesMatch&gt;
  &lt;filesMatch &quot;\.(x?html?|php)$&quot;&gt;
    Header set Cache-Control &quot;private, must-revalidate&quot;
  &lt;/filesMatch&gt;
&lt;/ifModule&gt;
# END Cache-Control Headers

# BEGIN Turn ETags Off
FileETag None
# END Turn ETags Off
</pre>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2009/01/more-on-compressing-and-caching-your-site-with-htaccess/" title="Speed up your site by compressing and caching your content with .htaccess">Speed up your site by compressing and caching your content with .htaccess</a></li><li><a href="http://www.samaxes.com/2008/04/htaccess-gzip-and-cache-your-site-for-faster-loading-and-bandwidth-saving/" title=".htaccess &#8211; gzip and cache your site for faster loading and bandwidth saving">.htaccess &#8211; gzip and cache your site for faster loading and bandwidth saving</a></li><li><a href="http://www.samaxes.com/2009/05/combine-and-minimize-javascript-and-css-files-for-faster-loading/" title="Combine and minimize JavaScript and CSS files for faster loading">Combine and minimize JavaScript and CSS files for faster loading</a></li><li><a href="http://www.samaxes.com/2009/03/jboss-pojocache-configuration/" title="JBoss PojoCache configuration">JBoss PojoCache configuration</a></li><li><a href="http://www.samaxes.com/2008/01/j2ee-cache-filter/" title="J2EE cache filter">J2EE cache filter</a></li></ul> <a href="http://engine.influads.com/click/4fabd913e1f1df4d0b00000d"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd913e1f1df4d0b00000d"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Lz8jePcLXLQ:MHky3KSEL84:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Lz8jePcLXLQ:MHky3KSEL84:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Lz8jePcLXLQ:MHky3KSEL84:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Lz8jePcLXLQ:MHky3KSEL84:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Lz8jePcLXLQ:MHky3KSEL84:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/Lz8jePcLXLQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2011/05/improving-web-performance-with-apache-and-htaccess/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2011/05/improving-web-performance-with-apache-and-htaccess/</feedburner:origLink></item>
		<item>
		<title>Stripes framework XSS Interceptor</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/T86MVe_2znM/</link>
		<comments>http://www.samaxes.com/2010/08/stripes-cross-site-scripting/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 14:08:54 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Stripes]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=227</guid>
		<description><![CDATA[I have created a new project at Google Code named Stripes XSS Interceptor. This project escapes all the parameters that Stripes binds during its Validation &#038; Binding phase using a wrapped request object (a convenient implementation of the HttpServletRequest interface). The code follows the XSS (Cross Site Scripting) security guidance posted at OWASP (Open Web [...] <a href="http://engine.influads.com/click/4fabd913e1f1dfe60a000010"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd913e1f1dfe60a000010"/></a>]]></description>
			<content:encoded><![CDATA[<p>I have created a new project at Google Code named <a href="http://code.google.com/p/stripes-xss/">Stripes XSS Interceptor</a>.</p>
<p>This project escapes all the parameters that Stripes binds during its Validation &#038; Binding phase using a wrapped request object (a convenient implementation of the HttpServletRequest interface).</p>
<p>The code follows the XSS (Cross Site Scripting) security guidance posted at OWASP (Open Web Application Security Project).</p>
<p>Please feel free to report any bug you find in the project <a href="http://code.google.com/p/stripes-xss/issues/list">Issue Tracking</a>.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2009/09/java-web-development-with-stripes/" title="Java Web Development with Stripes framework">Java Web Development with Stripes framework</a></li><li><a href="http://www.samaxes.com/2008/12/stripes-and-jquery-autocomplete/" title="Stripes framework and jQuery Autocomplete">Stripes framework and jQuery Autocomplete</a></li><li><a href="http://www.samaxes.com/2008/10/stripes-and-jquery-ajax-forms-and-http-session-validation/" title="Stripes framework and jQuery: AJAX forms and HTTP Session Validation">Stripes framework and jQuery: AJAX forms and HTTP Session Validation</a></li><li><a href="http://www.samaxes.com/2008/06/birt-stripes-example/" title="BIRT/Stripes framework example">BIRT/Stripes framework example</a></li><li><a href="http://www.samaxes.com/2008/01/stripes-and-ejb3/" title="Stripes framework and EJB3">Stripes framework and EJB3</a></li></ul> <a href="http://engine.influads.com/click/4fabd8d9353b278054000011"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8d9353b278054000011"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=T86MVe_2znM:pU8Y0Eoih6M:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=T86MVe_2znM:pU8Y0Eoih6M:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=T86MVe_2znM:pU8Y0Eoih6M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=T86MVe_2znM:pU8Y0Eoih6M:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=T86MVe_2znM:pU8Y0Eoih6M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/T86MVe_2znM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2010/08/stripes-cross-site-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2010/08/stripes-cross-site-scripting/</feedburner:origLink></item>
		<item>
		<title>Maven 2 Cobertura Plugin – Updated</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/RSonF1cVlww/</link>
		<comments>http://www.samaxes.com/2010/04/maven-2-cobertura-plugin-updated/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 16:10:12 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=222</guid>
		<description><![CDATA[My previous Maven 2 Cobertura Plugin article gives a workaround for the very buggy version 2.1 of the Cobertura Maven Plugin. This bug is fixed on versions 2.2 or higher, and consequently, that workaround does not work anymore. For those reading my previous article and having difficulties configuring the plugin, this is my actual configuration. [...] <a href="http://engine.influads.com/click/4fabd914e1f1df9b0f000005"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd914e1f1df9b0f000005"/></a>]]></description>
			<content:encoded><![CDATA[<p>My previous <a href="http://www.samaxes.com/2007/06/maven-2-cobertura-plugin/">Maven 2 Cobertura Plugin</a> article gives a workaround for the very buggy version 2.1 of the <a href="http://mojo.codehaus.org/cobertura-maven-plugin/">Cobertura Maven Plugin</a>.</p>
<p>This bug is fixed on versions 2.2 or higher, and consequently, that workaround does not work anymore.<br />
For those <a href="http://www.samaxes.com/2007/06/maven-2-cobertura-plugin/#comments">reading my previous article and having difficulties</a> configuring the plugin, this is my actual configuration.</p>
<p><span id="more-222"></span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.5&lt;/version&gt;
            &lt;configuration&gt;
                &lt;systemPropertyVariables&gt;
                    &lt;net.sourceforge.cobertura.datafile&gt;target/cobertura/cobertura.ser&lt;/net.sourceforge.cobertura.datafile&gt;
                &lt;/systemPropertyVariables&gt;
                &lt;!-- for JDK6 Support --&gt;
                &lt;argLine&gt;-Dsun.lang.ClassLoader.allowArraySyntax=true&lt;/argLine&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
            &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.3&lt;/version&gt;
            &lt;configuration&gt;
                &lt;check&gt;
                    &lt;haltOnFailure&gt;false&lt;/haltOnFailure&gt;
                    &lt;regexes&gt;
                        &lt;regex&gt;
                            &lt;pattern&gt;com.samaxes.business.*&lt;/pattern&gt;
                            &lt;branchRate&gt;80&lt;/branchRate&gt;
                            &lt;lineRate&gt;80&lt;/lineRate&gt;
                        &lt;/regex&gt;
                        &lt;regex&gt;
                            &lt;pattern&gt;com.samaxes.persistence.*&lt;/pattern&gt;
                            &lt;branchRate&gt;80&lt;/branchRate&gt;
                            &lt;lineRate&gt;80&lt;/lineRate&gt;
                        &lt;/regex&gt;
                    &lt;/regexes&gt;
                &lt;/check&gt;
                &lt;instrumentation&gt;
                    &lt;includes&gt;
                        &lt;include&gt;com/samaxes/business/**/*.class&lt;/include&gt;
                        &lt;include&gt;com/samaxes/persistence/**/*.class&lt;/include&gt;
                    &lt;/includes&gt;
                &lt;/instrumentation&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;
&lt;reporting&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-surefire-report-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.5&lt;/version&gt;
            &lt;reportSets&gt;
                &lt;reportSet&gt;
                    &lt;reports&gt;
                        &lt;report&gt;report-only&lt;/report&gt;
                    &lt;/reports&gt;
                &lt;/reportSet&gt;
            &lt;/reportSets&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
            &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.3&lt;/version&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/reporting&gt;
</pre>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2007/06/maven-2-cobertura-plugin/" title="Maven 2 Cobertura Plugin">Maven 2 Cobertura Plugin</a></li><li><a href="http://www.samaxes.com/2009/06/maven-minify-plugin-using-yuicompressor/" title="Maven Minify Plugin using YUI Compressor">Maven Minify Plugin using YUI Compressor</a></li><li><a href="http://www.samaxes.com/2006/07/using-maven-2-xdoclet-2-and-hibernate-3/" title="Using Maven 2, XDoclet 2, and Hibernate 3">Using Maven 2, XDoclet 2, and Hibernate 3</a></li><li><a href="http://www.samaxes.com/2012/05/javaee-testing-introduction-arquillian-shrinkwrap/" title="Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap">Java EE 6 Testing Part II &#8211; Introduction to Arquillian and ShrinkWrap</a></li><li><a href="http://www.samaxes.com/2011/12/javaee-testing-ejb31-embeddable/" title="Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API">Java EE 6 Testing Part I &#8211; EJB 3.1 Embeddable API</a></li></ul> <a href="http://engine.influads.com/click/4fabd8da353b27845400000d"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8da353b27845400000d"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=RSonF1cVlww:J64Vji8Zc6E:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=RSonF1cVlww:J64Vji8Zc6E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=RSonF1cVlww:J64Vji8Zc6E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=RSonF1cVlww:J64Vji8Zc6E:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=RSonF1cVlww:J64Vji8Zc6E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/RSonF1cVlww" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2010/04/maven-2-cobertura-plugin-updated/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2010/04/maven-2-cobertura-plugin-updated/</feedburner:origLink></item>
		<item>
		<title>samaxesJS JavaScript library updates</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/Y_b-q8VbjcI/</link>
		<comments>http://www.samaxes.com/2010/04/samaxesjs-javascript-library-updates/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 14:26:18 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=219</guid>
		<description><![CDATA[Both the TOC (Table of Contents) components from samaxesJS JavaScript library have been updated. Changes include: Reduced file size by removing duplicated code using a for loop when defining and processing indexes (1.8KB for the minified jQuery TOC plugin). Added a new option: context, allowing the TOC to list headings from only a portion of [...] <a href="http://engine.influads.com/click/4fabd914e1f1dfe20d000009"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd914e1f1dfe20d000009"/></a>]]></description>
			<content:encoded><![CDATA[<p>Both the TOC (Table of Contents) components from <a href="http://code.google.com/p/samaxesjs/">samaxesJS JavaScript library</a> have been updated.</p>
<p>Changes include:</p>
<ul>
<li>Reduced file size by removing duplicated code using a for loop when defining and processing indexes (1.8KB for the minified jQuery TOC plugin).</li>
<li>Added a new option: <code>context</code>, allowing the TOC to list headings from only a portion of the page.</li>
</ul>
<p>Please report any bug you may find in the project <a href="http://code.google.com/p/samaxesjs/issues/list">Issue Tracking</a>.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2011/09/change-url-parameters-with-jquery/" title="Changing URL parameters with jQuery">Changing URL parameters with jQuery</a></li><li><a href="http://www.samaxes.com/2008/12/stripes-and-jquery-autocomplete/" title="Stripes framework and jQuery Autocomplete">Stripes framework and jQuery Autocomplete</a></li><li><a href="http://www.samaxes.com/2008/10/stripes-and-jquery-ajax-forms-and-http-session-validation/" title="Stripes framework and jQuery: AJAX forms and HTTP Session Validation">Stripes framework and jQuery: AJAX forms and HTTP Session Validation</a></li><li><a href="http://www.samaxes.com/2008/07/samaxesjs-javascript-controls/" title="samaxesJS JavaScript Controls">samaxesJS JavaScript Controls</a></li><li><a href="http://www.samaxes.com/2006/08/ie7-javascript-library/" title="IE7 JavaScript library">IE7 JavaScript library</a></li></ul> <a href="http://engine.influads.com/click/4fabd8db353b278554000011"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8db353b278554000011"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Y_b-q8VbjcI:gHj-e_daYgk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Y_b-q8VbjcI:gHj-e_daYgk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Y_b-q8VbjcI:gHj-e_daYgk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=Y_b-q8VbjcI:gHj-e_daYgk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=Y_b-q8VbjcI:gHj-e_daYgk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/Y_b-q8VbjcI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2010/04/samaxesjs-javascript-library-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2010/04/samaxesjs-javascript-library-updates/</feedburner:origLink></item>
		<item>
		<title>Run PHP on Google App Engine</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/EaVugmPtYQ8/</link>
		<comments>http://www.samaxes.com/2009/12/php-on-google-app-engine/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 15:24:44 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[App Engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Quercus]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=209</guid>
		<description><![CDATA[By adding Java to their App Engine, Google has opened the door for a whole slew of languages that have been implemented on the JVM, now including PHP via Quercus. This weekend I decided to give it a try and deploy an old tutorial of mine &#8211; PHP Tutorials &#8211; on GAE. I must admit [...] <a href="http://engine.influads.com/click/4fabd915e1f1df690b000010"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd915e1f1df690b000010"/></a>]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://blog.caucho.com/?p=187"><p>By adding Java to their App Engine, Google has opened the door for a whole slew of languages that have been implemented on the JVM, now including PHP via Quercus.</p></blockquote>
<p>This weekend I decided to give it a try and deploy an old tutorial of mine &#8211; <a href="http://www.php-tutorials.info/">PHP Tutorials</a> &#8211; on <abbr title="Google App Engine">GAE</abbr>.</p>
<p>I must admit that I was pleasantly surprised by how effortless it was. OK, it&#8217;s a very rudimentary PHP application, the only PHP code used was to run the examples described on the code blocks and do some includes; nevertheless I didn&#8217;t feel the need to change a single line of code.</p>
<p>Also, deploying a Java application to GAE is simpler than a Python one. Not only because you have a very handy Eclipse plugin, but you will also find configuring the file <code>appengine-web.xml</code> a lot easier when compared to <code>app.yaml</code>.</p>
<p>All you need to do in order to deploy a PHP application, at least as simple as the one I&#8217;ve tried, is to follow these steps:<br />
<span id="more-209"></span></p>
<ol>
<li>Install <a href="http://code.google.com/appengine/docs/java/tools/eclipse.html">Google Plugin for Eclipse</a>.</li>
<li>Create a Web Application Project in eclipse. The complete project directory looks like this:
<pre>
Guestbook/
  src/
    <em>...Java source code...</em>
    META-INF/
      <em>...other configuration...</em>
  war/
    <em>...JSPs, images, data files...</em>
    WEB-INF/
      <em>...app configuration...</em>
      lib/
        <em>...JARs for libraries...</em>
      classes/
        <em>...compiled classes...</em>
</pre>
</li>
<li>Copy all your PHP and static files to <code>your-project/war</code>.</li>
<li>Download <a href="http://quercus.caucho.com/">Quercus binary</a> (WAR file).</li>
<li>Unzip it and copy all files inside <code>quercus.war/WEB-INF/lib</code> to <code>your-project/war/WEB-INF/lib</code>.</li>
<li>Edit your deployment descriptor file <code>web.xml</code>. Mine looks like this:
<pre class="brush: xml; title: web.xml; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
    xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
    version=&quot;2.5&quot;&gt;
    &lt;description&gt;PHP Tutorial&lt;/description&gt;

    &lt;servlet&gt;
        &lt;servlet-name&gt;Quercus Servlet&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.caucho.quercus.servlet.GoogleQuercusServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;

    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Quercus Servlet&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.php&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;

    &lt;welcome-file-list&gt;
        &lt;welcome-file&gt;index.php&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
&lt;/web-app&gt;
</pre>
</li>
<li>Edit your configuration file <code>appengine-web.xml</code>. Mine looks like this:
<pre class="brush: xml; title: appengine-web.xml; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;appengine-web-app xmlns=&quot;http://appengine.google.com/ns/1.0&quot;&gt;
	&lt;application&gt;php-tutorials&lt;/application&gt;
	&lt;version&gt;1&lt;/version&gt;

    &lt;!-- Configure java.util.logging --&gt;
    &lt;system-properties&gt;
        &lt;property name=&quot;java.util.logging.config.file&quot; value=&quot;WEB-INF/logging.properties&quot; /&gt;
    &lt;/system-properties&gt;

    &lt;static-files&gt;
        &lt;include path=&quot;/**&quot; expiration=&quot;600s&quot; /&gt;
        &lt;include path=&quot;/**.png&quot; expiration=&quot;30d&quot; /&gt;
        &lt;include path=&quot;/**.jpg&quot; expiration=&quot;30d&quot; /&gt;
        &lt;include path=&quot;/**.gif&quot; expiration=&quot;30d&quot; /&gt;
        &lt;include path=&quot;/**.ico&quot; expiration=&quot;30d&quot; /&gt;
        &lt;include path=&quot;/**.swf&quot; expiration=&quot;30d&quot; /&gt;
        &lt;include path=&quot;/**.css&quot; expiration=&quot;7d&quot; /&gt;
        &lt;include path=&quot;/**.js&quot; expiration=&quot;2d 12h&quot; /&gt;
        &lt;exclude path=&quot;/**.php&quot; /&gt;
        &lt;exclude path=&quot;/**.inc&quot; /&gt;
    &lt;/static-files&gt;
    &lt;resource-files&gt;
        &lt;include path=&quot;/**.php&quot; /&gt;
        &lt;include path=&quot;/**.inc&quot; /&gt;
    &lt;/resource-files&gt;
&lt;/appengine-web-app&gt;
</pre>
<p>The <code>application</code> element must match the application identifier of your application on Google App Engine.</li>
</ol>
<p>Et voilà, you are done!</p>
<p>Now, run your application using the <code>Run As >> Web Application</code> command.<br />
And finally, press the &#8220;Deploy App Engine Project&#8221; button to deploy to GAE.</p>
<p><ins datetime="2010-11-01T17:09:19+00:00"><strong>Update:</strong> This article has been ported to the Miscellaneous section of my PHP Tutorial. Check <a href="http://www.php-tutorials.info/phpOnAppEngine.php">Run PHP on Google App Engine</a> page for updates.</ins></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2007/07/jboss-web-and-php-install-tutorial/" title="JBoss Web and PHP Install Tutorial">JBoss Web and PHP Install Tutorial</a></li><li><a href="http://www.samaxes.com/2007/07/creating-offline-web-applications-with-dojo-offline-tutorial/" title="Creating Offline Web Applications with Dojo Offline Tutorial">Creating Offline Web Applications with Dojo Offline Tutorial</a></li><li><a href="http://www.samaxes.com/2007/05/more-on-offline-web-applications-google-gears/" title="More on offline web applications &#8211; Google Gears">More on offline web applications &#8211; Google Gears</a></li><li><a href="http://www.samaxes.com/2007/05/web-php-framework-symfony/" title="Web PHP framework &#8211; symfony">Web PHP framework &#8211; symfony</a></li><li><a href="http://www.samaxes.com/2006/12/birt-and-php-reporting/" title="BIRT and PHP Reporting">BIRT and PHP Reporting</a></li></ul> <a href="http://engine.influads.com/click/4fabd8db353b275d54000011"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8db353b275d54000011"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=EaVugmPtYQ8:xxtWeoxK5kM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=EaVugmPtYQ8:xxtWeoxK5kM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=EaVugmPtYQ8:xxtWeoxK5kM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=EaVugmPtYQ8:xxtWeoxK5kM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=EaVugmPtYQ8:xxtWeoxK5kM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/EaVugmPtYQ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2009/12/php-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2009/12/php-on-google-app-engine/</feedburner:origLink></item>
		<item>
		<title>W3C Widgets Compatibility Matrix for Packaging and Configuration</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/_Rjycu8vVY4/</link>
		<comments>http://www.samaxes.com/2009/11/w3c-widgets-compatibility-matrix/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 00:17:40 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=207</guid>
		<description><![CDATA[Daniel Silva, Marcos Caceres and myself have completed Phase 1 of Widget Packaging and Configuration compatibility testing. We have also detailed the results as part of the conformance matrix. We would like to publish the results as a working group note. Phase 2 will begin in about 3 weeks, in which we are hoping to [...] <a href="http://engine.influads.com/click/4fabd915e1f1dfcf0a00000b"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd915e1f1dfcf0a00000b"/></a>]]></description>
			<content:encoded><![CDATA[<p>Daniel Silva, <a href="http://datadriven.com.au/">Marcos Caceres</a> and myself have completed Phase 1 of <a href="http://www.w3.org/TR/widgets/">Widget Packaging and Configuration</a> compatibility testing. We have also detailed the results as part of the conformance matrix.<br />
We would like to publish the results as a working group note. Phase 2 will begin in about 3 weeks, in which we are hoping to start working with vendors to improve overall conformance.</p>
<p>We need help with Phase 2: if you know a team contact for any of the targeted products that are claiming conformance to W3C Widgets, then would appreciate your help in making them aware of the results of the testing &#8211; <a href="http://dev.w3.org/2006/waf/widgets/imp-report/">Implementation Report: Widgets Packaging and Configuration</a>.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>No Related Posts</li></ul> <a href="http://engine.influads.com/click/4fabd916e1f1df150e000006"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd916e1f1df150e000006"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=_Rjycu8vVY4:Cbw7LQxXulw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=_Rjycu8vVY4:Cbw7LQxXulw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=_Rjycu8vVY4:Cbw7LQxXulw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=_Rjycu8vVY4:Cbw7LQxXulw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=_Rjycu8vVY4:Cbw7LQxXulw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/_Rjycu8vVY4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2009/11/w3c-widgets-compatibility-matrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2009/11/w3c-widgets-compatibility-matrix/</feedburner:origLink></item>
		<item>
		<title>Java Web Development with Stripes framework</title>
		<link>http://feedproxy.google.com/~r/samaxes/~3/O4wvqo0EMbQ/</link>
		<comments>http://www.samaxes.com/2009/09/java-web-development-with-stripes/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 23:41:33 +0000</pubDate>
		<dc:creator>Samuel Santos</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Stripes]]></category>

		<guid isPermaLink="false">http://www.samaxes.com/?p=197</guid>
		<description><![CDATA[Stripes Framework presentation for the Portuguese Java User Group session on the JavaPT09 event. The used source code is also available. Related PostsStripes framework XSS InterceptorStripes framework and jQuery AutocompleteStripes framework and jQuery: AJAX forms and HTTP Session ValidationBIRT/Stripes framework exampleStripes framework and EJB3 <a href="http://engine.influads.com/click/4fabd916e1f1df2f10000004"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd916e1f1df2f10000004"/></a>]]></description>
			<content:encoded><![CDATA[<p>Stripes Framework presentation for the Portuguese Java User Group session on the JavaPT09 event.</p>
<p>The used <a href="http://samaxes.appspot.com/zip/javapt09-stripes-code-example.zip">source code</a> is also available.</p>
<p><script src="http://speakerdeck.com/embed/4f2888eefbac0e001f004ff9.js"></script></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.samaxes.com/2010/08/stripes-cross-site-scripting/" title="Stripes framework XSS Interceptor">Stripes framework XSS Interceptor</a></li><li><a href="http://www.samaxes.com/2008/12/stripes-and-jquery-autocomplete/" title="Stripes framework and jQuery Autocomplete">Stripes framework and jQuery Autocomplete</a></li><li><a href="http://www.samaxes.com/2008/10/stripes-and-jquery-ajax-forms-and-http-session-validation/" title="Stripes framework and jQuery: AJAX forms and HTTP Session Validation">Stripes framework and jQuery: AJAX forms and HTTP Session Validation</a></li><li><a href="http://www.samaxes.com/2008/06/birt-stripes-example/" title="BIRT/Stripes framework example">BIRT/Stripes framework example</a></li><li><a href="http://www.samaxes.com/2008/01/stripes-and-ejb3/" title="Stripes framework and EJB3">Stripes framework and EJB3</a></li></ul> <a href="http://engine.influads.com/click/4fabd8dc353b27be5400000e"><img hspace="8" vspace="8" align="right" src="http://engine.influads.com/image/4fabd8dc353b27be5400000e"/></a><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/samaxes?i=O4wvqo0EMbQ:y4zoil-KsS0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/samaxes?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/samaxes?i=O4wvqo0EMbQ:y4zoil-KsS0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/samaxes?i=O4wvqo0EMbQ:y4zoil-KsS0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/samaxes?i=O4wvqo0EMbQ:y4zoil-KsS0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/samaxes?a=O4wvqo0EMbQ:y4zoil-KsS0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/samaxes?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/samaxes/~4/O4wvqo0EMbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.samaxes.com/2009/09/java-web-development-with-stripes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.samaxes.com/2009/09/java-web-development-with-stripes/</feedburner:origLink></item>
	</channel>
</rss>

