Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Make your JSP an XHTML

By default, a JSP file won't be considered as an XHTML stream by the web browser. This will make things such as XForms not being rendered since the browser XForms plugins/addons render Xforms only for XHTML pages. To make a JSP file as XHTML, put this at the beginning of the JSP file

<?xml version="1.0" encoding="utf-8"?>
<% response.setContentType("application/xhtml+xml"); %>


Note that the XML declaration has to be in the first line for a valid XHTML. Of course, after doing this, you need to make all your tags valid XML in your JSP as well.
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed