12.07.2015 Views

WAP/WML Programming for App. Servers

WAP/WML Programming for App. Servers

WAP/WML Programming for App. Servers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>WAP</strong>/<strong>WML</strong> <strong>Programming</strong> <strong>for</strong> <strong>App</strong>. <strong>Servers</strong>Misha DavidsonProduct Manager,<strong>App</strong>lication ServerSilverStream SoftwareFor audio:Domestic: 888 311 9053International: 908 228 9011Please go the “Poll” tab and help us better calibratethe presentation <strong>for</strong> the needs of this audience.Note: we only see the aggregate results and willshare them with you .Thank you!Conference Call: 888-311-9053International 908-228-9011


Why SilverStream and <strong>WAP</strong>?Definitions <strong>WAP</strong> – Wireless <strong>App</strong>lication Protocol <strong>WML</strong> – Wireless Markup Language<strong>WML</strong> is simple, gateways hide <strong>WAP</strong>, butBuilding a good wireless apps is hard Intermittent connectivity – app must keep state Limited displays – presentation different from Web Poor input – personalization is a must Incompatible client software – adaptive presentation at runtimeSilverstream plat<strong>for</strong>m allows doing all of the above J2EE foundation <strong>for</strong> building the applications Adaptability through integration with XML Personalization technology Access to enterprise dataConference Call: 888-311-9053International 908-228-9011


Who is the target audience?Developers familiar with J2EE Learn about the common problems in wireless domain See how J2EE concepts can be used to build <strong>WAP</strong> applicationsDevelopers familiar with Wireless apps Learn about J2EE technologies See how you can build better Wireless apps by using J2EEConference Call: 888-311-9053International 908-228-9011


Presentation OverviewGeneral Wireless <strong>App</strong>lication architecture <strong>WAP</strong> Gateways, <strong>WML</strong> Interaction with the serverTechnical challenges of writing Wireless <strong>App</strong>lications Keeping state Dealing with page size limitations Support <strong>for</strong> different browsersWireless applications in a broader context Integration with existing websites Personalization techniquesConference Call: 888-311-9053International 908-228-9011


<strong>WAP</strong>/<strong>WML</strong><strong>for</strong> J2EE developersConference Call: 888-311-9053International 908-228-9011


<strong>WAP</strong> application architecture overviewMobile Client<strong>WAP</strong><strong>WML</strong>(bin)<strong>WAP</strong> GatewayHTTP<strong>WML</strong>(text)<strong>App</strong> Server<strong>WML</strong> is a simple mark-uplanguage, optimized <strong>for</strong> smalldevices with low bandwidth<strong>WAP</strong> is a binary protocoldesigned to deliver compiled<strong>WML</strong> to these devices<strong>WAP</strong> Gateway compiles <strong>WML</strong>to binary <strong>for</strong>mat and sends it tothe mobile devicesThere is no <strong>WAP</strong>-specific <strong>App</strong>server, instead an app servergenerates <strong>WML</strong> and sends it tothe gateway through HTTPConference Call: 888-311-9053International 908-228-9011


<strong>WML</strong> overviewWelcome to SilverStream's onlineseminar on <strong>WAP</strong> and J2EE!<strong>WML</strong> is an XML dialectSimilar to HTML BUT: strict syntax BUT: fewer features Uses URLsMinimize round-trips Deck of cards ideaUseful features Binding <strong>for</strong> specific keys Timer events Variables<strong>WML</strong>ScriptConference Call: 888-311-9053International 908-228-9011


<strong>WML</strong> Interaction with <strong>App</strong> ServerEnter the amount:


J2EE Patterns<strong>for</strong> <strong>WAP</strong>/<strong>WML</strong>Conference Call: 888-311-9053International 908-228-9011


Server-side <strong>App</strong>lication Architecture15Controller(Servlet)3ViewView(JSPs) View(JSPs) View(JSPs)(JSPs)View(JSP)2Model(Beans)4Use a servlet to dispatchrequests (1) Client request acceptedby the controller servlet (2) Data validated against theModel and updates are made (3) Control is passed to theView (JSP) (4) JSP retrieves the relevantdata from the Model (5) A fully <strong>for</strong>med response issent back to the clientConference Call: 888-311-9053International 908-228-9011


Back-end connectivity on the server<strong>WAP</strong> applications require essential data Stocks, schedules, price, quantity, address…J2EE provides a variety of rich data access mechanisms JDBC – relational databases EJB – databases plus logic Connector API – ERP systems, non-relational databases SilverStream EDCs until Connectors are fully implementedConference Call: 888-311-9053International 908-228-9011


<strong>WAP</strong> challenges: diverse plat<strong>for</strong>msIdeal: all <strong>WAP</strong> gateways/devices fully implement the same versionof the standard Reality: varying levels of support <strong>for</strong> different featuresSecond best: all the users of my app are running the same deviceusing the same gateway Reality: even within the same organization you will find differentdevicesReality: either Write to lowest common denominator (weak) Make applications adapt to devices (need framework)Conference Call: 888-311-9053International 908-228-9011


Identifying the target plat<strong>for</strong>mUse User-Agent field of the incoming request Call getHeader("User-Agent") on HttpServletRequest Some sample User Agents: Nokia7110/1.0(04.84) MOT-D5/4.1.5 UP/4.1.16f Slurp.so/1.0 (slurp@inktomi.com;) See http://internetalchemy.org/wap/ualist.phtmlNot all browsers or gateways send a User-Agent If a site supports both HTML and <strong>WML</strong> Run the <strong>WML</strong> site on virtual host wap.***.comto distinguish it from Web requests on www.***.comConference Call: 888-311-9053International 908-228-9011


Use XML/XSLT to reach target plat<strong>for</strong>msRequestDetermine<strong>App</strong>licationUser-AgentProducePickXML Response XSL StylesheetCombineXSLT ProcessorProduceResponseXSLT is a language <strong>for</strong> writingstylesheetsAn XSLT processor convertsXML to a target <strong>for</strong>mataccording to the rules specifiedin a given stylesheet<strong>App</strong>lication generates XMLoutputUser-agent in<strong>for</strong>mation is usedto pick a stylesheetThe two are combined by theXSLT processor to produce<strong>WML</strong> output <strong>for</strong> a particularplat<strong>for</strong>mConference Call: 888-311-9053International 908-228-9011


XML/XSLT using JSP Custom tags (1)A class that implements a javax.servlet.jsp.tagext.TaginterfaceTags can nest in arbitrary waysTags have access to the output produced by the tags and mark-upthey enclose Use the enclosed mark-up and tag output as an XML source Use User-Agent to pick a stylesheet Run XSLT in the enclosing tag and write the output to the clientConference Call: 888-311-9053International 908-228-9011


XML/XSLT using JSP Custom tags (2)Using XSLT to better target the <strong>WML</strong> is powerful However, doing on the fly trans<strong>for</strong>mation is expensive, since itrequires parsing every timeKeep the power of XSL but reduce processing overhead by usingDOM trees DOM is Document Object Model, object representation of XML Have components (JSP custom tags) on the page generate aDOM tree Feed it to the XSLT processorThis is the approach taken by SilverStreamePortal frameworkConference Call: 888-311-9053International 908-228-9011


Keeping state <strong>for</strong> <strong>WAP</strong> applications<strong>WAP</strong> devices have intermittent connectivity<strong>WAP</strong> applications often need to preserve stateIncorrect approaches Could store state in cookies, but Not all <strong>WAP</strong> gateways support cookies Could store state in the URL But there is a size limitation <strong>for</strong> many devicesWorking solution Store state in the Session on the server Embed session ID in the URL Use HttpServletResponse.encodeURL() SilverStream allows optional use of cookies(if supported by the client) Add a random sequence to defeat cachingConference Call: 888-311-9053International 908-228-9011


Statefull Session EJBs <strong>for</strong> chunking<strong>WAP</strong> places an about 1.5K limit on the size of the page that can besent to a device the actual size varies between devices this is the size of a compiled <strong>WML</strong> deckAs devices get bigger screens, we’ll need a generic chunkingmechanism Session Bean (EJB) based Initialize from DB Feed data in 1K chunks – sure to compile to less than 1.5KConference Call: 888-311-9053International 908-228-9011


<strong>WAP</strong>/<strong>WML</strong> <strong>App</strong>licationsin a larger contextConference Call: 888-311-9053International 908-228-9011


Usability of <strong>WAP</strong> sitesA good <strong>WAP</strong> site requires a lot of design Get to any info quickly Hierarchy is flat No typing required Link to info instead of promptingDifferent users have different needs To get ahead of competition need personalizationConference Call: 888-311-9053International 908-228-9011


PersonalizationPersonalization is KEY Remember what a user does Allow explicit configuration via the WEB <strong>WAP</strong> and Web are complimentary, not competingtechnologies SilverStream ePortal provides the tools and the infrastructureBut there is a big obstacleHow to ID users without typing Some phones and gateways pass a unique ID Have users save bookmark in a <strong>for</strong>mhttp://wap.***.com/resource?ID=XXX&PWD=YYY Do NOT do that with financial appsConference Call: 888-311-9053International 908-228-9011


Building comprehensive <strong>WAP</strong>/Web sites<strong>WAP</strong> ClientHTML ClientXSLT ProcessorXML <strong>App</strong>licationData ModelUse XML/XSLT approach describedearlier Good <strong>for</strong> simple query type sites Requires quite a bit ofprocessing power Hard to map onto complex sites<strong>WAP</strong> ClientHTML ClientUse a common Business Logicinfrastructure Better use of each technology<strong>WML</strong><strong>App</strong>licationHTML<strong>App</strong>lication Extra work, but with good datamodel not too muchData Model Harder to maintain, butdecoupling helps reduceconflictsConference Call: 888-311-9053International 908-228-9011


J2EE provides a solid framework <strong>for</strong> <strong>WAP</strong>Make it easier <strong>for</strong> developers to build <strong>WAP</strong> applications Build applications using JSPs and Servlets Separate logic from presentation using MVC Use XML/XSLT to target specific devices Use Servlet APIs and Session EJBs to represent the state of theapplication Use back-end technologies (JDBC, Entity Beans, Connectors) toprovide essential dataMake users happy by giving them ease of use Utilize available J2EE-based personalization frameworks <strong>for</strong>building user portalsConference Call: 888-311-9053International 908-228-9011


Useful References<strong>WAP</strong> Forum – the mother of all <strong>WAP</strong> sites www.wap<strong>for</strong>um.com<strong>WAP</strong> Phone Emulator developer.phone.comXML-XSLT Processing xml.apache.org/xalan/overview.htmlSilverStream J2EE <strong>App</strong> Server www.silverstream.com/appserverSilverStream ePortal www.silverstream.com/ePortalThis presentation www.silverstream.com/seminararchivesExcellent <strong>WAP</strong> Site built in SilverStream www.wapportal.netConference Call: 888-311-9053International 908-228-9011


Inside J2EE Online Seminars - NextNext:10/26 – An Insider’s Look at the J2EE Certification ProcessThe “certification process” that application servers must pass isexplained: The J2EE certification process licensees must undergo, thetesting process, what’s involved and how it can help you in buildingand deploying J2EE compatible applications.Coming in November:Deploying J2EE <strong>App</strong>licationsJ2EE Per<strong>for</strong>mance Tips and TechniquesTo register or to view previous seminars please go to:http://www.silverstream.com/onlineseminarsConference Call: 888-311-9053International 908-228-9011

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!