Solved

Servlet Container return Null for empty string after upgrading weblogic 5.1 to 8.1

Posted on 2004-08-12
8
684 Views
Last Modified: 2013-12-10
Servlet Container return Null for empty string after upgrading weblogic 5.1 to 8.1. Think This is due to Java 1.4 NIO libaries. because weblogic 5.1 dont use NIO. or This can be a Issue with Servlet Container. I already update my weblogic.xml, and ORACLE drivers
    <jsp-descriptor>
          <jsp-param>
                 <param-name>printNulls</param-name>
                 <param-value>false</param-value>
          </jsp-param>
     </jsp-descriptor>
Please help me on this.  
0
Comment
Question by:ErandikaUmal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:illusionz70
ID: 11790672
i presume <jsp-descriptor>
is <weblogic-web-app>
0
 

Author Comment

by:ErandikaUmal
ID: 11790798
Yes  Copy of weblogic.xml

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

<weblogic-web-app>


  <jsp-descriptor>
    <jsp-param>
      <param-name>compileCommand</param-name>
      <param-value>D:\weblogic\jdk141_03\bin\javac.exe -noPrintNulls</param-value>
    </jsp-param>
  </jsp-descriptor>

<weblogic-web-app>
<jsp-param>
<param-name>printNulls</param-name>
<param-value>false</param-value>
</jsp-param>
</weblogic-web-app>



  <context-root>/</context-root>
</weblogic-web-app>


But 'null' problem was with the Sun Servlet Containiner Implementation of the javax.nio.* library. I dont know how to over come this issue. same poblum is comming for Tomcat 5 and JBoss.

 

0
 
LVL 4

Expert Comment

by:illusionz70
ID: 11791455
you are write , i noticed the difference in both while comparing weblogic6.1 with 7.1 and tomcat 4 with tomcat 5.
point 1 : your nesting seems to be wrong conceptually , test it. (i ahvent used 8.1 so i am not sure). ur startup doesnt complain coz the mark up appears to be wrong. ??

check this url out...
http://www.javapractices.com/Topic176.cjp

using c:out doesnt display null.
i know the problem is in ur servlet but this may help..
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

Author Comment

by:ErandikaUmal
ID: 11791526
Thanks for your comments but My problum still the same. Is there a way to make Servlet Containiner assume "" as empty string.

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 concep

--------------------------------------------------------------
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
 
LVL 4

Expert Comment

by:illusionz70
ID: 11791706
so it prints null on screen instead of "" , rite??
0
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 11803110
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
 
LVL 4

Expert Comment

by:illusionz70
ID: 11817762
well if that was the solution you were looking for , you shuld not have posted the foll statement

We have developed many thousands of servlets around this concep

:)

0
 

Author Comment

by:ErandikaUmal
ID: 11817876
We are running out of time so I took my last option (Changing the code). if any one can find solution please update. I think it will usefully for others.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
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…
Suggested Courses

732 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