[opencms-dev] page ugliness

Sami Nygard sami.nygard at wombat.fr
Fri May 25 12:13:03 CEST 2007


In case of Tomcat you could also look into the following parameter
(web.xml):

       <init-param>
               <param-name>trimSpaces</param-name>
               <param-value>true</param-value>
       </init-param>


/Sami

On May 24, 2007 04:11 PM, Isaac R. Higgins wrote:

>
>basically the idea is to not have any new-lines between any of the JSP
>scriptlet elements on the page. This may need to be done in the
>template. Here is a full sample that was important because it is XML:
>
>
><%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %><%@
>taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@
>page import="com.opencms.flex.jsp.*,com.opencms.file.*,java.util.*" %>
>
><% cmsbean.init(pageContext, request, response); %>
><%
>
>java.util.List alist = (new
>org.opencms.jsp.CmsJspNavBuilder()).getSiteNavigation(cmsbean.getCmsObject(),
>"/" ,-1);
>//java.util.List alist = (new
>org.opencms.jsp.CmsJspNavBuilder()).getSiteNavigation();
>
>%>
><%
>for (int i=0;i
> org.opencms.file.CmsResource ress = null;
>java.util.Date date1 = new java.util.Date();
>try{
>ress = org.opencms.main.OpenCms.initResource(cmsbean.getCmsObject(),
>(((org.opencms.jsp.CmsJspNavElement)alist.get(i)).getResourceName()),
>request,
>response);
>date1 = new java.util.Date(ress.getDateLastModified());
>}catch(Exception e){}
>
>int year = date1.getYear()+1900;
>int day = date1.getDate();
>int month = date1.getMonth()+1;
>%>
>
><%= ((org.opencms.jsp.CmsJspNavElement) alist.get(i)).getResourceName()
>%>
> <%= year %>-<%= month %>-<%= day %>
> daily
> 0.5
> <%}%>
>
>
>
>
>-----Original Message-----
>From: opencms-dev-bounces at opencms.org on behalf of Francis
>Sent: Thu 5/24/2007 9:48 AM
>To: The OpenCms mailing list
>Subject: Re: [opencms-dev] page ugliness
>
>I don't understand how to place your block.
>
>In my pages it seems that the use of jstl create many blank lines.
>
>Francis
>
>Isaac R. Higgins a écrit :
>>I have the same pet peeve.
>>
>>I usually do it like this:
>>
>><% /*this is jsp block #1*/ %><%
>>/*this is jsp block #2*/ %><%
>>/*this is jsp block n*/ %>
>>
>>
>>By removing the newline/whitespace between JSP blocks, it's not
>>translated to the page as anything outside the jsp code tags will be
>>parsed as plain HTML.
>>
>>-----Original Message-----
>>From: opencms-dev-bounces at opencms.org on behalf of Christoph P.
>>Kukulies
>>Sent: Thu 5/24/2007 8:58 AM
>>To: opencms-dev at opencms.org
>>Subject: [opencms-dev] page ugliness
>>
>>I always wondered where all the blank lines come from in my generated
>>page output.
>>
>>It seems that for every newline in a jsp section, be it <% %> embedded
>>code or <&tags %> that newline is transported into the output page.
>>
>>This is ugly, I think, and I'm seeking for a way to avoid that.
>>Removing
>>newlines in code section makes it hardly legible on the other hand.
>>
>>I'm hoping there is a switch (in jsp) to suppress new lines as long as
>>they belong to jsp sections.
>>
>>Comments?
>>
>>--
>>Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
>>
>>
>>_______________________________________________
>>This mail is sent to you from the opencms-dev mailing list
>>To change your list options, or to unsubscribe from the list, please
>>visit
>>http://lists.opencms.org/mailman/listinfo/opencms-dev
>>
>>
>>
>>

>>>>------------------------------------------------------------------------
>>
>>
>>_______________________________________________
>>This mail is sent to you from the opencms-dev mailing list
>>To change your list options, or to unsubscribe from the list, please
>>visit
>>http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070525/cd995ee5/attachment.htm>


More information about the opencms-dev mailing list