Java
  Home arrow Java arrow Page 4 - Developing Web Applications using Java Stu...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Developing Web Applications using Java Studio Creator
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2007-01-09

    Table of Contents:
  • Developing Web Applications using Java Studio Creator
  • Creating a Web Application using Sun Java Studio Creator: creating the project
  • Creating a Web Application using Sun Java Studio Creator: designing the web page
  • Creating a Web Application using Sun Java Studio Creator: coding the button
  • Creating a Web Application using Sun Java Studio Creator: executing the application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Developing Web Applications using Java Studio Creator - Creating a Web Application using Sun Java Studio Creator: coding the button


    (Page 4 of 5 )

    Once you have completed all the steps in both of the previous sections, we are now ready to code for the button to display "Hello World" in the label (or "lblMsg").

    Go back to "design" mode and double click on "btnShow."  At this point, you will be surprised to see the following code:

    package samplejavaapp; import com.sun.rave.web.ui.appbase.AbstractPageBean; import com.sun.rave.web.ui.component.Body; import com.sun.rave.web.ui.component.Form; import com.sun.rave.web.ui.component.Head; import com.sun.rave.web.ui.component.Html; import com.sun.rave.web.ui.component.Link; import com.sun.rave.web.ui.component.Page; import javax.faces.FacesException; import com.sun.rave.web.ui.component.Label; import com.sun.rave.web.ui.component.Button; public class Page1 extends AbstractPageBean { . . . .     public String btnShow_action() {         // TODO: Process the button click action. Return value is a navigation         // case name where null will return to the same page.     } }

    The entire code is automatically created for you to boost your productivity. The entire life cycle of the page is automatically taken care of with the code it has created. You can even customize the above code, if you want to make any modifications to the IDE generated code. It is also advised to not to modify the areas where it has remarked for you to leave alone.

    Now, you modify only the "btnShow_action" method so that it looks something like the following:

    public String btnShow_action() {         // case name where null will return to the same page.         this.lblMsg.setText("Hello World!");         return null;     }

    More Java Articles
    More By Jagadish Chaterjee


       · I am using j2ee 1.4. I have compiled the servlet and made the jar file but when i...
     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek