[opencms-dev] page ugliness

Isaac R. Higgins isaac.higgins at isaacray.com
Thu May 24 16:11:03 CEST 2007


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:


<?xml version="1.0" encoding="UTF-8"?><%@ 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.*" %>
<jsp:useBean id="cmsbean" class="org.opencms.jsp.CmsJspBean">
  <% cmsbean.init(pageContext, request, response); %>
</jsp:useBean><%

java.util.List alist = (new org.opencms.jsp.CmsJspNavBuilder()).getSiteNavigation(cmsbean.getCmsObject(), "/" ,-1);
//java.util.List alist = (new org.opencms.jsp.CmsJspNavBuilder()).getSiteNavigation();

%>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><%
 for (int i=0;i<alist.size();++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;
%>
   <url>
      <loc><%= ((org.opencms.jsp.CmsJspNavElement) alist.get(i)).getResourceName() %></loc>
      <lastmod><%= year %>-<%= month %>-<%= day %></lastmod>
      <changefreq>daily</changefreq>
      <priority>0.5</priority>
   </url><%}%>
</urlset> 



-----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 --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4244 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070524/cfb75f78/attachment.bin>


More information about the opencms-dev mailing list