Home arrow Java arrow Page 4 - Developing Web Applications using Java Studio Creator
JAVA

Developing Web Applications using Java Studio Creator


This is the first article in a series focusing on developing web applications using Sun Java Studio Creator. This is mainly aimed at the beginners who are very new to web application development using “Sun Java Studio Creator IDE” and “Sun Java System Application Server.”

Author Info:
By: Jagadish Chaterjee
Rating: 4 stars4 stars4 stars4 stars4 stars / 12
January 09, 2007
TABLE OF CONTENTS:
  1. · Developing Web Applications using Java Studio Creator
  2. · Creating a Web Application using Sun Java Studio Creator: creating the project
  3. · Creating a Web Application using Sun Java Studio Creator: designing the web page
  4. · Creating a Web Application using Sun Java Studio Creator: coding the button
  5. · Creating a Web Application using Sun Java Studio Creator: executing the application

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

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;     }


blog comments powered by Disqus
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...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials