SItemesh3 and SpringMobile

50 views
Skip to first unread message

Martin Röbert

unread,
Nov 14, 2011, 2:10:07 PM11/14/11
to SiteMesh 3 Users
Hi there,

I would like to Sitmesh together with the device resolution of Spring
Mobile. An Interceptor (DeviceResolverHandlerInterceptor) is
responsible for the device recognition and Sitemesh should do the
beautification ;)

My problem: If I want to obtain the current device from DeviceUtil in
a Subclass of ConfigurableSitemeshFilter it needs a HttpServletRequest
object. If I overwrite the doFilter method I get a ServletRequest
object.

Has anybody ever done similar stuff? I cannot believe that this is a
unique requirement ;)

Cheers and thanks in advance,
Martin

Joe Walnes

unread,
Nov 14, 2011, 2:29:36 PM11/14/11
to sitemes...@googlegroups.com
It's generally safe to cast ServletRequest to HttpServletRequest. 

Background: When the Servlet API was created it was originally HTTP agnostic, with the intention of allowing extensions to all sorts of servers (e.g. mail, FTP, etc). In reality this never happened but there are still crufty parts of the API where you have to cast (i.e. the Filter API).
Reply all
Reply to author
Forward
0 new messages