Let's try to do this then!
Creating a Library of Custom
Components
We have created two custom components that can be useful for many other web
applications, and the natural desire is to use them to create a library and use it
whenever it might become needed. Fortunately, it is very easy to add a library of
custom components to a Tapestry 5 application??”all we need is to put the library into
the WEB-INF/lib directory of that application. Tapestry will automatically discover
the available components, and our task will be simply to use these components
whenever we need them.
It is not too difficult to create a library of custom components. All we need to do is to
package all the appropriate classes into a JAR file, add one Tapestry-specific line to
the manifest of that file, and create a module class that will serve as a kind of anchor
for the library. Tapestry will find and load this module. From it, Tapestry will find
out where exactly to look for the library's components. The Library module should
be packaged into the JAR along with all the other classes, and that Tapestry-specific
line in the manifest should be pointing to the module. Such concentrated description
looks perhaps too complicated, but its practical application is not that difficult.
Pages:
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290