Extending java server faces web pages to support multiple devices
10068030 ยท 2018-09-04
Assignee
Inventors
Cpc classification
International classification
Abstract
The present invention provides a method, system, and computer program product for extending Java Server Faces Web pages to support multiple devices. The method includes: providing a device and modeling language independent Java Server Faces (JSF) web page, wherein the JSF web page does not contain any modeling language specific elements.
Claims
1. A method for extending Java Server Faces (JSF) Web pages to support multiple devices, the method comprising: storing a JSF Web page in a Web server, the JSF Web page comprising device independent and markup language independent multiple device JSF tags and lacking any markup language specific elements, the device independent and markup language independent multiple device JSF tags referencing a multiple device component representative of a top-level element of the JSF Web page, a multiple device component representative of an area of the JSF Web page, and a multiple device component representative of an arrangement of one or more widgets in the area; receiving, from a client device, a request for the JSF Web page in the Web server; processing the JSF Web page to identify the device independent and markup language independent multiple device JSF tags; locating JSF components specific to a particular device and a particular markup language and individually referenced by corresponding ones of the device independent and markup language independent multiple device JSF tags; selecting a particular render kit of a plurality of render kits in accordance with a markup language required by a Web browser executing on the client device; rendering the JSF Web page with the located JSF components utilizing the selected render kit; and, returning the rendered JSF Web page to the client device.
2. A computing system for extending Java Server Faces (JSF) Web pages to support multiple devices, the computing system including a processor executing instructions stored in a non-transitory computer-readable storage medium, the instructions including instructions to: store a JSF Web page in a Web server, the JSF Web page comprising device independent and markup language independent multiple device JSF tags and lacking any markup language specific elements, the device independent and markup language independent multiple device JSF tags referencing a multiple device component representative of a top-level element of the JSF Web page, a multiple device component representative of an area of the JSF Web page, and a multiple device component representative of an arrangement of one or more widgets in the area; receive, from a client device, a request for the JSF Web page in the Web server; process the JSF Web page to identify the device independent and markup language independent multiple device JSF tags; locate JSF components specific to a particular device and a particular markup language and individually referenced by corresponding ones of the device independent and markup language independent multiple device JSF tags; select a particular render kit of a plurality of render kits in accordance with a markup language required by a Web browser executing on the client device; render the JSF Web page with the located JSF components utilizing the selected render kit; and, return the rendered JSF Web page to the client device.
3. A computer program product for extending Java Server Faces (JSF) Web pages to support multiple devices, the computer program product comprising a non-transitory computer-readable storage medium storing computing system-implementable instructions for activities comprising: storing a JSF Web page in a Web server, the JSF Web page comprising device independent and markup language independent multiple device JSF tags and lacking any markup language specific elements, the device independent and markup language independent multiple device JSF tags referencing a multiple device component representative of a top-level element of the JSF Web page, a multiple device component representative of an area of the JSF Web page, and a multiple device component representative of an arrangement of one or more widgets in the area; receiving, from a client device, a request for the JSF Web page in the Web server; processing the JSF Web page to identify the device independent and markup language independent multiple device JSF tags; locating JSF components specific to a particular device and a particular markup language and individually referenced by corresponding ones of the device independent and markup language independent multiple device JSF tags; selecting a particular render kit of a plurality of render kits in accordance with a markup language required by a Web browser executing on the client device; rendering the JSF Web page with the located JSF components utilizing the selected render kit; and, returning the rendered JSF Web page to the client device.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) These and other features of this invention will be more readily understood from the following detailed description of the various aspects of the invention taken in conjunction with the accompanying drawings in which:
(2)
(3)
(4) The drawings are merely schematic representations, not intended to portray specific parameters of the invention. The drawings are intended to depict only typical embodiments of the invention, and therefore should not be considered as limiting the scope of the invention. In the drawings, like numbering represents like elements.
DETAILED DESCRIPTION OF THE INVENTION
(5) As indicated above, the present invention provides a method, system, and computer program product for extending Java Server Faces (JSF) web pages to support multiple devices. The present invention provides a JSF web page including device and markup language independent JSF tags, where the JSF web page does not contain any markup language (e.g., HTML) specific elements. A set of JSF components for making a JSF web page device and markup language independent is also provided.
(6) A system 10 for extending JSF web pages to support multiple devices in accordance with an embodiment of the present invention is illustrated in
(7) A render kit 30 is provided to render the JSF web page 18 in the markup language text required by the browser 12 running on the client device 14, using the JSF components 26 referenced by the JSF tags 22 and the JSF-md components 28 referenced by the JSF-md tags 24. Multiple render kits 30 can be provided to support different markup languages. The rendered web page is then sent by the server 20 to the browser 12 in a response 32 (e.g., a HTTP response).
(8) In accordance with the present invention, the JSF web page 18 comprises JSF tags 22 and JSF-md tags 24, but does not contain any markup language (e.g., HTML) specific elements. This enables a web application to target multiple devices from a single set of device independent JSF web pages. The JSF-md tags 24, which complement the existing core set of JSF tags 22, represent the following JSF-md components 28:
(9) (A) A JSF-md component 28 that represents a document's top level element (i.e., markup language);
(10) (B) A JSF-md component 28 that represents an area of a JSF web page 18 (e.g., a rectangular container of other JSF components 26 and/or JSF-md components 28);
(11) (C) JSF-md components 28 that describe how widgets/objects are arranged within an area of a JSF web page 18 (i.e., layout and layout data information);
(12) (D) A JSF-md component 28 that represents a reference to an external function, or rendered script; and
(13) (E) A JSF-md component 28 that represents a reference to external information such as a style sheet that is stored externally to the JSF web page 18.
(14) Examples of each type of JSF-md component 28 are presented below. It should be noted that the following examples are only illustrative of the concepts of the present invention, and are not intended to be limiting in any way.
(15) Web Page Structure
(16) As with all JSF web pages 18, the declarations of the JSF tag libraries are at the top of the page:
(17) TABLE-US-00001 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%>
For the examples which follow, the JSF core tag library is represented with the prefix f: and the HTML tag library is represented with the prefix h:. New JSF-md tags 24 provided by the present invention will be assumed to be in a new JSF-md tag library for JSF-md tags 24 called md.tld, where the JSF-md tag library is represented by the prefix a:.
(18) TABLE-US-00002 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%>
The JSF core view tag 22 follows after the JSF tag library declarations and encapsulates all other JSF and JSF-md tags 22, 24 on a JSF web page 18.
(19) TABLE-US-00003 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f: view> </f: view>
Markup Language Tag
(20) A new JSF-md markup language (ml) tag 24 and corresponding JSF-md ml component 28, allow a JSF renderer to render the top level Extensible Markup Language (XML) element for the target markup language. For instance, for Extensible Hypertext Markup Language (XHTML) documents, the JSF-md ml component 28 would render <xhtml> and </xhtml>. The JSF-md ml tag 24 must be the only child of the JSF core view tag 22.
(21) TABLE-US-00004 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> </a:ml> </f:view>
Panel
(22) A panel is a JSF-md container component 28 that represents a two dimensional area with width and height that contains child JSF components 26. The following example shows a JSF-md panel tag 24 with child JSF selectonelistbox and outputtext tags 22.
(23) TABLE-US-00005 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:panel> <h:selectonelistbox id=list1> ... </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> </a:panel> </a:ml> </f:view>
Events and Actions
(24) There are two categories of events: events that are handled on the server 20; and events that are handled locally on the client device 14. Server-side event handling uses established JSF event handling mechanisms. When a client-side event occurs, a client side action is performed. The description of a client-side action is specific to each markup language, and is therefore rendered by a markup language specific renderer. Some renderers may render script logic using a scripting language such as JavaScript, while others may render XML formed instructions. A new JSF-md call tag 24 and corresponding JSF-md call component 28 encapsulate the concept of a call to a function. It is the responsibility of the JSF-md call component 28 to render the markup language specific instructions such as script, or as a command to execute a device specific function.
(25) An example of a client-side action is attribute to attribute linking, where a change in the value of one JSF component's attribute results in a change to the value of a different JSF component's attribute. In the following sample JSF code, when the value of a JSF inputtext component 26 is changed, a call is made to a function whose name is attributelink. Parameters that the function call requires are specified with child JSF core param tags 22.
(26) TABLE-US-00006 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <h:selectonelistbox id=list1 onchange=function1> <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1/> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1/> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> </a:ml> </f:view>
Layout
(27) Layout information is used by containers, such as panels, to describe how a container is to lay out its children. Examples of layout types are:
(28) (A) Grid layout where child JSF components 26 are arranged in a grid fashion, and have characteristics such as the number of columns, and the amount spacing between columns; and
(29) (B) Pixel layout where child JSF components 26 are positioned and sized using coordinates and dimensions measured in a number of pixels.
(30) The following example illustrates a new JSF-md layout tag 24 which is a child of any JSF container tag, such as the JSF-md panel tag.
(31) TABLE-US-00007 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:panel> <a:layout type=grid> <f:param name=columns value=2 /> <f:param name=marginX value=4 /> <f:param name=marginY value=4 /> <f:param name=spacingX value=2 /> <f:param name=spacingY value=2 /> </a:layout> <h:selectonelistbox id=list1 onchange=function1> <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1/> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1 /> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> ... </a:panel> </a:ml> </f:view>
(32) Alternatively, a specific JSF-md layout tag 24 for each layout type may be used. For instance, a JSF-md gridlayout tag 24 may be used as follows:
(33) TABLE-US-00008 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:panel> <a:gridlayout columns=2 marginX=4 marginY=2 spacingX=2 spacingY=2 /> <h:selectonelistbox id=list1 onchange=function1> <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1/> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1 /> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> ... </a:panel> </a:ml> </f:view>
Layout Data
(34) Layout data is used by contained components to describe how the component is to be arranged within its parent container, such as horizontal alignment within a grid cell. As with layout, there are a number of layout data types such as:
(35) (A) Grid layout data which specifies, for instance, how the component is to be horizontally and vertically aligned within the grid cell, and the number of horizontal and vertical grid cells to occupy; and
(36) (B) Pixel layout data which specifies the horizontal and vertical position coordinates measured in pixels, and dimensions measured in pixels.
(37) The following example illustrates a new JSF-md layoutdata tag 24 that has a type attribute to specify the type of layout data. The layout data type of its parent JSF component 26 (in this example, selectonelistbox) needs to be compatible with the layout type of its parent's JSF container component (in this example, panel).
(38) TABLE-US-00009 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:panel> <a:layout type=grid> <f:param name=columns value=2 /> <f:param name=marginX value=4 /> <f:param name=marginY value=4 /> <f:param name=spacingX value=2 /> <f:param name=spacingY value=2 /> </a:layout> <h:selectonelistbox id=list1 onchange=function1> <a:layoutdata type=grid> <f:param name=alignmentX value=fill /> <f:param name=alignmentY value=top /> <f:param name=cellsX value=2 /> <f:param name=cellsY value=1 /> <f:param name=excessX value=true /> <f:param name=excessY value=false /> </a:layoutdata > <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1 /> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1 /> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> ... </a:panel> </a:ml> </f:view>
(39) Alternatively, a specific JSF-md tag 24 for each layout data type may be used. For instance, a JSF-md gridlayoutdata tag 24 may be used as follows:
(40) TABLE-US-00010 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:panel> <a:gridlayout columns=2 marginX=4 marginY=2 spacingX=2 spacingY=2 /> <h:selectonelistbox id=list1 onchange=function1> <a:gridlayoutdata alignmentX = fill alignmentY = top cellsX = 2 cellsY = 1 excessX = true excessY = false /> <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1 /> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1 /> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> ... </a:panel> </a:ml> </f:view>
Linking to External Information
(41) A JSF web page 18 may be linked to other information, such as a style sheet, or to another web page. A new JSF-md link tag 24 and a corresponding JSF-md link component 28 encompass all of the features of the HTML link element. The HTML link element attribute names and their corresponding JSF-md link tag 24 attribute names are listed in TABLE 1.
(42) TABLE-US-00011 TABLE 1 HTML link Element Attribute JSF-md Link Tag attribute charset characterset href reference hreflang referencelanguage media media rel relation rev reverserelation type contenttype
Each JSF-md link tag 24 attribute has the equivalent function as its HTML attribute.
(43) In the following example, a JSF-md link tag 24 is used to reference an external style sheet named sheet1.css. The selectonelistbox JSF tag uses a style class that is defined in the style sheet.
(44) TABLE-US-00012 <%@taglib uri=http://java.sun.com/jsf/core prefix=f%> <%@taglib uri=http://java.sun.com/jsf/html prefix=h%> <%@taglib uri=md.tld prefix=a%> <f:view> <a:ml> <a:link relation=stylesheet reference=sheet1.css contenttype=text/css media=all /> <a:panel> <a:gridlayout columns=2 marginX=4 marginY=2 spacingX=2 spacingY=2 /> <h:selectonelistbox id=list1 onchange=function1 styleclass=listboxstyle> <a:gridlayoutdata alignmentX = fill alignmentY = top cellsX = 2 cellsY = 1 excessX = true excessY = false /> <a:call id=function1 name=attributelink> <f:param name=sourcename value=list1/> <f:param name=sourceattribute value=value /> <f:param name=targetname value=label1 /> <f:param name=targetattribute value=value /> </a:call> </h:selectonelistbox> <h:outputtext id=label1> ... </h:outputtext> ... </a:panel> </a:ml> </f:view>
(45) The system 10 for extending JSF web pages to support multiple devices in accordance with an embodiment of the present invention is illustrated in greater detail in
(46) I/O interfaces 106 may comprise any system for exchanging information to/from an external source. External devices/resources 108 may comprise any known type of external device, including speakers, a CRT, LED screen, handheld device, keyboard, mouse, voice recognition system, speech output system, printer, monitor/display (e.g., display 112), facsimile, pager, etc.
(47) Bus 104 provides a communication link between each of the components in the server 20, and likewise may comprise any known type of transmission link, including electrical, optical, wireless, etc. In addition, although not shown, additional components, such as cache memory, communication systems, system software, etc., may be incorporated into the server 20.
(48) JSF tags 22, JSF components 26, JSF-md tags 24, JSF-md components 28, JSF web pages 18, and other data used in the practice of the present invention can be stored locally to server 20, for example, in storage unit 114, and/or may be provided to server 20 over a network (e.g., network 110). Storage unit 114 can be any system capable of providing storage for data and information under the present invention. As such, storage unit 114 may reside at a single physical location, comprising one or more types of data storage, or may be distributed across a plurality of physical systems in various forms. In another embodiment, storage unit 114 may be distributed across, for example, a local area network (LAN), wide area network (WAN) or a storage area network (SAN) (not shown).
(49) Network 110 is intended to represent any type of network over which data can be transmitted. For example, network 110 can include the Internet, a wide area network (WAN), a local area network (LAN), a virtual private network (VPN), a WiFi network, or other type of network. To this extent, communication can occur via a direct hardwired connection or via an addressable connection in a client-server (or server-server) environment that may utilize any combination of wireline and/or wireless transmission methods. In the case of the latter, the server and client may utilize conventional network connectivity, such as Token Ring, Ethernet, WiFi or other conventional communications standards. Where the client communicates with the server via the Internet, connectivity could be provided by conventional TCP/IP sockets-based protocol. In this instance, the client would utilize an Internet service provider to establish connectivity to the server.
(50) A client device 14 is connected to the server 20 over network 110. Although not shown, client device 14 includes many of the same components described above with regard to the server 20. A browser 12 for viewing web pages is provided on the client device 14.
(51) Shown in memory 102 is a request system 118 for receiving a request for a JSF web page 18 from client device 14 and a render kit 30 containing one or more renderers 120 for rendering the requested JSF web page 18 in the markup language text required by client device 14 using the JSF components 26 referenced by the JSF tags 22 in the JSF web page 18 and the JSF-md components 28 referenced by the JSF-md tags 24 in the JSF web page 18. Also shown in memory 108 is a response system 122 for sending the rendered JSF web page 18 to client device 14 for display in browser 12.
(52) It should be appreciated that the teachings of the present invention can be offered as a business method on a subscription or fee basis. For example, system 10 could be created, maintained, supported, and/or deployed by a service provider that offers the functions described herein for customers. That is, a service provider could be used to extend JSF web pages to support multiple devices, as described above.
(53) It should also be understood that the present invention can be realized in hardware, software, a propagated signal, or any combination thereof. Any kind of computer/server system(s)or other apparatus adapted for carrying out the methods described hereinis suited. A typical combination of hardware and software could be a general purpose computer system with a computer program that, when loaded and executed, carries out the respective methods described herein. Alternatively, a specific use computer, containing specialized hardware for carrying out one or more of the functional tasks of the invention, could be utilized. The present invention can also be embedded in a computer program product or a propagated signal, which comprises all the respective features enabling the implementation of the methods described herein, and whichwhen loaded in a computer systemis able to carry out these methods. Computer program, propagated signal, software program, program, or software, in the present context mean any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: (a) conversion to another language, code or notation; and/or (b) reproduction in a different material form.
(54) The foregoing description of the preferred embodiments of this invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed, and obviously, many modifications and variations are possible. Such modifications and variations that may be apparent to a person skilled in the art are intended to be included within the scope of this invention as defined by the accompanying claims.