Solved

The 'null' appears as a String in Weblogic 8.1?

Posted on 2004-08-12
2
205 Views
Last Modified: 2013-12-10
Hi.
We are having a small problem with out Servlets after we started porting all Projects to Weblogic 8.1 from 5.1... The below mentioned servlet code-segment works well in both 5.1 & 8.1 , except for 1 small diference... The 'null' appears as a String in Weblogic 8.1, and as ' ' in 5.1, We have developed many thousands of servlets around this concept. Is there any way we can display that annoying 'null' string as ' ' in Weblogic 8.1 (just like in the Weblogic 5.1 and previous versions)?... please help. IO Believe that the problem lies in the Servlet API - Since this same this is present in the Tomcat 5 and JBoss as well,

--------------------------------------------------------------
ServletOutputStream out=null;
try{

    String abc = null;
    res.setContentType("text/html");
    out = res.getOutputStream();
    out.println("<html><body><br>");
    out.println("");
    out.println(abc);
    out.println("</body></html>");
}catch(Exception er11){ }
---------------------------------------------------------------

0
Comment
Question by:ErandikaUmal
2 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 11803115
Hi,

we also have the same problem in our application(s)... I think you have only one way to do this...

After variable "abc" validated, then check for abc value...

if (abc == null) abc = "";

thats all you can do it, this is new change in Weblogic 8.1.

i hope it may help you..

R.K

0
 

Expert Comment

by:amol78
ID: 11839852
Hi R.K

shouldnt this be , as we need to compare the null string and not the null object

if (abc.equals("null" ) abc = "";

regards
Amol
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question