developer.com
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
New
 
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See The Winners!




Developer Jobs

Be a Commerce Partner














 


Developer News -
PHP 5.3 Accelerates PHP    June 30, 2009
Sun Releases NetBeans 6.7 IDE for Java, PHP    June 29, 2009
Why Firefox Doesn't Take Google Chrome Features    June 26, 2009
First Major PHP Update in Years Coming Soon    June 25, 2009
Free Tech Newsletter -

JavaServer Faces and ASP.NET - A Side by Side Look
By Michael Klaene

Go to page: Prev  1  2  3  

The faces-config file is also where you list all JavaBeans associated with your JSP page file. In fact, this is where you can configure any Java objects your application needs to reference. These Java objects are referred to as 'managed beans'. All JSF backing beans will be listed as managed beans in this configuration file, but any other objects you need will be found here too. A managed bean contains the fully qualified class name, the scope of the bean (whether to store it at the Request, Session, or Application level of the application), and the name to use when referencing the bean. In the XML below, the backing bean for the starting web page is listed as well as an entry for an EJB (Enterprise JavaBean) called ReservationsSessionBean that we use to share data in the application:

    <managed-bean>
        <managed-bean-name>ReservationsSessionBean</managed-bean-name>
        <managed-bean-class>webreservations.ReservationsSessionBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>ConferenceRooms</managed-bean-name>
        <managed-bean-class>webreservations.ConferenceRooms</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

Back to the application, our request to view reservations takes us to RoomReservations.cs.aspx for the ASP.NET version, and RoomReservations.jsp for the JSF version. In the associated code files, RoomReservations.cs and RoomReservations.java, the event code retrieves the room id stored in the previous page and uses it to filter a second table that lists reservations for that room. The label above the data table is modified to reference the name of the room.

ASP.NET
JSF

A delete button accompanies each row of data. Both of these components allow you to modify table data with very little effort. Last, each form contains a button which takes you to a form for adding a new reservation for that room. These forms appear below. These were created quickly by dragging and dropping a text field for the name of the group reserving the room, two calendar components for selecting the start and end times of the reservation, and a button to save the reservation. The calendar components provided by Java Studio Creator and Visual Studio display differently, but serve the same purpose.

ASP.NET
JSF

At this point, we need to have the user enter some data and deal with the issues that arise when accepting user input, validation for example. My next article will take up where we left off here. In it, we will look at other issues most applications face such as validating input, converting data, providing error messages, and internationalization.

About the Author

Michael Klaene is a Senior Consultant with Sogeti LLC. He has spent over 7 years in IT, specializing in J2EE and Oracle analysis and development.

Go to page: Prev  1  2  3  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


ASP & ASP.NET Archives






internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs