Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
 
 
Search All Tutorials

 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 
JSF
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Facelet debug Tag

                          

This tag is useful in displaying the component tree and scoped variables. This information will be displayed in a popup window of browser when we press Ctrl+Shift+(a key). This key will be specified in hotkey attribute. For example, in the code below in "debugtemplate.xhtml", this has been specified "p". So when page comes to the user then if Ctrl+Shift+p is pressed, debug window is open which displays the component tree and scoped variables.
 


debug.xhtml : 
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html">
<body>
        Content above composition tag will not be rendered.
         <ui:composition template="/pages/debug/debugtemplate.xhtml">
               <ui:define name="face1">
                   <center><h2>RoseIndia Facelet Tags Tutorial</h2></center>
                   <h3>Welcome to the Facelet world..........</h3>
              </ui:define>
              <ui:define name="face2">Enter UserID :<br/>
                   <h:inputText id="it" /><br/><br/>
             </ui:define>
             <ui:define name="face3">Enter Password :<br/>
                   <h:inputSecret id="is" /><br/><br/>
             </ui:define>
            <ui:define name="face4">
                   <h:commandButton id="cb" value="Submit" />
            </ui:define>
       </ui:composition>
     Content below composition tag will not be rendered.
</body>
</html>

 debugtemplate.xhtml :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
     <title>facelet example </title>
          <link href="../../style/CSS.css" rel="stylesheet" type="text/css"/>
</head>
<body> 
          <ui:insert name="face1"> </ui:insert>
          <ui:insert name="face2"> </ui:insert>
          <ui:insert name="face3"> </ui:insert>
          <ui:insert name="face4"> </ui:insert>
          <ui:debug hotkey="p" rendered="true"/>
</body>
</html>

 Rendered Output : This is the page that is displayed to the user first. Now if we press Ctrl+Shift+p then debug window is opened that is shown in the second figure below :

debug window :

Html Source Code :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>facelet example </title>
   <link href="../../style/CSS.css" rel="stylesheet" type="text/css" />
</head>
<body>
     <center><h2>RoseIndia Facelet Tags Tutorial</h2></center>
     <h3>Welcome to the Facelet world..........</h3>
     Enter UserID :<br /><input id="it" type="text" name="it" /><br /><br />
     Enter Password :<br /><input id="is" type="password" 
     name="is" value="" /><br /><br />
    <input id="cb" type="submit" name="cb" value="Submit" />
    <script language="javascript" type="text/javascript">

    //<![CDATA[
function faceletsDebug(URL) { day = new Date(); id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',   'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); };var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'P' & e.shiftKey & e.ctrlKey) faceletsDebug('/facelettag/pages/debug/debug.jsf?facelets.ui.DebugOutput=1179482643961'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };
//]]>
</script>
</body>
</html>

This tag contains only one attribute :

hotkey : This attribute is used to specify the key which is to be pressed with Ctrl+Shift to open a debug window. Its default value is "d". It doesn't take EL expression.

                          

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Hot Web Programming Job

Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.