Thanks to all who replied to me in private and on the list. Looks like JRun's
parser has a problem.
When you space out expressions like this in JSP page:
<%= r.getElement(4) %> <%= r.getElement(0) %>
the JSP engine (JRun) produces the following code:
...
out.print("\r\n\r\n<td bgcolor=FF9999><font face=Arial size=-1> ");
out.print(r.getElement(4) );
out.print(r.getElement(0) );
out.print("</font></td>\r\n");
...
Which means that the space between the two expressions is omitted and the
output is this:
element4element0
This is annoying because if you want to do more than one of these expressions
like that in a row separated by space and you use then if anyone is
empty you will get a bigger space on your page:
element4 element3 element0
The solution is to do the following:
<%= r.getElement(4) +" "+ r.getElement(3) +" "+r.getElement(0) %>
I use JRun 2.3.1 build 149 with JSP 1.0
Could JRun people verify/fix this?
Thanks to all,
dave.
Nic Wise wrote:
> David Mossakowski wrote:
> >
> > Greetings,
> >
> > The following piece of code puts no spaces between elements:
> >
> > <%= r.getElement(1) %> <%= r.getElement(2) %>
> >
> > is that the way it should be? I'm forced to put to have a space
> > between these two strings.
> >
> > Any one had this problem?
>
> Depends - does it output
>
> foobar
>
> or
>
> foo bar
>
> 'cos the browser is likely to take the second one as the first one,
> something about converting 2 or more breaking spaces (or CR's/TAB's etc)
> to nothing - ie, it ignores white space in certain circumstances.
>
> look at the source to see if it is actually a JRun problem - I do
> this a lot, and I havn't had a problem with no spaces in the _source_,
> but the browser does sometimes concatenate the two words.
>
> Nic.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JSP-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
David Mossakowski [EMAIL PROTECTED]
http://www.dwdog.com/styk 212.310.7275
"I don't sit idly by, I'm planning a big surprise"
F U G A Z I
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".