Solved

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

Posted on 2004-08-12
8
691 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

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…
Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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