Solved

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

Posted on 2004-08-12
8
671 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
  • 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
 

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
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.…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now