<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Manfred Riem&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/" />
<modified>2008-07-19T18:50:17Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/mriem/415</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, mriem</copyright>
<entry>
<title>JSF and HTML 4 Strict</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/07/jsf_and_html_4.html" />
<modified>2008-07-19T18:50:17Z</modified>
<issued>2008-07-19T18:50:12Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.10143</id>
<created>2008-07-19T18:50:12Z</created>
<summary type="text/plain">If you think JSF is a bit too hard to use because you are better used to HTML and you want a slow migration, instead of a steep learning curve? Use Manor &apos;n Rock JSF HTML components.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you think JSF is a bit too hard to use because you are better used to HTML and you want a slow migration, instead of a steep learning curve? Use Manor 'n Rock JSF HTML components.
<br>
<br>
I am currently working hard to make it possible to use almost all of the HTML 4 strict elements in a JSF way. See for a work-in-progress demo: <a href="http://www.manorrock.com/demo/jsf/html/heading.html">
http://www.manorrock.com/demo/jsf/html/heading.html</a>.
<br>
<br>
If you want to try it out for yourself, you can either download the
necessary JAR files from our <a href="http://repo.manorrock.com/">Maven 2 repository</a>, or you can use Maven 2 and specify a dependency on the library like this:

<pre>
    &lt;dependencies>
        &lt;dependency>
            &lt;groupId>com.manorrock.jsf.html&lt;/groupId>
            &lt;artifactId>com-manorrock-jsf-html&lt;/artifactId>
            &lt;version>1.3&lt;/version>
        &lt;/dependency>
    &lt;/dependencies>
    &lt;repositories>
        &lt;repository>
            &lt;id>manorrock&lt;/id>
            &lt;url>http://repo.manorrock.com/&lt;/url>
        &lt;/repository>
    &lt;/repositories>

</pre>

Note: <i>since this is a work-in-progress I will keep updating and
posting small blog entries explaining what my progress on this library
is. If you have a particular question, send me an 
<a href="mailto:mriem@manorrock.com">email</a>.
]]>

</content>
</entry>
<entry>
<title>Apache load balancer with fail-over and Glassfish v2ur2+</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/06/apache_load_bal_1.html" />
<modified>2008-06-21T16:49:40Z</modified>
<issued>2008-06-21T16:49:35Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.10003</id>
<created>2008-06-21T16:49:35Z</created>
<summary type="text/plain">If you are in need of a low-cost cluster then you can use the Apache load balancer module and a set of Glassfish nodes in a cluster to get HA and fail-over. Read about it here....</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you are in need of a low-cost cluster then you can use the Apache
load balancer module and a set of Glassfish nodes in a cluster to
get HA and fail-over. Read about it <a href="http://www.manorrock.com/documents/glassfish/loadbalancer.html">here</a>.
]]>

</content>
</entry>
<entry>
<title>Manor &apos;n Rock JSF TabbedPane components</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/05/jsf_tabbedpane.html" />
<modified>2008-05-17T20:15:01Z</modified>
<issued>2008-05-17T20:14:12Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.9827</id>
<created>2008-05-17T20:14:12Z</created>
<summary type="text/plain">After a little bit of work I now have a simple rendition of a tabbed pane control in JSF.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Web Applications</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[The current version of the tabbed pane component is a little bit crude. I will continue to develop on it while I have time. But for now the bare functionality is there. Take a test drive at <a href="http://www.manorrock.com/demo/jsf/tabbedpane/">http://www.manorrock.com/demo/jsf/tabbedpane/</a>. You can download the components at <a href="http://repo.manorrock.com/">http://repo.manorrock.com/</a>.

]]>

</content>
</entry>
<entry>
<title>JSF Captcha components</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/01/jsf_captcha_com.html" />
<modified>2008-01-27T05:58:32Z</modified>
<issued>2008-01-27T05:38:19Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.9076</id>
<created>2008-01-27T05:38:19Z</created>
<summary type="text/plain">Want a captcha that works in JSF, read this!</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you want a Captcha component that plays nicely with JSF, see <a href="http://www.manorrock.com/products/jsf/">http://www.manorrock.com/products/jsf/</a>.]]>

</content>
</entry>
<entry>
<title>Creating environment independent web applications on Glassfish</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/01/creating_enviro.html" />
<modified>2008-01-20T16:18:05Z</modified>
<issued>2008-01-20T15:56:00Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.9027</id>
<created>2008-01-20T15:56:00Z</created>
<summary type="text/plain">Do you want to create a WAR file that is identical on test and production? See this little article on how to do this on Glassfish.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[Creating a WAR file that is completely identical between test and production is an interesting problem. In most cases the development team needs different settings for test and production. How can you do this effectively on Glassfish? See <a href="http://www.manorrock.com/documents/glassfish/independent.html">http://www.manorrock.com/documents/glassfish/independent.html</a>.]]>

</content>
</entry>
<entry>
<title>Apache, SSL, mod_proxy and Glassfish</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/01/apache_ssl_mod_1.html" />
<modified>2008-01-20T15:55:40Z</modified>
<issued>2008-01-10T15:40:25Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.8967</id>
<created>2008-01-10T15:40:25Z</created>
<summary type="text/plain">If you want to use mod_proxy instead of mod_jk with Apache/SSL as a frontend to Glassfish</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[Read this short article that describes how you setup mod_proxy to forward requests from Apache/SSL to Glassfish. See <a href="http://www.manorrock.com/documents/glassfish/proxy_ssl.html">http://www.manorrock.com/documents/glassfish/proxy_ssl.html</a>.]]>

</content>
</entry>
<entry>
<title>Apache, mod_proxy and Glassfish</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/01/apache_ssl_mod.html" />
<modified>2008-01-10T15:39:04Z</modified>
<issued>2008-01-09T03:53:29Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.8953</id>
<created>2008-01-09T03:53:29Z</created>
<summary type="text/plain">If you want to use mod_proxy instead of mod_jk with Apache as a frontend to Glassfish</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[Read this short article that describes how you setup mod_proxy to forward requests from Apache to Glassfish. See <a href="http://www.manorrock.com/documents/glassfish/proxy.html">http://www.manorrock.com/documents/glassfish/proxy.html</a>.]]>

</content>
</entry>
<entry>
<title>JSF Checkbox component (eg. image)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2008/01/jsf_checkbox_co.html" />
<modified>2008-01-06T17:25:46Z</modified>
<issued>2008-01-06T17:25:40Z</issued>
<id>tag:weblogs.java.net,2008:/blog/mriem/415.8931</id>
<created>2008-01-06T17:25:40Z</created>
<summary type="text/plain">A JSF component that gives you the possibility to style your checkbox using an image.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you need or want to style the HTML checkbox to have an image you can use this JSF component to do so. See it in action at 
<a href="http://www.manorrock.com/products/jsf/index.html"> http://www.manorrock.com/products/jsf/index.html</a>.]]>

</content>
</entry>
<entry>
<title>JSF Canvas component</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/12/jsf_canvas_comp.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-12-31T05:16:36Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8901</id>
<created>2007-12-31T05:16:36Z</created>
<summary type="text/plain">A JSF component that allows you to paint images from within the JSF framework</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you ever wanted to do Java2D like painting using a JSF component then this is the component of your choice. You can call your own paint code on an image that you want to render. Have a look at it at <a href="http://www.manorrock.com/products/jsf/index.html"> http://www.manorrock.com/products/jsf/index.html</a>.]]>

</content>
</entry>
<entry>
<title>JSF Electronic Check components</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/12/jsf_electronic.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-12-24T04:05:26Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8892</id>
<created>2007-12-24T04:05:26Z</created>
<summary type="text/plain">A JSF component that to deal with Electronic checks.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you need to work with Electronic Checks then you might want to consider going to <a href="http://www.manorrock.com/products/jsf/index.html"> http://www.manorrock.com/products/jsf/index.html</a>.]]>

</content>
</entry>
<entry>
<title>JSF SSN components</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/09/jsf_ssn_compone_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-09-11T04:00:00Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8219</id>
<created>2007-09-11T04:00:00Z</created>
<summary type="text/plain">If you are working with Social Security Numbers then this is for you!</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[Another JSF component .... this one you can use if you need a Social Security Number somewhere in your code. See <a href="http://www.manorrock.com/products/jsf/index.html">http://www.manorrock.com/products/jsf/index.html</a> for more information.]]>

</content>
</entry>
<entry>
<title>JSF ISBN components</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/09/jsf_isbn_compon.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-09-08T04:00:00Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8205</id>
<created>2007-09-08T04:00:00Z</created>
<summary type="text/plain">A set of JSF components to deal with ISBNs.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[If you need to work with ISBNs then you might want to consider going to <a href="http://www.manorrock.com/products/jsf/index.html"> http://www.manorrock.com/products/jsf/index.html</a>.]]>

</content>
</entry>
<entry>
<title>JSF CreditCard component</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/09/jsf_creditcard.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-09-04T04:00:00Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8155</id>
<created>2007-09-04T04:00:00Z</created>
<summary type="text/plain">Something that I thought was missing when using JSF is a creditcard component. This entry shows you the results of my labor to create one.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[Working in JSF is always nice, but a lot of people complain there are not enough components. This entry describes you a creditcard component that I am developing. You can freely use it anywhere you want, visit <a href="http://www.manorrock.com/products/jsf/index.html">http://www.manorrock.com/products/jsf/index.html</a> for more details. If you have any questions feel free to comment or to send me an email.

<br>
<br>

<pre>
&lt;%@page contentType="text/html" pageEncoding="UTF-8"%>

&lt;%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
&lt;%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
&lt;%@taglib prefix="creditcard" uri="http://www.manorrock.com/tld/jsf/creditcard"%>

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

&lt;html>
    &lt;head>
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        &lt;title>&lt;/title>
    &lt;/head>
    &lt;body>
        &lt;f:view>
            &lt;h:messages/>
            &lt;h:form>
               &lt;creditcard:creditcard value="#{creditcardDemo.creditCard}"/>
                &lt;br/>
                &lt;h:commandButton action="#{creditcardDemo.doSubmit1}" value="Submit"/>
            &lt;/h:form>
        &lt;/f:view>    
    &lt;/body>
&lt;/html>
</pre>

And this renders like this.

<br>
<br>

<img alt="jsf-creditcard.JPG" src="http://weblogs.java.net/blog/mriem/images/jsf-creditcard.JPG" width="411" height="410" />

]]>

</content>
</entry>
<entry>
<title>Temperature SPOT - Part 7</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/08/temperature_spo_6.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-09-01T04:00:00Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8154</id>
<created>2007-09-01T04:00:00Z</created>
<summary type="text/plain">This is the last entry about the Temperature SPOT and it concludes this series. Some of the configuration that needs to be done to hookup the JSF component into your JSF application is mentioned here.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Embedded Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[In order for the JSF component to work it needs to register itself to the JSF runtime. The configuration to do so is described below.
<br>
<br>

<pre>
&lt;?xml version="1.0" encoding="UTF-8"?>

&lt;!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    
&lt;faces-config>
    &lt;component>
        &lt;component-type>com.manorrock.jsf.sunspot.temperature.TemperatureComponent&lt;/component-type>
  	&lt;component-class>com.manorrock.jsf.sunspot.temperature.TemperatureComponent&lt;/component-class>
    &lt;/component>
    &lt;render-kit>
        &lt;renderer>
            &lt;description>Renderer for the temperature component.&lt;/description>
            &lt;component-family>com.manorrock.jsf.sunspot.temperature.TemperatureFamily&lt;/component-family>
            &lt;renderer-type>com.manorrock.jsf.sunspot.temperature.TemperatureRenderer&lt;/renderer-type>
            &lt;renderer-class>com.manorrock.jsf.sunspot.temperature.TemperatureRenderer&lt;/renderer-class>
        &lt;/renderer>
    &lt;/render-kit>
&lt;/faces-config>
</pre>

And beyond that you will need to define the taglibrary to use the tag
as well. The code below shows you how this is done for this taglibrary.

<br>
<br>

<pre>
&lt;?xml version="1.0" encoding="UTF-8"?>

&lt;!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" 
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    
&lt;taglib>
    &lt;tlib-version>1.0&lt;/tlib-version>
    &lt;jsp-version>1.2&lt;/jsp-version>
    &lt;short-name>temperature&lt;/short-name>
    &lt;uri>http://www.manorrock.com/tld/jsf/sunspot/temperature&lt;/uri>
    &lt;tag>
        &lt;name>temperature&lt;/name>
        &lt;tag-class>com.manorrock.jsf.sunspot.temperature.TemperatureTag&lt;/tag-class>
        &lt;attribute>
            &lt;name>sunspotId&lt;/name>
            &lt;required>true&lt;/required>
        &lt;/attribute>
    &lt;/tag>
&lt;/taglib>
</pre>

This concludes the series about the JSF temperature SPOT. If you have any questions feel free to drop me an email or add comments to this blog.]]>

</content>
</entry>
<entry>
<title>Temperature SPOT - Part 6</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/mriem/archive/2007/08/temperature_spo.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-08-30T04:00:00Z</issued>
<id>tag:weblogs.java.net,2007:/blog/mriem/415.8153</id>
<created>2007-08-30T04:00:00Z</created>
<summary type="text/plain">The entry describes the TemperatureRenderer. The rendering component of the JSF Temperature component.</summary>
<author>
<name>mriem</name>

<email>mriem@manorrock.org</email>
</author>
<dc:subject>Community: Embedded Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/mriem/">
<![CDATA[The JSF component needs to be able to render, so you have to either deliver the renderer inline with the component or write a separate renderer. The code below describes the separate renderer.

<br>
<br>

<pre>
package com.manorrock.jsf.sunspot.temperature;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.text.MessageFormat;
import java.util.ResourceBundle;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.Renderer;

/**
 * The JSF SunSPOT temperature renderer.
 *
 * @author Manfred Riem (mriem@manorrock.org)
 */
public class TemperatureRenderer extends Renderer {
    /**
     * Stores the bundle we use to get for rendering.
     */
    private ResourceBundle bundle = ResourceBundle.getBundle("com.manorrock.jsf.sunspot.temperature.Bundle");
    
    /**
     * Encode end.
     */
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        String value = null;
        
        TemperatureComponent temperatureComponent = (TemperatureComponent) component;
        String sunspotId = "";
        
        if (temperatureComponent.getAttributes().get("sunspotId") != null) {
            sunspotId = (String) temperatureComponent.getAttributes().get("sunspotId");
        }
        else if (temperatureComponent.getValueBinding("sunspotId") != null) {
            sunspotId = (String) temperatureComponent.getValueBinding("sunspotId").getValue(context);
        }
        else {
            value = "Set sunspotId please";
        }

        if (value == null) {
            synchronized(context) {
                try {
                    InetAddress address = InetAddress.getByName("localhost");
                    int port = 8888;
                    SocketAddress sockaddress = new InetSocketAddress(address, port);
                    Socket socket = new Socket();
                    int timeout = 2000;
                    socket.connect(sockaddress, timeout);

                    PrintStream printer = new PrintStream(socket.getOutputStream());
                    printer.println(sunspotId);
                    printer.flush();

                    DataInputStream dataIn = new DataInputStream(socket.getInputStream());
                    value = dataIn.readLine();

                } catch (UnknownHostException e) {
                    e.printStackTrace();
                    value = e.getMessage();
                } catch (SocketTimeoutException e) {
                    e.printStackTrace();
                    value = e.getMessage();
                } catch (IOException e) {
                    e.printStackTrace();
                    value = e.getMessage();
                }
            }
        }
        
        String html = MessageFormat.format(
            bundle.getString("temperature.text.renderer"),
            new Object[] { component.getClientId(context), value });
        
        writer.write(html);
    }
}
</pre>

The last entry will be about some remaining bits and pieces.]]>

</content>
</entry>

</feed>