HTML and CSS Reference
In-Depth Information
<ui:define name="content">
<h:form>
#{bundle['application.welcome']}, #{appUser.firstName} #{appUser.lastName}! <br/><br/>
#{bundle['application.weatherpage.currentInfo']} for #{appUser.zipCode}:
<mashup:yahooWeather temperatureType="c" locationCode="#{appUser.zipCode}"/> <br/><br/>
<h:commandLink value="#{bundle['application.weatherpage.logout']}"
action="#{weatherBacking.logout}"></h:commandLink> <br/><br/>
</h:form>
</ui:define>
</ui:composition>
</html>
The weather page displays a welcome message to the user and the Yahoo! weather information is retrieved using
the yahooWeather component of Mashups4JSF library ( http://code.google.com/p/mashups4jsf/ ) .
Mashups4JsF is an open-source project that aims at integrating Mashup services with Javaserver Faces
applications. Using Mashups4JsF, JsF developers will be able to construct rich and customized mashups by using
simple tags. Mashups4JsF also allows exporting the Java enterprise application data as Mashup feeds by annotating
the application domain classes with @Feed annotation. For more information check the project home page:
http://code.google.com/p/mashups4jsf/ .
Note
yahooWeather component gives you the ability to view the current weather status in a specific location in the
world (using Yahoo! Weather Service under the hood) using its ZIP code. It has two main attributes as shown in
Table 10-1 .
Table 10-1. Mashups4JSF yahooWeather Component
Component Attribute
Description
locationCode
The ZIP code of the location
The temperature in Fahrenheit ( f ) or Celsius ( c ). Default is c .
temperatureType
In order to configure Mashups4JSF in our JSF application, we need to add two jars to the lib folder of your web
application:
Mashups4JSF 1.0.0 core jar.
If our application is a Maven application, we need to add these jars to our application's pom.xml as shown
in Listing 10-5.
Rome 0.9 jar.
 
 
Search WWH ::




Custom Search