Posted on 2006-07-18
Medium Priority
Last Modified: 2012-05-05
I am new to JSF, I know jsp but in my new project they are using jsf in jsp and I am confused on what the code does in jsp. I wanted to know in the following code which part of the code is calling classes to get data if its calling any. Please help me out. Thanks>

<%-- $Id: receiveSwitchStatus.jsp,v 2006/06/30 03:53:32 cdreesbach Exp $ --%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://www.systar.com/bbr-1.0" prefix="bbr" %>

<f:loadBundle basename="pagecode.pages.boa.receive.i18n.Resources" var="resourceReceive" />
<f:loadBundle basename="pagecode.pages.templates.i18n.Resources" var="templatesResources" />

<%@include file="/theme/cache-control.inc" %>
 <%@include file="/theme/application-head.inc" %>
 <bbr:title id="title" value="#{resourceReceive.title_receive_Switch_status}" />
 <bbr:refresh id="refresh" period="120000" />
<h:form id="masterForm">
   <%@include file="/theme/application-header.inc" %>
   <h:panelGrid id="receiveBOA_main_grid" columns="1" rowClasses="global_area, summary_area, zoom_area" width="100%" style="height: 100%">         
      <bbr:dashboardPanel id="receiveBOA_global_panel" contentStyle="padding:4px;"
            width="100%" height="100%" cssRoot="rounded1_" overflow_y="auto" overflow_x="auto">
            <f:facet name="title">
                  <h:outputText id="receiveBOA_panel_title" value="#{resourceReceive.switch_status_main_dashboard}"/>
                  styleClass="entityMosaic-allSize" />                  

    <bbr:dashboardPanel id="receiveBOA_summary_panel" contentStyle="padding:4px;"
            width="100%" height="100%" cssRoot="rounded1_" overflow_y="auto" overflow_x="auto">
            <f:facet name="title">
                  <h:outputText id="switch_panel_title" value="#{receiveSwitchStatus.switchName} #{resourceReceive.receive_summary}"/>
                  style="border: 0px solid;"
                  showHeader = "false"
                <bbr:expandableColumn id="exp_icl_files" view="ICLFiles"/>  
                  <bbr:attributeColumn id="attributeColumn1" attribute="Label" headerText="" horizontalAlign="right" style="font-weight: bold;">
                     <f:facet name="content">
                   <h:outputText id="column1_content" value="#{resourceReceive.receive_total_files_received}" style="#{'font-weight:bold'}" />
                  <bbr:attributeColumn id="attributeColumn1a" attribute="iNumICLFiles" headerText="" horizontalAlign="left"/>
                  <bbr:attributeColumn id="attributeColumn2" attribute="Label" horizontalAlign="right">
                     <f:facet name="content">
                   <h:outputText id="column2_content" value="#{resourceReceive.receive_total_items}" style="#{'font-weight:bold'}" />
                  <bbr:attributeColumn id="attributeColumn2a" attribute="iNumItems" headerText="" horizontalAlign="left"/>
                  <bbr:attributeColumn id="attributeColumn3" attribute="Label" horizontalAlign="right">
                     <f:facet name="content">
                   <h:outputText id="column3_content" value="#{resourceReceive.receive_total_amount}" style="#{'font-weight:bold'}" />
                  <bbr:attributeColumn id="attributeColumn3a" attribute="fAmount" headerText="" horizontalAlign="left"/>
                  <bbr:expandableColumn id="exp_baseline" view="Baseline"/>
                  <bbr:attributeColumn id="attributeColumn4" attribute="Label" horizontalAlign="right">
                     <f:facet name="content">
                   <h:outputText id="column4_content" value="#{resourceReceive.receive_last_transfer}" style="#{'font-weight:bold'}" />
                  <bbr:attributeColumn id="attributeColumn4a" attribute="dtLastTransfer" headerText="" horizontalAlign="left"/>
   <bbr:dashboardPanel id="receiveBOA_zoom_panel0" contentStyle="padding:4px;text-align: center;"
            width="100%" height="100%" cssRoot="rounded1_" overflow_y="auto" overflow_x="auto">
            <f:facet name="title">
                  <h:panelGroup id="receiveBOA_zoom_panel_group0" >
                        <h:outputText id="receiveBOA_zoom_panel_title0" value="#{resourceReceive.receive_switch_file_status_label}"/>
                      <bbr:expandableColumn id="exp01" view="TableView"/>
                      <bbr:attributeColumn id="attributeColumnPartner" attribute="Label" headerText="#{resourceReceive.receive_partner_label}" horizontalAlign="left"/>
                      <bbr:attributeColumn id="attributeColumnRecStatus" attribute="Status" headerText="#{resourceReceive.receive_partner_file_status_label}" contentFormat="Icon" horizontalAlign="center"/>
                      <bbr:attributeColumn id="attributeColumnItems" attribute="iNumItems" headerText="#{resourceReceive.receive_items_label}" horizontalAlign="right"/>
                        <bbr:attributeColumn id="attributeColumnAmount" attribute="fAmount" headerText="#{resourceReceive.receive_amount_label}" horizontalAlign="right"/>
Question by:suketu9
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
  • 2
  • 2

Accepted Solution

evnafets earned 336 total points
ID: 17135430
The part referencing your classes to get data is encapsulated in Expression Language syntax.
ie all of those #{expr} expressions.

For instance one of them: "#{resourceReceive.receive_switch_file_status_label}"
Translates roughly into java as <%= resourceReceive.getReceive_switch_file_status_label() %>

However the code you have posted here also includes some non-JSF tags - the "bbr" tags.
They could also be accessing data behind the scenes.
Is that a custom taglib or a library you are using?


Assisted Solution

ss_p earned 332 total points
ID: 17137136
hi friend

this link should help you



Expert Comment

ID: 17137148
you can us e this this tutorial as well


LVL 15

Assisted Solution

bpmurray earned 332 total points
ID: 17144213
Data access is done using value binding to the components. JSF has pretty strong separation of roles in MVC, and the model is referenced by "#{bean.property}". If you look at the tags, you'll see this quite clearly, and there are three references here:

resourceReceive - a bundle that contains localized texts for the UI
templatesResources - another bundle that is never used
receiveSwitchStatus - seems to be a data source

So, in this particular file, there is only one data source (the others are bundles for texts), and that's receiveSwitchStatus, which has a bunch of properties, e.g. switchEntityName. The way JSF resolves this in that it calls the method getSwitchEntityName (note the capital "S") to retrieve data from whatever receiveSwitchStatus actually is; similarly to assign a value to this, it calls the method setSwitchEntityName. Since there is no definition in the file to indicate what receiveSwitchStatus is, it's clearly defined in the faces-config.xml file in the project, as a "Managed bean". If you look in this file (found in the WEB-INF directory), you'll see something like:
            <managed-bean-name>receiveSwitchStatus </managed-bean-name>
            <managed-bean-class>com.foo.jsf.receiveSwitchStatus </managed-bean-class>
This is fairly clear: it gives the name, the actual Java class and the scope, i.e. the visibility of the bean.

The bean itself can be anything, retrieving data from any data source - a database, a file, a web-service, etc.
LVL 15

Expert Comment

ID: 17144221
One other comment: the tag <bbr:entityTable> looks like it generates a table of data. In JSF, this will be generated by iterating over a datacollection returned by the bean. For an explanation on how it does this, have a look at documentation for UIData.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

650 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