Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

JSP Custom Tags through XSL

 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know how to transform an xml file into a JSP page that includes custom tag. the properties of the custom tag are defined in the xml file.
Basically the xml file could look like
...
<report name="foo" link="foo.html" />
and the custom tag to be used would be something like:
<util:reportTag name="foo" link="foo.html"
someotherproperty="somevalue />

Thanks.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you know the input XML format then isin't it like writing a simple Stylesheet to convert it and write it to a file with ".jsp" extension. Note that you could write a JSP in a XML format which is nothing but a JSP Document in the JSP.1.2 Specification.
Or did I mis-understand your problem?
- satya
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. The solution of course was trivial. All I needed was the attribute tag.
Here is another question:
What is the syntaxt to put a taglib library declaration such as
<%@ taglib
uri="/misc/util.jar"
prefix="util"
%>
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
General from looks like...
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
[xmlns:taglibPrefix="URI"]+ ...
version="1.2">
other elements
</jsp:root>

<%@ taglib uri="/misc/util.jar" prefix="util" %>
In XML syntex of JSP, declaring tab library

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:util="urn:jsptld:/misc/util.jar"
version="1.2">
</jsp:root>

For more detail info, plse visit SyntexRef
Hope this helps!!
 
A feeble attempt to tell you about our stuff that makes us money
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic