Type: New Feature
Affects Version/s: None
Fix Version/s: None
Wicket does a great job at locating resources based on variation, style and location. The current way of locating HTML resources is done by the following schema:
- variation is per Component
- style and locale are per Session
The feature proposed here is to add another section, separated by a single dot, to be used specifically for HTML files:
The use case that requires this is one where an user's device is identified as an Android phone and so one could set Session.get().setDevice("android");
Inside ResourceStreamLocator, the current algorithm can just add that as an array of extensions to iterate.
Consider the HomePage:
For the Android user, HomePage will render HomePage.android.html file.
A desktop user will render HomePage.html because Session.get().isStandardDevice(); will return true
To support an iPhone user, one could set Session.get().setFallbackDevice("m"); and so, will render HomePage.m.html which could be a simplier version for other phones but Android.
I've attached an example of DeviceStreamLocator