wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2 Web Application Design - Supporting Traditional and Mobile Device Displays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 Web Application Design - Supporting Traditional and Mobile Device Displays" Watch "Struts 2 Web Application Design - Supporting Traditional and Mobile Device Displays" New topic
Author

Struts 2 Web Application Design - Supporting Traditional and Mobile Device Displays

James Gadbury
Greenhorn

Joined: Mar 20, 2009
Posts: 24
Hi all,

I have been given the following brief:

"Consider the design of a web application using Struts2 and Sitemesh (and possibly Spring) for traditional displays and mobile displays."

Having had a look at how some of the major sites may be doing it, I also thought it would be a good idea to ask here to see how others may be satisying such criteria.

We already have an existing web app project designed initially for traditional displays but it now also provides one mobile page. We have "/" and "mobile" packages in the struts.xml for traditional and mobile, respectively. Both packages have near-duplicated action mappings. The same action is used for both traditional and mobile devices but the namespace is different ("/m") and the result name paths to the jsp pages differ slightly (i.e. WEB-INF/jsp/test.jsp -and- WEB-INF/jsp/mobile/test.jsp). We also use Sitemesh and have two decorators for the traditional and mobile display.

I have considered separate projects; one for a traditional displays and one for mobile device but the maintenance overhead and duplicated code sounds like a headache from the start.
I have considered having single jsp pages that would handle traditional and mobile devices in the same file but that could get convoluted and result in large, messy files.

I don't want to get too set on the design or implementation just yet. I'd be very interested to hear from more experienced users how they are doing it. Is anyone able to offer their experience / advice regarding the design and structure of a single web application that can support different display technologies?

Thanks for reading. Kind regards,

James
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Personally, I'd go for something handled purely with CSS, with the appropriate CSS pulled in via configuration, user agent, etc.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2 Web Application Design - Supporting Traditional and Mobile Device Displays
 
Similar Threads
JSP Page Translation + Tomcat
Not calling .action extension
storing multiple attributes for one entity
How to test JSP from Iphone/Blackberry
Design decision: