Hi guys,

I'm just a Struts 2 (heavy) user, but I think I can contribute with that.
Sometime ago I wrote a Struts Interceptor and a Sitemesh Decorator Mapper
that can apply a different (sometimes empty) decorator when you have an ajax
request:

    <mapper
class="com.fabianofranz.toolkit.sitemesh.decorator.HttpHeaderDecoratorMapper">
      
      
      
    </mapper>

I use it to graceful degradation - on links, the website loads pages using
ajax and in that case sitemesh applies an "empty" decorator, but if the user
disable javascript, it stay working as normal links, with the same actions,
and sitemesh applies the full page design decorator. You can see it working
(click the paging links): http://literar.org/users

If you want, I can share this code - it's quite simple.

Best regards,

Fabiano Franz
http://fabianofranz.com



Jeromy Evans - Blue Sky Minds wrote:
> 
> Blake Byrnes wrote:
>> I dealt with the ajax result discrepency (ie, if you make an ajax
>> request,
>> you generally want a different result, but probably want to share the
>> same
>> action) by writing a few things:
>> 1) A sitemesh filter that ignores requests with the content header
>> X-Requested-With=XMLHttpRequest
>>   
> Nice idea. I'd been differentiating by extension (xhtml for ajax) which 
> has been getting out-of-hand.
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--Let%27s-get-out-Struts-2.1.1-tp15519065p15633394.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to