Java
  Home arrow Java arrow Page 5 - JSP Basics with Java Studio Creator 2 for ...
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 
Sun Developer Network 
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

JSP Basics with Java Studio Creator 2 for VB Programmers
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2006-09-25

    Table of Contents:
  • JSP Basics with Java Studio Creator 2 for VB Programmers
  • The Palette window and more
  • Creating a simple JSP page
  • Adding basic components to the page
  • Test the page

  • 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


    JSP Basics with Java Studio Creator 2 for VB Programmers - Test the page


    (Page 5 of 5 )

    From the main menu click on Build, and after the build is complete, right click the Project "MyFirst" in the project window, and click on setMain Project. Right click the Page1.jsp and click Set as start page. Now right click the MyFirst project and click on Run Project. After building you can choose to Run by hitting the button Run which is right next to Build. A Deployment Monitor shows up which allows you to cancel the deployment if desired. After a while, Page1.jsp shows up as shown.

    When you click on the button you will see that the label's text has been changed to what you wanted. Observe the URL address; you have now started a session with a unique ID.

    Do you want to add another page?

    No problem. Right click the Web Pages folder; from there you can add a new page. A new page can be renamed after the page is added. The same trick, right-click and choose, is shown.

    Do you want an image added?

    From the file menu you can add an existing item from your computer as shown.

    This adds an image to the Resources sub-folder of the web pages folder. Now add an Image control from the basic subfolder of the palette to the JSP page just above the label. Now with the following code (as shown in the next paragraph) you can set the value of the image as follows:

    public String button1_action() {
    // TODO: Process the button click action. Return value is 
    a navigation // case name where null will return to the same page. label1.setValue("Have a Cup Of Java");
    image1.setValue("/resources/sun_image.jpg");
    return null; }

    The image reference is now that of the image brought into the project earlier from the resources folder.

    When you build and run the project this is what you will see.

    Add a link to the image when clicked

    The image object brings with it the JavaScript events that you can access as shown in the next picture of the image properties. Now to the onClick event the following code was added as shown, either in the properties window of the image control, or the corresponding location in the JSP page.

    window.open ("http://hodentek.blogspot.com")

    This links the image to the URL shown.

    Summary

    Visual Basic programmers will be comfortable using this IDE to create JSPs without too much of a sweat. The tutorial gives a basic overview of the features and shows how to develop a simple JSP. In the process it also shows how to add JavaScript. The IDE works in not too unfamiliar a fashion for those who have used Microsoft IDEs. The Sun Microsystems web site has a lot of examples and tutorials that you may want to review. You may also want to watch for more tutorials on this site.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Days of proficiency with just one software are gone. Employers expect a lot these...
     

    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-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT