Hello,

First : I am a French developper, so I apologize for my poor English !

Our society decided to use STRUTS because of it’s MVC approach !

Our applications have to be accessed by differents customers devices.
Each customer device supports different languages ( html, vdxml, WML,
etc...)

What’s on ?

STRUTS having not intrisinc customer device notion, we are thinking about
two ways
for making STRUTS have a customer device notion.

========
Method 1 :
========

Upgrading ourself STRUTS to implement a device detection ( This info could
be retrieved in
the fisrt customer header request ).
This approach would mean that all the specific device code ( Views,
Forms,... ) should be selected
automaticly by forwards functions, and generally by all the STRUTS functions
expecting
a parameter like path=”example.jsp” or any page indication parameter
 input=”MyForm” in the case of an input action).

Example :
The first application page is “index.jsp”

In struts-config.xml we define this action :
    <!-- Display the "welcome" page -->
    <action    path="/welcome"
            forward="/welcome.jsp">
    </action>

There is no “welcome.jsp” but two pages named respectivly “welcome_A.jsp”
and contains html code,
and “welcome_B.jsp” which contains WML code.

A Customer Device accept html ( Netscape browser )
B Customer Device accept wml ( WAP )

The “index.jsp” which is the common page could detect customer device and
sets the Device Value to A or B.
“index.jsp” contains a link wich page=“welcome.do”

So we start !

When the customer selects the link “welcome.do”, STRUTS action called
forward could return “welcome_A.jsp”,
assuming current device is A.

We are here speaking of suffixed pages with A and B. We could  use the same
pages names but in different directories like that :
“A/welcome.jsp” for A Device ( html )
“B/welcome.jsp” for B Device.( WML )

========
Method 2 :
========
Making two applications, the fisrt for A Customer Devices and the second for
B Customer Devices, and force them to share ( if we can do so ! )
the ressources that are not Device specific.





========
Questions :
========

Am I Wrong ? ( because none of these methods should be applied or there is a
simple way )

Best way ?


Thank you all for your answers,


Manuel Vilar,


Reply via email to