In this session, Michael Alford and Mark Meeker will describe the major business goals that drove the development of Orbitz Worldwide’s next generation online travel commerce platform, and how those goals were met with Spring and other technologies.
Last summer, Orbitz Worldwide released a new generation of its global technology platform with the goals of internationalization, white-label capability, and faster, streamlined development. Michael and Mark will describe the key challenges of this technology project and how those challenges were addressed, including the good, bad, and ugly of the Spring Framework and Spring Web Flow.
27. Dear Java Developers,
Whatever you do, don’t choose a
web framework that generates its
own XHTML (or worse, non-
validating @#$% HTML that we
wouldn’t be caught dead near).
Your friends,
The UI Team
29. Form Custom Tags
• Started pre- spring-form.tld
• Full control of mark-up
• Abstracts concept of binding
• Limit attributes available to be set
• type, maxlength, class, autocomplete
• Extended scope to include <label />
30. Form Custom Tags
• Additional values for inputs
• label-key, label-state, required, read-only
• Build in hook for JavaScript
• Turn-off running against live model
• Augment error handling
31. Error Display
• Custom Error custom tag
• Formats errors with correct styles
• Support for error tag debugging
• Error highlighting built into form inputs
32.
33.
34. Interesting Flows
• Leverage framework for page navigation
• Large number of special conditions in
booking path
• Informational pop-up flows need data from
flow, but don’t affect it
• “Helper” flows for RESTful Ajax calls
• Requirement for a “wait page”
35.
36.
37. Security and SSL
• Browser security alerts are bad for
business!
• HTTP vs. HTTPS based on URL pattern
• Spring Security channel filter to enforce
SSL
• Custom link tag insures correct protocol
• Single source of truth
38. Flow listener with flow annotations to
indicate flow’s security level
<action-state id=“purchase”>
<attribute name=“permissions” value=“USER”/>
…
</action-state>
50. Progressive Enhancement
• Separation of Layers ( HTML / CSS / JS )
• Phased development
• Easier to define view model and flows
• And the “good stuff” too!
67. Hijax
• Term coined by Jeremy Keith
• Bulletproof Ajax
(http://bulletproofajax.com/)
• Pull in portion of page via Ajax when XHR is
supported
• Re-use same portion when a full page refresh
is required
• Requires UI Componentization
79. Composite View Pattern
• Separates “layout” of page from content
• Allows to plug in different modules into page
• Used in Apache Tiles
• Leverage in-house framework
• Try and gain as much re-use of JSP code
109. Session scope obfuscated
public interface Action {
public Event execute(RequestContext context)
throws Exception;
}
public interface RequestContext {
public MutableAttributeMap getRequestScope();
public MutableAttributeMap getFlashScope();
public MutableAttributeMap getFlowScope();
public MutableAttributeMap getConversationScope();
…
}
requestContext.getExternalContext().getSessionMap()
118. SWF-297 will also allow the input-mapper to also
record validation error messages, providing a better
alternative to the FormAction generally used for this
purpose now.
131. Spring source when
cacheSeconds == 0
/**
* Prevent the response from being cached.
* See www.mnot.net.cache docs.
*/
protected final void preventCaching(HttpServletResponse response) {
response.setHeader(HEADER_PRAGMA, quot;No-cachequot;);
if (this.useExpiresHeader) {
// HTTP 1.0 header
response.setDateHeader(HEADER_EXPIRES, 1L);
}
if (this.useCacheControlHeader) {
// HTTP 1.1 header: quot;no-cachequot; is the standard value,
// quot;no-storequot; is necessary to prevent caching on FireFox
response.setHeader(HEADER_CACHE_CONTROL, quot;no-cachequot;);
response.addHeader(HEADER_CACHE_CONTROL, quot;no-storequot;);
}
}
148. register PropertyEditors
editors.put(Currency.class, new CurrencyEditor());
editors.put(Scalar.class, new ScalarEditor());
editors.put(DateTime.class, new JodaDateTimeEditor(true));
editors.put(YearMonthDay.class, new JodaYearMonthDayEditor(true));
editors.put(LocalDate.class, new JodaLocalDateEditor(true));
…
149. format tags for data types
format:dateTime
format:distance
format:distanceVector
format:interval
format:money
format:number
format:period
format:address
format:creditCard
format:emailAddress
format:location
format:name
format:phoneNumber
157. lock contention
quot;http-8585-Processor39quot; daemon prio=1 tid=0x081634c8 nid=0x65b7 waiting for moni
tor entry [0x9d41a000..0x9d41e0b0]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:114)
- waiting to lock <0xb0d85828> (a java.util.LinkedHashMap)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:187)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:156)
158.
159. cached results of
Spring’s getBeansOfType
(circa March 2007 –
Juergen says it may be fixed in Spring v2.0.5)
166. Summary
• Project context
• Technology architecture
• Building UI forms
• Managing Flows
• Security and SSL
• Progressive Enhancement
• Composite View Pattern
• Componentization
• URLs and REST
• State management and HTTP browser caching headers
• Internationalization
• Performance and concurrency
• Summary
• Q&A
167. Slides & Contact
Slides:
http://markmeeker.com/events/tse2007
Emails:
Michael Alford - malford@orbitz.com
Mark Meeker - mmeeker@orbitz.com
We are Hiring:
http://www.orbitz.com/startmycareer