<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: JSF and Mobile Web Applications &#8212; Part 2: The ServletFilter approach</title>
	<atom:link href="http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/</link>
	<description>"Science is a wonderful thing if one does not have to earn one's living at it" -- Albert Einstein</description>
	<pubDate>Wed, 07 Jan 2009 12:34:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: James F</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-66173</link>
		<dc:creator>James F</dc:creator>
		<pubDate>Wed, 04 Jun 2008 20:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-66173</guid>
		<description>Have you heard about the book, Pro JSF and Ajax?  There's a chapter on 'Dynamically changing the renderkit', which sounds interesting on the face of it.  That may allow you to reduce the number of permutations of templates that you need to create for each markup language, and perhaps use multiple templates to optimize for screen-size.

http://www.springerlink.com/content/v123xm51gj7j27n3/</description>
		<content:encoded><![CDATA[<p>Have you heard about the book, Pro JSF and Ajax?  There&#8217;s a chapter on &#8216;Dynamically changing the renderkit&#8217;, which sounds interesting on the face of it.  That may allow you to reduce the number of permutations of templates that you need to create for each markup language, and perhaps use multiple templates to optimize for screen-size.</p>
<p><a href="http://www.springerlink.com/content/v123xm51gj7j27n3/" rel="nofollow">http://www.springerlink.com/content/v123xm51gj7j27n3/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Austin Huang</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-47267</link>
		<dc:creator>Austin Huang</dc:creator>
		<pubDate>Thu, 03 Jan 2008 17:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-47267</guid>
		<description>Hi,

I tried JSF 1.2 RI (with Seam 2.0.1.CR1) embeeded in Jboss 4.2.2.GA. Seems that JSF 1.2 RI is not completely javascript-free implementation. Hereunder is the code
&lt;code&gt;
    
    
      
        
          
        
        
          
        
        
          
        
      
      
    
&lt;/code&gt;

And I got 
&lt;code&gt;


//


&lt;/code&gt;

I am wondering is there any other JSF implementation for rendering  XHTML MP ?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I tried JSF 1.2 RI (with Seam 2.0.1.CR1) embeeded in Jboss 4.2.2.GA. Seems that JSF 1.2 RI is not completely javascript-free implementation. Hereunder is the code<br />
<code></p>
<p></code></p>
<p>And I got<br />
<code></p>
<p>//</p>
<p></code></p>
<p>I am wondering is there any other JSF implementation for rendering  XHTML MP ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35259</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Thu, 27 Sep 2007 18:22:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35259</guid>
		<description>I do put some config for both template, and themes into components.xml, left it out for brevity.</description>
		<content:encoded><![CDATA[<p>I do put some config for both template, and themes into components.xml, left it out for brevity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35258</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Thu, 27 Sep 2007 18:18:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35258</guid>
		<description>&lt;code&gt;
@Name("template")
public class Template 
      extends AbstractMap 
      implements Serializable {

  @In Theme contextTheme;

  @Override public String get(Object key) {
    // do whatever you need to select the right 
    // template based on the key, device, config, etc.
    //
    // I also allow an override from a request param.
    //
    // Note that this doesn't remove the need for a 
    // separate theme component (also a map). The one
    // that comes with Seam can work but is generally
    // too simplistic.
    return contextTheme.get(templateKey);
  }

  @Override
  public Set&#62; entrySet() {
    // this return doesn't matter too much
    return contextTheme.entrySet();
  }
}
&lt;/code&gt;

ContextTheme is a simple manager component with one method that selects and returns the right Theme component depending on the context. 

It's not really groundbreaking but works nicely for me.</description>
		<content:encoded><![CDATA[<p><code><br />
@Name("template")<br />
public class Template<br />
      extends AbstractMap<br />
      implements Serializable {</p>
<p>  @In Theme contextTheme;</p>
<p>  @Override public String get(Object key) {<br />
    // do whatever you need to select the right<br />
    // template based on the key, device, config, etc.<br />
    //<br />
    // I also allow an override from a request param.<br />
    //<br />
    // Note that this doesn't remove the need for a<br />
    // separate theme component (also a map). The one<br />
    // that comes with Seam can work but is generally<br />
    // too simplistic.<br />
    return contextTheme.get(templateKey);<br />
  }</p>
<p>  @Override<br />
  public Set&gt; entrySet() {<br />
    // this return doesn't matter too much<br />
    return contextTheme.entrySet();<br />
  }<br />
}<br />
</code></p>
<p>ContextTheme is a simple manager component with one method that selects and returns the right Theme component depending on the context. </p>
<p>It&#8217;s not really groundbreaking but works nicely for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Yuan</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35189</link>
		<dc:creator>Michael Yuan</dc:creator>
		<pubDate>Thu, 27 Sep 2007 05:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35189</guid>
		<description>Hi Marcus,

Thanks for sharing your thoughts! Yes, I think my approach should be able to handle different sitemaps for different screen size templates. For instance, the small screen version of the "product description page" might be broken into multiple parts with "next page" links on each page. All I need is to put the "next page" link on the template for this screen size. The other large screen pages will simply not render that link and the user will not be prompted to go to the next page, right? So, I guess it should work as long as we keep each set of templates internally consistent. They are accessed by common URLs (e.g., /app/product.seam?id=123 always gets product 123 customized for the request device), but some URL (e.g., /app/product.seam?id=123&#038;page=2) only works for certain screen sizes.

As for the manager component to replace my URL rewriting component, can you provide more details (a code snippet? :))? Do you use get() to get JSF rendered content? How do you do that exactly? Thanks!

cheers
Michael</description>
		<content:encoded><![CDATA[<p>Hi Marcus,</p>
<p>Thanks for sharing your thoughts! Yes, I think my approach should be able to handle different sitemaps for different screen size templates. For instance, the small screen version of the &#8220;product description page&#8221; might be broken into multiple parts with &#8220;next page&#8221; links on each page. All I need is to put the &#8220;next page&#8221; link on the template for this screen size. The other large screen pages will simply not render that link and the user will not be prompted to go to the next page, right? So, I guess it should work as long as we keep each set of templates internally consistent. They are accessed by common URLs (e.g., /app/product.seam?id=123 always gets product 123 customized for the request device), but some URL (e.g., /app/product.seam?id=123&#038;page=2) only works for certain screen sizes.</p>
<p>As for the manager component to replace my URL rewriting component, can you provide more details (a code snippet? :))? Do you use get() to get JSF rendered content? How do you do that exactly? Thanks!</p>
<p>cheers<br />
Michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35153</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Wed, 26 Sep 2007 21:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.michaelyuan.com/blog/2007/09/26/jsf-and-mobile-web-applications-part-2-the-servletfilter-approach/#comment-35153</guid>
		<description>This is great. I was working on this very issue in the past couple weeks (in Seam, no less) and I feel that this is very very close to the solution.

I feel though that there may be some big weaknesses to the filter + template approach. I think you even touched upon the very issues I'm concerned about in your previous post on the topic: The differently sized devices, even in a highly planned and structured web application, have different strategic goals in the planning of their site maps. So I see the site map as changing substantially when we're talking about (a) extremely small screens, (b) small and medium, and (c) PC.

So the separate template are likely a necessity for different device size types, as you have stated, but there are also separate site maps for some or all of the device sizes in many or all cases.

What do you think? Does this mesh with your approach much or at all?

BTW, alongside iPhones for the medium sized devices, I'm thinking perhaps we could put set-top boxes, perhaps in two categories: HD and regular TV, depending on how important those markets are for a given application. But I haven't explored that very far yet. Depending on how important those devices are for a given application, this may bring in color correction considerations, and alternative input device considerations, but really shouldn't be too hard overall.

Also, regarding URL rewriting for templates, I don't think it has to be all the way out there in the URL rewriter. The way I've implemented is just in simple manager components and components that implement Map with the template choice within the get(). It seems to me that the URL rewriter is really for external request translation, rather than internal. Does that make sense?</description>
		<content:encoded><![CDATA[<p>This is great. I was working on this very issue in the past couple weeks (in Seam, no less) and I feel that this is very very close to the solution.</p>
<p>I feel though that there may be some big weaknesses to the filter + template approach. I think you even touched upon the very issues I&#8217;m concerned about in your previous post on the topic: The differently sized devices, even in a highly planned and structured web application, have different strategic goals in the planning of their site maps. So I see the site map as changing substantially when we&#8217;re talking about (a) extremely small screens, (b) small and medium, and (c) PC.</p>
<p>So the separate template are likely a necessity for different device size types, as you have stated, but there are also separate site maps for some or all of the device sizes in many or all cases.</p>
<p>What do you think? Does this mesh with your approach much or at all?</p>
<p>BTW, alongside iPhones for the medium sized devices, I&#8217;m thinking perhaps we could put set-top boxes, perhaps in two categories: HD and regular TV, depending on how important those markets are for a given application. But I haven&#8217;t explored that very far yet. Depending on how important those devices are for a given application, this may bring in color correction considerations, and alternative input device considerations, but really shouldn&#8217;t be too hard overall.</p>
<p>Also, regarding URL rewriting for templates, I don&#8217;t think it has to be all the way out there in the URL rewriter. The way I&#8217;ve implemented is just in simple manager components and components that implement Map with the template choice within the get(). It seems to me that the URL rewriter is really for external request translation, rather than internal. Does that make sense?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
