Java
  Home arrow Java arrow Page 3 - 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 - Creating a simple JSP page


    (Page 3 of 5 )

    JSPs are contained in a project, and it is necessary to create a project first. From File--> New Project you open the next screen, where you create a project.

    Here you choose a WEB category which points to a default JSF Web application. In the WEB category you may import a project created in an earlier version or a JSR-169 portlet project. For this tutorial choose a JSF Web Application. A standard project can have all the features of building, running and debugging the project in the IDE. Now click the Next button; this takes you to the next window.

    In this tutorial this project has been named MyFirst. Review the location of the project folder and files as well as the default package name. Now click on the Finish button. 

    The project gets created with all the standard required resources as shown. The project comes with an initial JSP page, Page1. For this newly created project, this also happens to be the start page. It also comes with a default theme. The page can be renamed by right clicking the page and choosing to rename. You may also change the theme. For this tutorial, the default page name was accepted and a green theme was chosen by right clicking a theme and choosing set as current theme. The page can now be accessed by running the project, which gets displayed at the URL address http://localhost:28080/MyFirst/.

    Each JSP has associated with it three tabbed pages, one each for the design, Java, and JSP aspects of the page. The design is where you drag and drop and manipulate your controls, JSP is where you see the code for JSP with all the tags, and Java is where the Java coding of your project is made. The next window shows the tabbed page Design of Page1.jsp. Presently it is empty, but read carefully the text on this page, which describes what actions are to be taken to work on this canvass.

    The next paragraph shows the tabbed page JSP of Page1.jsp. This is color coded for ease of readability. This is an xml file. Again it is empty of any components.

    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:jsp="http://java.sun.com/JSP/Page" 
    xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" 
    pageEncoding="UTF-8"/>
    <f:view>
    <ui:page binding="#{Page1.page1}" id="page1">
    <ui:html binding="#{Page1.html1}" id="html1">
    <ui:head binding="#{Page1.head1}" id="head1">
    <ui:link binding="#{Page1.link1}" 
    id="link1" 
    url="/resources/stylesheet.css"/>
    </ui:head>
    <ui:body binding="#{Page1.body1}" id="body1" 
    style="-rave-layout: grid"> <ui:form binding="#{Page1.form1}" id="form1"/> </ui:body> </ui:html> </ui:page> </f:view> </jsp:root>

    In this page you may insert a JSP tag by just inserting a < character, which opens a JSP Completion drop-down menu from which you can choose a variety of items; that includes JSP tags and other tags as shown.

    Remove the < character now. Go to the menu item Build and from the drop-down click on Clean and build main project. This will produce an output as shown.

    On the tabbed page, Java shows the code inserted during design as shown in the next picture (partially shown).

    More Java Articles
    More By Jayaram Krishnaswamy


       · 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 1 hosted by Hostway
    Stay green...Green IT