Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use an external JSP tag library with XPages?

Tags:

jsp

taglib

xpages

I would like to use a JSP tag library supplied by a different (not IBM) software company with XPages. Is this possible? If you can, how can I associate the new jar file to the tag library namespace so it would be recognized?

like image 589
ajbarickman Avatar asked Dec 12 '12 20:12

ajbarickman


People also ask

Which elements can you use to import a tag library in a JSP document?

For JSP tag libraries, the web. xml file can include a taglib element and two subelements: taglib-uri. taglib-location.

How many different tag library we can use in JSP?

Under the JSP 1.1 specification, there can be only one tag library and only one TLD file in the JAR file.

Which is the correct way of including CQ tag library in JSP?

jsp" %> directive informs the JSP compiler to include a complete file into the current file. It is as if the contents of the included file were pasted directly into the original file. With the <cq:include script="myScript. jsp"> tag, the file is included at runtime.

What is Taglib URI in JSP?

The taglib directive declares that your JSP page uses a set of custom tags, identifies the location of the library, and provides means for identifying the custom tags in your JSP page. The taglib directive follows the syntax given below − <%@ taglib uri = "uri" prefix = "prefixOfTag" >


1 Answers

I highly doubt it. In all likelihood, the library would have to be converted to a JSF component library. There are some similarities between the syntax used to define each, but the primary difference is that JSP uses a single Java class known as a tag handler to both define the nature of an object (i.e. its properties) and to send markup to the browser that is representative of the object state. In contrast, JSF uses two: the component and the renderer. The component is just the identity of the object; the renderer handles the markup generation. A subtler difference is that JSP tag libraries are by convention stored as .tld files, which are then referenced from within the JSP page; XPages expect components to be defined in .xsp-config files and renderers to be defined in faces-config.xml files. If a component is properly defined (even if its corresponding renderer is not), Designer will recognize the prefix:tag syntax on any page at build time and generate the appropriate Java code. Otherwise, Designer rejects the tag as invalid and refuses to build the project.

In summary, JSP tag libraries are, to my knowledge, not natively consumable in XPage apps, but can be used as a basis for creating JSF component libraries that can be consumed in any XPage app.

like image 78
Tim Tripcony Avatar answered Nov 06 '22 06:11

Tim Tripcony