XSL and Java in ICS

Document Sample
XSL and Java in ICS Powered By Docstoc
					A to J
Moving from ASP to JSP

Jim Bell
Real world Blueprints
Portable, Scaleable, and Robust
Roadmap for JSP and more
Leverage ASP experience
Custom Tag Libraries
XML Parallel
Designers and Developers
 J2EE supports Numerous Scenarios
 Creativity and Diversity Fostered
 Learn about Web & EJB Container

 Some Scenarios
  – Multitier
  – Stand-alone
    • EJB
    • Java application
    • Foreign with Web Service
Blueprints – Web Centric
Blueprints – Standalone
Blueprints – Web Container
   What do you call a
that doesn’t come back?
An ASP Epidemic
ASP Temptation
Everybody’s Doing It

  – Easy Access
  – Quick Solution
  – Scripting Experience
  – IIS in Configuration
  – Uncertain about Java
  – No Proof of Concepts
ASP Avoidance
Reasons to Avoid ASP Transformations

  – Reduce Technology Count
  – Reduce Failure Points
  – Reduce Subsystem Handoffs
  – Increase Maintainability
  – Increase Speed
  – Follow J2EE Standards
ASP Complications
Exacerbated By…

  – Mixed ASP code
     • Some logic in JScript (non-standard)
     • Some logic in VBScript
  – Cluttered Code
     • Tags and Code Combined
     • Lack of OO Approach
Interactive Pages
Can Separate Logic & Page Design
Use Components
Alternative to CGI
Faster and Easier than CGI
Combination of Tags and Scripting
ASP Issues
 Not Scalable
 ActiveX implies “Wintel” platforms
 Essentially only IIS support
 Porting Products
 Must Colocate Components
 Proprietary process
 Solo initiative
 Mixed, interpreted languages
 Susceptible to crashes
 Memory leaks & Pointer problems
    What do you
        sit on,
      sleep on,
and brush your teeth
JSP Advantages
Program in Java
XML and JavaBeans ( No COM )
Extensible Tags
Better Cooperation
Rapid Prototyping
Easy Reuse
Not Copy-and-Paste Reuse
JSP Advantages – More!
  – Any web server
  – Any OS Broader Participation (JCP)
Leading Products
Reference Implementation
Definitely Scalable
Infrastructure Independence
Actions = Tags
Tag Variations
  – programmer
  – designer
  – hybrid
Proper Use
Development Steps
Standard Actions
Starting JSP 1.0
  – useBean
  – setProperty
  – getProperty
  – include
  – forward
  – plugin
Extensibility Added in JSP 1.1
Custom Tags
 Simple to Create
  – Tool Support
  – Doable Manually
 Object Oriented
  – More Maintainable
  – Readily Reusable
  – Encapsulated Logic
 Portable
  – Common concepts and syntax
  – Multiple Vendors
Source of Libraries
 Departmental
  – better maintenance
  – easy handoff
 Corporate
  – consistent approach
  – best practices
 Suppliers
  – ISP
  – Web Services
 Application Servers
  – E.g. BEA WebLogic
Pieces to the Puzzle
  – simple
  – nested
  – iterative
Tag Library Descriptor
WAR (optional)


  – BodyTag
  – IterationTag
  – Tag
  – TryCatchFinally


  – TagSupport
  – BodyTagSupport
  – BodyContent
  – TagData
  – PageData
Do You Know TLD?

XML Document

 – Tag Names
 – Valid attributes
 – Links Tags to Handlers
Per Request
Processes Tag
Communicates with other objects
Can Alter BodyContent
Implements one interface
  – Tag
  – BodyTag ( for more power )
Some Interface Methods
Some Interface Constants
Sample : Looping
    <jrb:myLoop i=“10”>
  – doStartTag()
  – doAfterBody
  – a bit more work
     JSP Snippets
<%@ taglib uri=“where” prefix=“jrb” %>

<jrb:myHelloWorld />
<jrb:myValue myAtt=“myField” />
<jrb:myWrap>Plain Text</jrb: myWrap>
<jrb:myNest /></jrb:myLoop>
       TLD ( page 1 )
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE taglib PUBLIC "-//Sun
 Microsystems, Inc.//DTD JSP Tag Library
 1.1//EN" "http://java.sun.com/j2ee/dtds/web-

      TLD ( page 2 )
<info>My Very Own Tag Library</info>

   <info>My Own Tag</info>
      web.xml ( page 1 )
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun
 Microsystems, Inc.//DTD Web Application
 2.2//EN" "http://java.sun.com/j2ee/dtds/web-
      web.xml ( page 2 )



We Are Not Alone
 Adobe           K&A
 Allaire         Macromedia
 ATG             NetObjects
 BEA             Netscape
 Bluestone       New Atlanta
 Caucho          Oracle
 Exoffice        Visual Care Group
 Jakarta (ASF)   Orion
 IBM             Turbine (ASF)
 Gefion          Sun Microsystems
 KL Group        SilverStream
Tag Libraries are a Key to JSP 1.1
Providing Encapsulation
Generating Widespread Interest
  – User Community
  – Industry Participation
Future Developments Evolving
Knowledge Levels



Online References
              •   /apm
              •   /j2ee/blueprints
              •   /products/servlet
              •   /products/jsp
Online Reference Sampling