badri nath

Ranch Hand
+ Follow
since Dec 21, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by badri nath

Use Frames, so that image would be in different iframe and page in different. This will help image rotation to be independent of page submission.
Are you allowed to use pagination?
15 years ago
JSF
Hi Deryl and ranchers, can you help me by getting something working for me
15 years ago
JSF
Thanks For Solution Deryl. I think i understood what you are trying to say. Let me explain to make myself clear.
I need to create an object which extends TreeNodeBase and add my information to that object. And in my jsp page i need to use this object to display information on JSP.
I would continue my struggle to get this working but as i am a new-bee to JSF can you even try to get this working for me. I will reply back if i can find any success.
15 years ago
JSF
Using Tomahawk is not a problem for me and i successfully tried the example which you have suggested.

Actually i was trying to implement the following requirement. I want to display information in the table in form of Tree Structure. At tree level i have more than one column and same goes with tree nodel level. The data should look some thing like this.

(+)Employer1_Name Employer1_Description
|-Employee1_Salary Employee1_Maritial_Status
|-Employee2_Salary Employee2_Maritial_Status
(+)Employer2_Name Employer2_Description
|-Employee3_Salary Employee3_Maritial_Status
|-Employee4_Salary Employee4_Maritial_Status

And the Employer/Employee related information would be stored in a backing bean.

With Tomahawks Example i saw that we were able to stored only one String at each level. But i want to display data in more than one column at each level.

Folks, can you help me in suggesting a way or with some samples in getting my requirement done.
15 years ago
JSF
Deryl, I dont know if i can attach files as attachment here in ranch. I have copied the entire jsp and the bean hereunder. Thanks for your efforts you are putting in to help me.

Page1.jsp

----------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui" xmlns:xng="com.granite.xng.webtk">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page binding="#{Page1.page1}" id="page1">
<ui:html binding="#{Page1.html1}" id="html1">
<ui:head binding="#{Page1.head1}" id="head1">
<ui:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
</ui:head>
<ui:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{Page1.form1}" id="form1">
<ui:tree binding="#{Page1.tree1}" id="tree1" style="left: 48px; top: 48px; position: absolute" text="L3">
<ui:treeNode action="#{Page1.treeNode1_action}" binding="#{Page1.treeNode1}" expanded="true" id="treeNode1" style="width: 408px" text="Tree Node 1">
<f:facet name="image">
<ui:image binding="#{Page1.image1}" icon="TREE_DOCUMENT" id="image1"/>
</f:facet>
</ui:treeNode>
<ui:treeNode binding="#{Page1.treeNode2}" expanded="true" id="treeNode2" text="Tree Node 2">
<f:facet name="image">
<ui:image binding="#{Page1.image2}" icon="TREE_DOCUMENT" id="image2"/>
</f:facet>
</ui:treeNode>
</ui:tree>
</ui:form>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

----------------------------------

Page1.java

----------------------------------

package webapplication1;

import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.rave.web.ui.component.Body;
import com.sun.rave.web.ui.component.Form;
import com.sun.rave.web.ui.component.Head;
import com.sun.rave.web.ui.component.Html;
import com.sun.rave.web.ui.component.Link;
import com.sun.rave.web.ui.component.Page;
import javax.faces.FacesException;
import com.sun.rave.web.ui.component.Tree;
import com.sun.rave.web.ui.component.TreeNode;
import com.sun.rave.web.ui.component.ImageComponent;

public class Page1 extends AbstractPageBean {

private int __placeholder;

private void _init() throws Exception {
}

private Page page1 = new Page();

public Page getPage1() {
return page1;
}

public void setPage1(Page p) {
this.page1 = p;
}

private Html html1 = new Html();

public Html getHtml1() {
return html1;
}

public void setHtml1(Html h) {
this.html1 = h;
}

private Head head1 = new Head();

public Head getHead1() {
return head1;
}

public void setHead1(Head h) {
this.head1 = h;
}

private Link link1 = new Link();

public Link getLink1() {
return link1;
}

public void setLink1(Link l) {
this.link1 = l;
}

private Body body1 = new Body();

public Body getBody1() {
return body1;
}

public void setBody1(Body b) {
this.body1 = b;
}

private Form form1 = new Form();

public Form getForm1() {
return form1;
}

public void setForm1(Form f) {
this.form1 = f;
}

private Tree tree1 = new Tree();

public Tree getTree1() {
return tree1;
}

public void setTree1(Tree t) {
this.tree1 = t;
}

private TreeNode treeNode1 = new TreeNode();

public TreeNode getTreeNode1() {
return treeNode1;
}

public void setTreeNode1(TreeNode tn) {
this.treeNode1 = tn;
}

private ImageComponent image1 = new ImageComponent();

public ImageComponent getImage1() {
return image1;
}

public void setImage1(ImageComponent ic) {
this.image1 = ic;
}

private TreeNode treeNode2 = new TreeNode();

public TreeNode getTreeNode2() {
return treeNode2;
}

public void setTreeNode2(TreeNode tn) {
this.treeNode2 = tn;
}

private ImageComponent image2 = new ImageComponent();

public ImageComponent getImage2() {
return image2;
}

public void setImage2(ImageComponent ic) {
this.image2 = ic;
}

public Page1() {
}

protected RequestBean1 getRequestBean1() {
return (RequestBean1)getBean("RequestBean1");
}

protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1)getBean("ApplicationBean1");
}

protected SessionBean1 getSessionBean1() {
return (SessionBean1)getBean("SessionBean1");
}

public void init() {
super.init();
try {
_init();
} catch (Exception e) {
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
}

public void preprocess() {
}

public void prerender() {
}

public void destroy() {
}


public String treeNode1_action() {
// TODO: Replace with your code

return null;
}
}

-----------------------------------------
15 years ago
JSF
Thanks for the response Deryl. But the error is being thrown from the code in webui.jar file. com.sun.rave.web.ui.renderer.template.xml.XMLLayoutDefinitionManager.getLayoutDefinition(XMLLayoutDefinitionManager.java:142

I think the jar file is internally looking for some other file on classpath. To use <ui:tree /> do we need to have anything extra in classpath?

In my jsp page i removed everything from the design and was just keeping <ui:tree id="myTree"/> tag in the body of jsp and even this was throwing the same exception.
15 years ago
JSF
Hi,

I am trying to work with Tree Structure using JSF UI tags. In Studio Creator i just created a JSP page and designed a Tree with two nodes under it.

This is what i have in the body of my jsp.

<ui:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{Page1.form1}" id="form1">
<ui:tree binding="#{Page1.tree1}" id="tree1" style="left: 48px; top: 48px; position: absolute" text="L3">
<ui:treeNode binding="#{Page1.treeNode1}" expanded="true" id="treeNode1" style="width: 408px" text="Tree Node 1">
<f:facet name="image">
<ui:image binding="#{Page1.image1}" icon="TREE_DOCUMENT" id="image1"/>
</f:facet>
</ui:treeNode>
<ui:treeNode binding="#{Page1.treeNode2}" expanded="true" id="treeNode2" text="Tree Node 2">
<f:facet name="image">
<ui:image binding="#{Page1.image2}" icon="TREE_DOCUMENT" id="image2"/>
</f:facet>
</ui:treeNode>
</ui:tree>
</ui:form>
</ui:body>

But when i am trying to launch the jsp page from browser i am getting the below exception.

com.sun.rave.web.ui.appbase.ApplicationException
Caused by: java.lang.NullPointerException at java.io.File.(File.java:194) at com.sun.rave.web.ui.renderer.template.xml.XMLLayoutDefinitionManager.getLayoutDefinition(XMLLayoutDefinitionManager.java:142) at com.sun.rave.web.ui.component.TemplateComponentBase.getLayoutDefinition(TemplateComponentBase.java:150) at com.sun.rave.web.ui.renderer.template.TemplateRenderer.encodeBegin(TemplateRenderer.java:73) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)

Any suggestion to solve this issue would be greatly helpful.
15 years ago
JSF
Also i see you are not providing initial_context_factory and provider_url for the server on which you are running the application
Context ic = new InitialContext();
Object o = ic.lookup("ejb/Advisor");


It should look some thing like this..
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");
Context ctx = new InitialContext(env);

PS: Give correct initial_context_factory and provider_url of the server.
Check if you have done every thing right in ejb-jar.xml and weblogic-ejb-jar.xml files.
If you are working with EJB's then you have a way with EJB's to be created while application is deployed. So can you try think some thing in that way
Use the same compiler version to compile both the class files i.e., the bean you are trying to make a call and the local client file.
Hi Vivek,

you have understood it right.. now dont confuse yourself. Refer the first post you have wrote. the container may already have created some bean instances and may use one of those instances to service the method calls. Now if it doesnt have one then its again said in your post that it would wait the container may wait until the client invokes a business method before it creates a bean instance..
Now coming to your question whether the EJBObject would be null. No it will not be null. When you actually make a call for the bean by invoking the business method from remote interface then the bean instance would be created if it cant find one in the pool. Create method of EJBHome would only return the instance of the remote object but not the actual instance of the bean.
Hi Jasper,

I am installing it at the default location specified by the Wizard. Also, i have tried installing it directly to C:\ folder. I didnt not had any semi-colon in the path i gave.
One more thing i have not specified and may be useful to you guys in debugging is, i have selected "Typical" while installing java at the place where i got two options(Radio Buttons) viz., 1) Typical and 2) Custom.
16 years ago
Hi,

I am getting the following exception while trying to install jdk-1_5_0_07-windows-i586-p.exe on Windows-XP Version 2002 Service Pack 2.

In the Install Wizard, when i click on Next button, I get a box with "Semi-Colon found in selected path" at the top left, and in the middle "A path with a semi-colon in it, is not supported for this product. Please select a directory path without a semi-colon.". It ends up installing the Development Kit when i click on OK button in dialogue box.

I have uninstalled all the java versions i had in my system and rebooted the system, then tried to install java but of no use.


Any Suggestion in this regards would be helpfull.
16 years ago