Using Java constant in JSF

Hello!
I�m new in JSF and I want to use a constant into a jsf tag but I don�t know how to do it. I know in JSTL but not in FSF.
This is what I want:
     <h:outputText id="test"     value="<%Constantes.DOCUMENT%>"/>     I have tried so many things to use my constant in the value element but I don�t know the way                    
Thanks.

first off Scriplets are bad practice in JSF and should be avoided.
I use this workaround for constants in jsf. Create a my constant as properties on a FacesConstants class, which is defined as a Managed Bean with scope of none and having getters for each property.
public class FacesConstants implements MyConstants{
public String document = DOCUMENT;
public String getDocument(){
return document;
<managed-bean>
     <description>used to get faces constants for refereing in EL Expresssions</description>
          <managed-bean-name>constants</managed-bean-name>
          <managed-bean-class>com.myproj.faces.util.FacesConstants</managed-bean-class>
          <managed-bean-scope>none</managed-bean-scope>
</managed-bean>
so in the jsf code just say #{constants.document}
Not sure if this is best practice? in fact I'd prefer a more elegant solution
Edited by: scottyb on Apr 8, 2008 5:10 AM
Edited by: scottyb on Apr 8, 2008 5:12 AM

Similar Messages

  • How to use java script in jsf?

    my requirement is
    i have to pass the id of the component to the java script function .that component is inside data table.
    how to solve this problem?

    following code is the generated html code.
    see it is generating duplicate ids : check it
    this is the id repeating 3 times "helper:table1:table14:0:command5"
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <script>
    function showHideNavigation(item) {
    var temp = document.getElementById("plexIndex");
    taskImg = document.getElementById(item.id.substring(0, item.id.lastIndexOf(':')) + ':image'+item.id.substring(item.id.length-1));
    taskDiv = document.getElementById(item.id.substring(0, item.id.lastIndexOf(':')) + ':child_div'+item.id.substring(item.id.length-1));
              if (taskDiv.style.display == "block" ) {
                   taskDiv.rendered = "true";
                   taskDiv.style.display = "none";
    taskImg.src = "../images/arrow_collapsed.gif";
    } else {
                   taskDiv.style.display = "block";
                   taskDiv.rendered = "false";
         taskImg.src = "../images/arrow_expanded.gif";
    </script>
    <head>
    </head>
         <form id="helper" method="post" action="/datatabledemo-app/pages/WLMHome.faces" enctype="application/x-www-form-urlencoded">
         <div id="helper:div0" style="margin-left:0.3em;">
                        <a id="helper:command0" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:image0" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />plexes</a>
         </div>
         <div id="helper:child_div0" style="display : none">
         <table id="helper:table1" width="100%">
    <tbody>
    <tr>
    <td><span id="plexIndex" title="helper:table1:0:column1"></span><div id="helper:table1:0:div2" style="margin-left:0.9em;"><a id="helper:table1:0:command1" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:0:image1" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:0:t1">plex1</span></a></div><div id="helper:table1:0:child_div1" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><div id="helper:table1:0:div4" style="margin-left:2.1em;"><a id="helper:table1:0:command2" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:0:image2" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />attributes</a></div><div id="helper:table1:0:child_div2" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table12" width="100%">
    <thead>
    <tr>
    <th scope="col"><span id="helper:table1:table12:text2" style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_1</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_2</span></td>
    <td><span style="margin-left:3.0em;">2.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_2</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_limit</span></td>
    <td><span style="margin-left:3.0em;">600.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">connection_scale</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_1</span></td>
    <td><span style="margin-left:3.0em;">5</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_2</span></td>
    <td><span style="margin-left:3.0em;">10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.05</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">normalise_scale</span></td>
    <td><span style="margin-left:3.0em;">0.00833</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">equal_delta</span></td>
    <td><span style="margin-left:3.0em;">0.0001</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_2</span></td>
    <td><span style="margin-left:3.0em;">10.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_3</span></td>
    <td><span style="margin-left:3.0em;">100.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_4</span></td>
    <td><span style="margin-left:3.0em;">1000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_5</span></td>
    <td><span style="margin-left:3.0em;">10000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_timeout</span></td>
    <td><span style="margin-left:3.0em;">120.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">score_limit</span></td>
    <td><span style="margin-left:3.0em;">5000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">retry_limit</span></td>
    <td><span style="margin-left:3.0em;">2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">reselection_limit</span></td>
    <td><span style="margin-left:3.0em;">2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_resend_timeout</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_timeout</span></td>
    <td><span style="margin-left:3.0em;">10.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_limit_1</span></td>
    <td><span style="margin-left:3.0em;">5</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_limit_2</span></td>
    <td><span style="margin-left:3.0em;">1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_fail_timeout</span></td>
    <td><span style="margin-left:3.0em;">600.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">autoinstall_load</span></td>
    <td><span style="margin-left:3.0em;">3.0</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:0:div6" style="margin-left:2.1em;"><a id="helper:table1:0:command3" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:0:image3" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />groups</a></div><div id="helper:table1:0:child_div3" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table13" width="100%">
    <thead>
    <tr><th colspan="1" scope="colgroup">Group Value</th></tr>
    </thead>
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">type1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">type2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">type3</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:0:div8" style="margin-left:2.1em;"><a id="helper:table1:0:command4" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:0:image4" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />programs</a></div><div id="helper:table1:0:child_div4" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14" width="100%">
    <tbody>
    <tr>
    <td><div id="helper:table1:table14:0:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:0:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:0:command5"></span><img id="helper:table1:table14:0:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:0:t2">called1</span></a></div><div id="helper:table1:table14:0:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    <tr>
    <td><div id="helper:table1:table14:1:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:1:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:1:command5"></span><img id="helper:table1:table14:1:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:1:t2">called2</span></a></div><div id="helper:table1:table14:1:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    <tr>
    <td><div id="helper:table1:table14:2:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:2:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:2:command5"></span><img id="helper:table1:table14:2:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:2:t2">called3</span></a></div><div id="helper:table1:table14:2:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:0:div12" style="margin-left:2.1em;"><a id="helper:table1:0:command6" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:0:image6" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />transactions</a></div><div id="helper:table1:0:child_div6" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table15" width="100%">
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">TRN1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">TRN2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">TRN3</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:0:div14" style="margin-left:2.1em;"><a id="helper:table1:0:command7" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:0:image7" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />nodes</a></div><div id="helper:table1:0:child_div7" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table151" width="100%">
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">argon.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">alina.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">ampere.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">txdt32.in.ibm.com</span></td>
    </tr>
    </tbody>
    </table>
    </div></div></td>
    </tr>
    <tr>
    <td><span id="plexIndex" title="helper:table1:1:column1"></span><div id="helper:table1:1:div2" style="margin-left:0.9em;"><a id="helper:table1:1:command1" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:1:image1" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:1:t1">plex2</span></a></div><div id="helper:table1:1:child_div1" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><div id="helper:table1:1:div4" style="margin-left:2.1em;"><a id="helper:table1:1:command2" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:1:image2" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />attributes</a></div><div id="helper:table1:1:child_div2" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table12" width="100%">
    <thead>
    <tr>
    <th scope="col"><span id="helper:table1:table12:text2" style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_1</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_2</span></td>
    <td><span style="margin-left:3.0em;">2.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_2</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_limit</span></td>
    <td><span style="margin-left:3.0em;">600.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">connection_scale</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_1</span></td>
    <td><span style="margin-left:3.0em;">5</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_2</span></td>
    <td><span style="margin-left:3.0em;">10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.05</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">normalise_scale</span></td>
    <td><span style="margin-left:3.0em;">0.00833</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">equal_delta</span></td>
    <td><span style="margin-left:3.0em;">0.0001</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_2</span></td>
    <td><span style="margin-left:3.0em;">10.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_3</span></td>
    <td><span style="margin-left:3.0em;">100.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_4</span></td>
    <td><span style="margin-left:3.0em;">1000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_adjustment_5</span></td>
    <td><span style="margin-left:3.0em;">10000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">health_timeout</span></td>
    <td><span style="margin-left:3.0em;">120.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">score_limit</span></td>
    <td><span style="margin-left:3.0em;">5000.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">retry_limit</span></td>
    <td><span style="margin-left:3.0em;">2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">reselection_limit</span></td>
    <td><span style="margin-left:3.0em;">2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_resend_timeout</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_timeout</span></td>
    <td><span style="margin-left:3.0em;">10.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_limit_1</span></td>
    <td><span style="margin-left:3.0em;">5</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_retry_limit_2</span></td>
    <td><span style="margin-left:3.0em;">1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">wcm_fail_timeout</span></td>
    <td><span style="margin-left:3.0em;">600.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">autoinstall_load</span></td>
    <td><span style="margin-left:3.0em;">3.0</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:1:div6" style="margin-left:2.1em;"><a id="helper:table1:1:command3" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:1:image3" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />groups</a></div><div id="helper:table1:1:child_div3" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table13" width="100%">
    <thead>
    <tr><th colspan="1" scope="colgroup">Group Value</th></tr>
    </thead>
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">type1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">type2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">type3</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:1:div8" style="margin-left:2.1em;"><a id="helper:table1:1:command4" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:1:image4" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />programs</a></div><div id="helper:table1:1:child_div4" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14" width="100%">
    <tbody>
    <tr>
    <td><div id="helper:table1:table14:0:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:0:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:0:command5"></span><img id="helper:table1:table14:0:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:0:t2">called1</span></a></div><div id="helper:table1:table14:0:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    <tr>
    <td><div id="helper:table1:table14:1:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:1:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:1:command5"></span><img id="helper:table1:table14:1:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:1:t2">called2</span></a></div><div id="helper:table1:table14:1:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    <tr>
    <td><div id="helper:table1:table14:2:div10" style="margin-left:2.7em;"><a id="helper:table1:table14:2:command5" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><span id="program" title="helper:table1:table14:2:command5"></span><img id="helper:table1:table14:2:image5" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:table14:2:t2">called3</span></a></div><div id="helper:table1:table14:2:child_div5" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><table id="helper:table1:table14:table141" width="100%">
    <thead>
    <tr>
    <th scope="col"><span style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:0:coloumn41"></span><span style="margin-left:3.0em;">load</span></td>
    <td><span style="margin-left:3.0em;">0.25</span></td>
    </tr>
    <tr>
    <td><span id="program" title="helper:table1:table14:table141:1:coloumn41"></span><span style="margin-left:3.0em;">dynamic</span></td>
    <td><span style="margin-left:3.0em;">yes</span></td>
    </tr>
    </tbody>
    </table>
    </div></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:1:div12" style="margin-left:2.1em;"><a id="helper:table1:1:command6" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:1:image6" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />transactions</a></div><div id="helper:table1:1:child_div6" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table15" width="100%">
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">TRN1</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">TRN2</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">TRN3</span></td>
    </tr>
    </tbody>
    </table>
    </div><div id="helper:table1:1:div14" style="margin-left:2.1em;"><a id="helper:table1:1:command7" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:1:image7" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />nodes</a></div><div id="helper:table1:1:child_div7" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table151" width="100%">
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">argon.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">alina.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">ampere.in.ibm.com</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">txdt32.in.ibm.com</span></td>
    </tr>
    </tbody>
    </table>
    </div></div></td>
    </tr>
    <tr>
    <td><span id="plexIndex" title="helper:table1:2:column1"></span><div id="helper:table1:2:div2" style="margin-left:0.9em;"><a id="helper:table1:2:command1" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><img id="helper:table1:2:image1" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" /><span id="helper:table1:2:t1">plex3</span></a></div><div id="helper:table1:2:child_div1" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><div id="helper:table1:2:div4" style="margin-left:2.1em;"><a id="helper:table1:2:command2" href="#" onclick="javascript:showHideNavigation(this)" style="color: rgb(0, 0, 0); text-decoration: none; display : block;"><img id="helper:table1:2:image2" src="../images/arrow_collapsed.gif" alt="Expand / Collapse" style="border : 0;" />attributes</a></div><div id="helper:table1:2:child_div2" style="color: rgb(0, 0, 0); text-decoration: none; display : block"><table id="helper:table1:table12" width="100%">
    <thead>
    <tr>
    <th scope="col"><span id="helper:table1:table12:text2" style="margin-left:2.4em;">Attribute Name</span></th>
    <th scope="col"><span style="margin-left:2.1em;">Attribute Value</span></th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_1</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">session_scale_2</span></td>
    <td><span style="margin-left:3.0em;">2.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_scale_2</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">load_limit</span></td>
    <td><span style="margin-left:3.0em;">600.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">connection_scale</span></td>
    <td><span style="margin-left:3.0em;">1.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_1</span></td>
    <td><span style="margin-left:3.0em;">5</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_limit_2</span></td>
    <td><span style="margin-left:3.0em;">10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.10</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">same_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_adjustment</span></td>
    <td><span style="margin-left:3.0em;">0.05</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_1</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">known_scale_2</span></td>
    <td><span style="margin-left:3.0em;">0.0</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">normalise_scale</span></td>
    <td><span style="margin-left:3.0em;">0.00833</span></td>
    </tr>
    <tr>
    <td><span style="margin-left:3.0em;">equal_delta</span></td>
    <td><span style="margin-left:3.0em;">0.0

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

  • Use of const keyword in java ?

    Hi All,,
    I want to know the use of const keyword with proper example.
    Many many thx in advance
    Cheers
    Souvik

    I want to know the use of const keyword with proper example.
    There is no proper example, because const is not used in Java. If you want to create a constant, use the final keyword.

  • Binding of JSF componenent using java script

    Hi friends,
    How can we set the "ID" and "Binding" property of JSF Tag( <ui:textfield>) using java script?
    Sample Code:
    <ui:script>
    var name="xyz";
    var value="abc";
    </ui:script>
    <ui:textField id="'+name+'" binding="#{bean.dataMap['+value+']}"/>
    When i try to run the above code, there is no compilation and run time error. But the id which assigned to TextField is '+name+' as a string rather than "xyz".
    How can we overcome the below problem? Please guide me?

    The binding and the id attributes are server side. You cannot set them via javascript

  • How to use j query in .jsf page which is designed using adfpagetemplate.

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled7.jsf" id="d1">
    <af:form id="f1">
    <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">
    <f:facet name="center">
    <af:resource type="javascript"
    source="/lib/jquery/jquery-1.3.2.min.js"/>
    <af:resource type="javascript">
    function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next() : $('#slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
    $active.removeClass('active last-active');
    $(function() {
    setInterval( "slideSwitch()", 15000 );
    </af:resource>
    <af:resource type="css">
    #slideshow IMG {
    position:absolute;
    top:0;
    left:0;
    z-index:8;
    opacity:0.0;
    #slideshow IMG.active {
    z-index:10;
    opacity:1.0;
    #slideshow IMG.last-active {
    z-index:9;
    </af:resource>
    <af:panelGroupLayout id="slideshow" layout="vertical">
    <!-- The use of groups avoids that each image gets surrounded by a div -->
    <af:group>
    <af:image source="/images/cristo1.jpg" id="i1" />
    <af:image source="/images/cristo2.jpg" id="i2"/>
    <af:image source="/images/ipanema1.jpg" id="i3"/>
    </af:group>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="header"/>
    <f:facet name="end"/>
    <f:facet name="start"/>
    <f:facet name="branding"/>
    <f:facet name="copyright"/>
    <f:facet name="status"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    Above content is my code written in jsf page....
    jquery working fine if i create page withoput pagetemplate...
    Any please guide me to use jquery in the jsf page(created with page template)...
    Thanks in advance
    Edited by: 991543 on May 7, 2013 11:05 PM

    Hi frank,
    thanks for your reply frank........still am facing the same issue even i tried wat you told.
    I have pasted the code below for your reference.....
    please let me knw wat is the wrong thing in below code if any thing wrong plz guide me to resolve because this is needed in our project, thanks in advance.
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled7.jsf" id="d1">
    <af:form id="f1">
    <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">
    <f:facet name="center">
    <af:resource type="javascript"
    source="/lib/jquery/jquery-1.3.2.min.js"/>
    <af:resource type="javascript">
    function slideSwitch() {
    var $active = $('#pt1:slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#pt1:slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next() : $('#pt1:slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
    .addClass('active')
    .animate({opacity: 1.0}, 1000, function() {
    $active.removeClass('active last-active');
    $(function() {
    setInterval( "slideSwitch()", 1000 );
    </af:resource>
    <af:resource type="css">
    #pt1:slideshow IMG {
    position:absolute;
    top:0;
    left:0;
    z-index:8;
    opacity:0.0;
    #pt1:slideshow IMG.active {
    z-index:10;
    opacity:1.0;
    #pt1:slideshow IMG.last-active {
    z-index:9;
    </af:resource>
    <af:panelGroupLayout id="slideshow" layout="vertical">
    <!-- The use of groups avoids that each image gets surrounded by a div -->
    <af:group>
    <af:image source="/images/cristo1.jpg" id="i1" />
    <af:image source="/images/cristo2.jpg" id="i2"/>
    <af:image source="/images/ipanema1.jpg" id="i3"/>
    </af:group>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="header"/>
    <f:facet name="end"/>
    <f:facet name="start"/>
    <f:facet name="branding"/>
    <f:facet name="copyright"/>
    <f:facet name="status"/>
    </af:pageTemplate>
    </af:form>
    </af:document>
    </f:view>
    Thanks & Regards
    Gowthaman Narayanan
    Edited by: 991543 on May 15, 2013 4:27 AM
    Edited by: 991543 on May 15, 2013 4:30 AM

  • How to Pass Click Value to DB using Java

    How to Pass Click Value to DB using Java and display tat
    clicked value row data in flex
    i have created connection with Sql Server using java and drew
    pie chart from values fetched from XML file created by Java
    wat i need is when i click pie chart region (widget) i should
    display a alert by giving value of particular widget name and Value
    from Database and display in Flex Alert

    Use AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
    JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource....

  • How to dynamically configure JPA setting at runtime using java code?

    Hi,
    I am new to EJB 3.0 and JPA. I am trying to help my company to deploy the use of JPA in EJB3.0. Currently, i am trying out with OpenJPA in IBM Webshpere Application Server 7.0. We have four different WAS servers running for testing, system integration testing, user testing and production respectively, and in each region, the configurations for data source, JDBC username and password, schema, etc are different. So i think i would need to configure the JPA setting during runtime using Java code that determines which is the environment. And apparently i am stuck with the limited knowledge i have.
    1) I understand that i could override the JDBC in the persistence xml by creating entity manager using entity manager factory. But is it possible that i do similar thing by using inejction of persistence context on entity manager to obtain a container managed entity manager?
    2) Alternatively, it is possible to create multiple persistence unit in the XML and inject different PU to the entity manager, am i right? But how to inject dynamically since @PersistenceContext(unitName="xxx") only accepts constant declaration.
    3) Is it possible that the JDBC username and password are read from properties file?
    Thanks for your help in advance!

    Hi
    Thanks for the reply.
    Are you saying that i have to configure the data source authentication to the backend DB2 using the JAAS-J2C? Correct me if i am mistaken. I guess i am unable to do so as the application server setup only contains one data source, and the server hosted a number of applications. Every applications has their own JDBC username and password supply to the data source (the ID supplied at the DB2 side will decide which resource can access) and thus, i have to supply the username and password at runtime. Talked to the server guy and seems that it is not feasible to have seperate datasource for each applications as considered to the volume of applications hosted inside the server.
    Any suggestion?

  • Using jsp:include in jsf

    I want to include a jsp page in another jsp page. My code is as follows:
    1)
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    version="2.0">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Page Title</title>
    </head>
    <body>
    <f:subview id="sub">
    <jsp:include page="/demo.jsp"/>
    </f:subview>
    </body>
    </html>
    </jsp:root>
    2) demo.jsp is given below
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    version="2.0">
    <ui:composition>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Page Title</title>
    </head>
    <body>
    <h:outputText value="Hello"/>
    </body>
    </html>
    </ui:composition>
    </jsp:root>
    but when i run this application i get error as follows:
    javax.servlet.ServletException: @15,48 <jsp:include> Tag Library supports namespace: http://java.sun.com/JSP/Page, but no tag was defined for name: include
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
         org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
         org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)

    You're mixing two view technologies with each other: JSP and Facelets. You cannot do that. Use the one or the other. In Facelets you can just use <ui:include>. Leave all of those legacy <jsp> tags out when using Facelets.
    By the way, although the <f:subview> is superfluous in Facelets and only used in JSP, I wanted to tell you, this tag is better to be placed in the include file, not in the parent file. Otherwise you may risk "duplicate component ID" problems.

  • Using Java 5, how to develop customizable web-pages  like iGoogle ?

    Is it possible to develop customizable web-pages like iGoogle does, using Java 5 ( simply using JSPs, servlets, JSFs, AJAX etc. and without using portals) ?
    A simple example explaining how to provide 3-4 header graphics options ( like igoogle does) will be helpful. (iGoogle seems to create a cookie, which appears to be used to render the selected header-graphics).
    TIA
    Edited by: DevelopingJava2005 on Jul 7, 2008 9:36 AM

    Without using portals?
    Google uses RSS feeds to compile their mashups on iGoogle. The positioning of those boxes are managed with AJAX and upon placement are saved into a session so they stay there for each visit after.
    Please be a little more clear as to what you are looking for. Yes, it is possible to develop web pages using the technologies you specified to simulate something like iGoogle, so give us some more details on what exactly you're looking for.
    Code wouldn't hurt either.

  • JavaEditorKit sun.tools.java.Constants jar help

    I found a good article on JavaEditorKit using JEditorPane.
    Problem is this article uses sun.tools.java.Constants. I could not find a jar that would provide the functionality.
    I was able to see api for sun.tools.java.Constants.
    I need someone to help me in getting the approriate jar.
    Thanks & Regards
    Ajay Kalidindi

    Hi,
    I saw that too thinking it would be a good way to learn about a simple editor in Java.
    I got it working only after upgrading the code to Java 2 (ie com.java to javax) and extracting out all of sun.tools.java package from tool.jar out of my jdk. It looked ok but I think this is way too old example to be using now days.
    I think that the sun.tools.java package has been protected from developers use so it wouldn't help you
    develope anything anyway, however http://www.jext.org uses a similiar idea to do its' syntax highlighting
    it might worth checking out.
    regards
    David

  • Java Script and JSF question

    Hello,
    I have a JSF component like this that has a pageSize attribute. It shows a grid with 5 elements.
    <x:gridView id="#{tab}GridView" pageSize="5">
    </f:gridView>Then I have a drop down with 5 menu items where the user can select how many elements they want to see visible on the grid. My question is, how do i use Java Script to to change the pageSize attribute above with what the user selected in the menu below? I have been looking at java script code and online docs for an hour and cant come up with anything that seems to work. Any help will be appriciated. Thank you!!!
    <x:selectOneMenu id="myMenu" onclick="">
      <f:selectItem id="perPage1" itemValue="1" itemLabel="1" />
      <f:selectItem id="perPage2" itemValue="2" itemLabel="2" />
      <f:selectItem id="perPage3" itemValue="3" itemLabel="3" />
      <f:selectItem id="perPage4" itemValue="4" itemLabel="4" />
      <f:selectItem id="perPage5" itemValue="5" itemLabel="5" />
    </x:selectOneMenu>

    [...]how it was never designed to be used for
    such large applications[...]All I can say is that if this is true, then it doesn't show. Yes, I know it (oak) was originally designed for embedded systems, but Java and Oak aren't identical.
    My assembly teacher
    always makes fun of Java, saying java gives you far
    less control, it prevents you from making mistakes.
    No control over unsigned/ signed values, pointers
    etc. Yes. But broadly speaking that's the point. Java sacrifices control over such things. The return, however, is that programmers are able to be more productive because of the great swathes of problems that can no longer arise.
    The mistake is in assuming that Java is the best tool for everything. It isn't, and in fact no language us. As it turns out, Java is just great for building enterprise systems. It has a few other strengths, some of which (applets for example) have been more important in its original uptake but are now relatively minor features.
    You don't write an enterprise website in Intel assembly, and you don't write device drivers in Java.
    Not saying its not good but its good for
    smaller applications like cell phones and
    mini-computers.I think you mean something different by mini-computers to what I mean...
    Its portability is actually the main point in its favour for use in cell phones. If it weren't for that, I think C or C++ would probably have sole ownership of that space.
    Now i'm not saying any thing against it just
    confused on why a class like data-structures at my
    University [...] would be taught using java when C would
    probably be a lot better for Very Large ADTS.You and Joel Spolsky:
    http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
    I disagree, because I don't think it much matters what language you learn - experience trumps any particular initial language choice. If you're still using Java in 15 years I'll be fairly surprised.

  • How to use postback property for JSF to reneder a popup only once

    Hi All,
    I'm using java script function to show a JSF page as popup. I have called the javascript function on page load of another JSF page.
    How do i make sure that the popup is getting rendered only once and not everytime the page is getting refreshed .
    Can i use postback property in JSF page for this purpose ?
    Thanks in Advance.

    try postback..
            Boolean postBackValue = (Boolean)resolveExpression("#{adfFacesContext.postback}");
            Boolean defaultBooleanValue = new Boolean("false");
            if (postBackValue.equals(defaultBooleanValue)) {
      public static Object resolveExpression(String expression) {
        FacesContext ctx = FacesContext.getCurrentInstance();
        Application app = ctx.getApplication();
        ExpressionFactory elFactory = app.getExpressionFactory();
        ELContext elContext = ctx.getELContext();
        ValueExpression valueExp = elFactory.createValueExpression(elContext,expression,Object.class);
        return valueExp.getValue(elContext);
      }

  • How to use Java Script in jspx pages of ADF Faces?

    I wanna invoke an Applet in a jspx using Java Script...
    How can I do this? :)

    check my other post..that's to know how to use js in jsf pages...not to invoke applet..
    Re: how to Add inline JavaScript to a Page 11G

  • Dynamic Programming Using Java

    hiiii...anyone knows how to use a dynamic programming to compare a mouse movement using java??? i hope some one can help me......

    This was just an idea. I do not know of any program
    implementing this. I will not help you store coordinates
    into a database, but I can explain my suggestion in
    more detail.
    Since the characters might be more dependent on the page
    then the user, you must make a sub character for each page.
    Your table row must then contain following fields:
    user, time, page, x-cord, and y-cord.
    Now assume following
    - we will use the characters 'average speed' and
    'centre of gravity of movement'.
    - we have two sessions of data, that is two sets of table
    rows as described above. Every set belongs to different
    users.
    - the sessions are spread on a set of pages.
    Now we will compute the distance between these users. There
    are a lot of distance metrics but let us choose the most
    common one. Let P be a set of points in R^n and p.n
    be the n coordinate of the point p in P. Then for any p1
    and p2 in P, define the distance metric to be
    D(p1,p2) = summa_{over n} (p1.n-p2.n)^2
    Define the average speed for a certain user and page to be
    Speed(user, page) (in) R. Further more let
    Gravity(user, page) (in) R^2 be the centre of gravity of
    movement for a user and page.
    Then the total distance is
    D(user_1, user_2) = summa_{over all pages} k1*D(Gravity(user_1, page), Gravity(user_2, page)) + k2*D(Speed(user_1, page), Speed(user_2, page))
    where k1 and k2 are constants determines the importance
    you want to assign the two characters.

Maybe you are looking for

  • Settings for Automatic PO conversion

    Dear Gurus..., We are using Mfg Plant and Depo. Now we are doing generally the stock transfer of item from one plant to another plant manually. (Creation of PR and PO) I want to create automatic  PO  through MRP Run in recieving plant (DEPO) for the

  • How can I terminate the purchase order item?

    Dear all, I have created and released a purchase order, which had two items. like following Item Material no qty delivery date 10 Material-A 1000 pcs 12-25-2008 20 Material-B 300 pcs 12-28-2008 This purchase order has been released. And the vendor pr

  • Motion 4 problems

    When using motion 4 all my RAM is getting used and I have 8Gb. I just watch it slowly go down on my free memory app. I have been told that this shouldnt happen but not been told if there is a solution? Any one had this problem too or know how to solv

  • OTA Update Not Querying Custom Update URL

    I built Firefox 2.0 for the Nexus 4 and it does not check for updates using my custom update URL. The phone just sits on "Checking for updates..." My webserver logs also show there is no request for update.xml. Is this functionality missing? Can it b

  • File Info...  Created

    I am using Photoshop CS6 on a Mac, OS 10.8.2.  When I go to File/File Info... and look for the date a photo was created, I only see the time to the level of minutes.  I need to know to the level of seconds.  I believe earlier versions gave this infor