Hi,
I am wanting to implement a site such that some actions may have a
different mapping depending upon the device used (e.g. regular browser /
mobile device etc.) but what I don't want to do is have to litter my
actions with this type of logic. It could be at the result mapping level
(i.e. i
Hi Wes, thanks for the post.
I like the idea of being able to decorate screens differently depending
on device without changing much existing code and I can see a use to
this for example for pages being given a different footer to provide
device specific links or adding side menus for devices
I admit that I haven't read the whole thread, so flame me if you
covered the answer already, but...
Have you looked at Sitemesh? I would suggest look at creating
different decorators for each of the devices you want to support, then
code your undecorated JSPs so that they can be decorated based on
This could work ok, especially if there were a configuration file such
that the jsp to forward to could be specified on a per action/result
basis, which would prevent having to duplicate jsp files unnecesarily. I
would consider this, but unfortunately I am mostly using a result type
of "tiles"
Another direction would be to try implementing your own Result type:
index
Then the result would check the device type the user is accessing the
application with, and you can try searching first for a:
index_brand_model.jsp, and if not found search for:
index_brand.jsp, then
index.
Seems reasonable, however for me the problem here is that if you put
getDevice() in a base class with common functionality then for every
device type that may be returned you will have to create a copy of the
jsp and this may need maintenance in time (or assuming it is the same
jsp then maybe A
I've got the same situation and plan on handling by making the the
result location dynamic by adding a ${device} to the path.
/${device}/index.jsp
In my actions I will have a getDevice() which will return a string
(e.g. "iPhone" or "blackberry" etc.) based on the User-Agent or
x-wa
Thanks for the info Andy, the interceptor seems an appropriate thing
although it does mean there are multiple mappings in struts.xml. This
seems at least a way that allows a site to grow in terms of new views
without impacting upon the application code or exisiting views.
Thinking about it thi
Interesting, I hadn't thought of that. However a problem I see here with
this approach is that it implies that there would be different versions
or a different mapping for every view whereas in reality, if a page
looks / works fine on say iphone, htc, windows mobile but doesn't on an
old blackb
> There are couple of ways I can think of to do this, but they're ugly:
> - JSP level logic to render the page differently - dont want it, I'd
> rather individual jsp's for each supported device (or family) as this
> allows developers who are working on targeting a site to a specific
> device to c
How about using different packages/namespaces for the views?
/bb/index.jsp
/wm/index.jsp
2010/1/28 Marcus Bond :
> Hi,
>
> I am wanting to implement a site such that some actions may have a different
> mapping depending upon the device used (e.g. regular
Hi,
I am wanting to implement a site such that some actions may have a
different mapping depending upon the device used (e.g. regular browser /
mobile device etc.) but what I don't want to do is have to litter my
actions with this type of logic. It could be at the result mapping level
(i.e. i
12 matches
Mail list logo