You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Manuel Vilar <mv...@neocom.fr> on 2002/04/26 14:48:30 UTC

Multi Device Web Application

Hello  !

I am learning to use STRUTS and TILES to make a multi-device ( for example
"text/html" and "text/another-ml" ) web application.

I have been dealing with tiles channels and struts action servlet ( and
tiles extension one ) to set the good channel key in a session attribute
( depending of the request header "user-agent" info ).
Then, depending of the session channel key, (struts and tiles ) action
processContent() will set the good contentType.

So I have two componentDefinitions, each one corresponding to each client
device tiles definitions.
It's a good example of tiles channels possibilities ( thanks to Cedric
Dumoulin ) !

When the received request is mapped to my ActionComponentServlet ( mapping
"*.do" to ActionComponentServlet ) which extends Struts Action servlet,
I succeed to forces the content type, and everything seems ok for actions
responses.

But the leak, is when the request concern just any "page.jsp" wich isn't
mapped, of course,  to my ActionCOmponetServlet.
If the page does not contain any contentType directive, because we use a
tiles tag to insert a componentDefinition,
only included jsp pages ( using appropriated device-channel ) have to
contain the good device contentType directive.

It doesn't works at all !

The contentType of include pages is just ignored, and the missing main page
contentType is just
setted to default contentType : "text/html" by the JSPServlet ( I think ) !
Aaaaargh


The best way, I think, would be to override the default content type setted
by the JSPServlet or any other
Servlets ( php, cgi, etc.. )

Have you some idea of how could I achieve that ?




Thanks in advance to all the reader,

Manuel VILAR






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>