[opencms-dev] Serving WML and XHTML with WALL tag library

Michael Kraus michael.kraus at mindmatics.de
Fri Jul 14 12:12:47 CEST 2006


 > I think you sadly have to edit the file mimetypes.properties which is
 > inside opencms.jar and associate your file extension with the mime type
 > you like.

Unfortunately, that's not possible: using WURFL/WALL, a single request can return either WML or XHTML, depending on the user agent. Normally, the wall:document tag automatically sets the MIME type according to the user agent, but within OpenCms, response.setContentType has no effect. That's why I tried to set the content type (again) manually, but without success.

Has anyone experience setting the response's MIME type manually within OpenCms?

Regards,
	Michael

Christian Steinert schrieb:
> Michael Kraus schrieb:
>> Dear all,
>>
>> We have problems with the MIME type of the HTTP response by OpenCms.
>> We'd like to use OpenCms to serve WML/XHTML pages using the WALL tag
>> library. Our pages all look like this:
>>
>> <%@ taglib uri="/WEB-INF/wall.tld" prefix="wall"
>> %><wall:document><wall:xmlpidtd/>
>> <wall:load_capabilities/>
>> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>> <wall:head>
>>    ...
>> </wall:head>
>> <wall:body>
>>    ...
>> <wall:block>
>> </wall:document>
>>
>> When requesting a page (with a WML user agent), the response's MIME type
>> is as follows:
>>
>> test/                   application/xml+html
>> test/test1.html         text/html
>> test/test2.wml          application/xml+html
>> test/test3.xyz          text/html
>>
>> As you see, the MIME type depends on the file extension, not on what is
>> set by wall:document. We also tried to set the MIME type manually by
>> inserting the following code either before or after wall:document:
>>
>>     CmsFlexController controller =
>> CmsFlexController.getController(request);
>>     response = controller.getTopResponse();
>>     response.setContentType("text/vnd.wap.wml");
>>     response.addHeader("Content-Disposition", "filename=index.wml");
>>
>> Unfortunately, this has absolutely no effect.
>>
>> Any help would be highly appreciated.
>>
>> Regards,
>>     Michael
>>
> 
> I think you sadly have to edit the file mimetypes.properties which is
> inside opencms.jar and associate your file extension with the mime type
> you like.
> 
> Probably it would also be good if you could file a bug report in the
> opencms bugzilla, because you said that response.setContentType does not
> work and at least IMHO it's an error if it doesn't.
> 
> 
> Regards
> Christian




More information about the opencms-dev mailing list