Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000899 [Resin] minor always 01-26-06 14:44 04-03-06 18:38
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.19 Product Version 3.0.17
  Product Build
Summary 0000899: Setting to control formatting of nulls in JSP pages
Description WebLogic has a config setting to make "<%= foo %>" do nothing if foo is null (rather than outputting the string "null"). We have a bunch of legacy JSPs that depend on this behavior. For now I've just hacked AbstractBodyContent to get rid of the code that outputs "null", but it would be nice if this were controlled by a configuration setting.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0000790)
koreth
01-26-06 14:51

Here's the patch for my change -- I am *not* suggesting this be incorporated into the main release, but this may save someone else some time if they look at this bug report wondering how to do the same thing.

--- modules/resin/src/com/caucho/jsp/AbstractBodyContent.java- 2006-01-26 14:17:17.959091586 -0800
+++ modules/resin/src/com/caucho/jsp/AbstractBodyContent.java 2006-01-26 14:17:49.934781032 -0800
@@ -49,7 +49,6 @@
 abstract class AbstractBodyContent extends AbstractJspWriter {
   private static final char []_trueChars = "true".toCharArray();
   private static final char []_falseChars = "false".toCharArray();
- private static final char []_nullChars = "null".toCharArray();

   private final char []_tempCharBuffer = new char[256];

@@ -215,9 +214,7 @@
    */
   final public void print(String s) throws IOException
   {
- if (s == null)
- write(_nullChars, 0, _nullChars.length);
- else
+ if (s != null)
       write(s, 0, s.length());
   }

@@ -226,9 +223,7 @@
    */
   final public void print(Object v) throws IOException
   {
- if (v == null)
- write(_nullChars, 0, _nullChars.length);
- else {
+ if (v != null) {
       String s = v.toString();

       write(s, 0, s.length());
@@ -329,9 +324,7 @@
    */
   final public void println(String s) throws IOException
   {
- if (s == null)
- write(_nullChars, 0, _nullChars.length);
- else
+ if (s != null)
       write(s, 0, s.length());

     println();
@@ -342,9 +335,7 @@
    */
   final public void println(Object v) throws IOException
   {
- if (v == null)
- write(_nullChars, 0, _nullChars.length);
- else {
+ if (v != null) {
       String s = String.valueOf(v);

       write(s, 0, s.length());
 
(0001005)
ferg
04-03-06 18:38

jsp/15g2
 

- Issue History
Date Modified Username Field Change
01-26-06 14:44 koreth New Issue
01-26-06 14:51 koreth Note Added: 0000790
04-03-06 18:38 ferg Note Added: 0001005
04-03-06 18:38 ferg Assigned To  => ferg
04-03-06 18:38 ferg Status new => closed
04-03-06 18:38 ferg Resolution open => fixed
04-03-06 18:38 ferg Fixed in Version  => 3.0.19


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker