-
公开(公告)号:CA2349905A1
公开(公告)日:2002-12-07
申请号:CA2349905
申请日:2001-06-07
Applicant: IBM CANADA
Inventor: WARFIELD JAY W , GREEN JOHN H , BEISIEGEL MICHAEL
Abstract: A method and system that provides a common framework for mapping between a document (e.g. an XML document) and a software object (e.g. a Java object). The framework uses a handler that masks how a property is obtained for mapping. This resul ts in mapping code that has a common appearance for both directions of mapping. A mapping betwe en elements of an XML document and the properties of a Java object is contained in a mapper . A mapper maps from the XML document to an object using a parser (such as DOM or SAX). Mapping in the other direction (Java to XML) requires that the elements of the XML document be built in a particular order to ensure validity of the resulting XML document. The prese nt invention builds an XML template document using JSP, for example. Using JSP based templates enables tags of the document to be written in the JSP, with callbacks to get element and attribute values. Further, content can be directed to a buffer, or directly to a response stre am of a servlet.