struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Conrad" <drcon...@gmail.com>
Subject Re: [S2]XML output problem
Date Sat, 05 May 2007 19:16:18 GMT
If you don't want line feeds in the output, why do you include them in the JSP?

Okay, sorry for the snarky response. :) The first time I saw this, it
threw me off as well, although it wasn't with generating XML. Now I
always use a different style in the declarations in my JSP. Here's the
corrected version:

<%@ taglib prefix="s" uri="/struts-tags"
%><%@ page contentType="text/xml; charset=UTF-8"
%><s:property value="userMoviesFeed" escape="false"/>

At first, it looks a little weird. <%@ ... %> is the natural way to do
it. But after a while, you get used to seeing it this way.

<%@ ...
%><%@ ...
%><%@ ...
%><%@ ...
%><%@ ...
%><s:html ...

I now do this even for my pages that generate HTML, and consider it to
be the "right" way to format the declarations. No more HTML pages that
start with a dozen blank lines!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message