WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 IE6/JSPs/Oracle OC4J Container and xloadtree problem, Ravi Kalaputapu, January 4, 2003

Subject: IE6/JSPs/Oracle OC4J Container and xloadtree problem From: Ravi Kalaputapu Date: January 4, 2003

I am having a problem creating tree using xloadtree.

I am using IE6 and am using Oracle's OC4J server. I am using JSP to  create the tree xml. The SRC of the node calls a JSP file that essentially creates the XML using EJBs. I end up getting an unknown error. I looked in to the code and found that in the function _startLoadXmlTree I am not seeing the xmlHttp.readyState == 4 condition being satisfied. What can be the problem. I am setting the contentType in the JSP that returns the XML to text/xml. It sounds more like a timing issue. Since my server is slow it takes a while to load pages..The problem is the JSP that is creating the XML is using EJBs to get content for the tree. I have tested calling a JSP that just returns an xml that is created programmatically. This works fine.

Here is the JSP  that is creating the tree on the client side.

<SCRIPT type="text/javascript" LANGUAGE="JavaScript1.2" >
  var tree = new WebFXTree("My Taxanomies","javascript:void(0);") ;
  var folder= new WebFXLoadTreeItem("test","http://<%=request.getServerName()%>:<%=request.getServerPort()%><%=request.getContextPath()%>/testCat.jsp");
          tree.add(folder);
          document.write(tree);
  
   
</SCRIPT>

 

Here is the JSP that is creating the XML.

<%@ page import=
     "java.util.*,
     javax.naming.*,
     javax.sql.*,
     java.sql.*,
     java.lang.*,
     entrieva.discovery.*,
     java.util.*,
     java.io.PrintWriter,
     javax.sql.RowSet " %>
<?xml version="1.0"  encoding="utf-8"?>
<tree>
<%
 response.setContentType("text/xml");

  try {
    //String      Taxid  = request.getParameter("1") ;
   // Integer iTaxID = new valueOf(Taxid);
   // String      Taxid  = request.getParameter("taxId") ;
  String      Taxid  = "1" ;

    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
   
    Context ctx = new InitialContext(env) ; // Get the JNDI context
    ECategoryHome  eCatHome = (ECategoryHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("ECategory"), ECategoryHome.class );
    Collection colCat = eCatHome.findTopCategoriesByTaxonomy(new Integer(Integer.parseInt(Taxid)) );
    for (Iterator it= colCat.iterator(); it.hasNext();){
        ECategory oCat = (ECategory)it.next();
        String sCatName = oCat.getName();
        int iCatID =  oCat.getCategoryid();
     
      //updated: now uses request.getRequestURL instead of a hard coded string specifying the URL location of the jsp
      out.println( "<tree text=\"" + sCatName  + "\""  + " />" ) ;
       // out.println( "<tree text=\"testx\" />" ) ;
    }
        
  }
  catch( Exception exp ) {

    out.print("<P>Error: Unable to execute >> " + exp.getMessage() );
    out.print("</P>" ) ;
   
    exp.printStackTrace( new PrintWriter(out) );
 
  }
%>
</tree>

 

Can anyone suggest a solution?

 




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX