• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP 2 Tag Files

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I'm attempting to use purely XML based JSP 2 tag files and I've bumped into a couple of problems. I'll toss a snippet of code to help with the explanation.

  • I'd like to dynamically generate an XHTML checkbox via a JSP tag that takes in parameters and determines whether to build the element with the "checked" or "disabled" attributes. I thought I could get away with throwing some <c:if> tags around the <jsp:attribute> tag but it fails with a nullPointerException. Anyone know how to choose what attributes are added to a <jsp:element> tag?


  • I'd like to pass a bunch of parameters in the body of a tag, this was easy when I was making the JSP tags using class files but I'm not sure how to pull it off with JSP tag files. Any pointers to info on this would be swell.


  • Any ideas on how I could place dynamic info inside of a CDATA tag on my JSP tag file would be greatly appreciated. Since the tag files are themselves XML documents, the dynamic pieces do not get rendered.



  • Any help on these problems would be greatly appreciated, hopefully I'm not pushing to much in one post.

    - Thanks all
    [ September 26, 2005: Message edited by: Chris Snapp ]
     
    Chris Snapp
    Greenhorn
    Posts: 16
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Huh, I'm an idiot.....a simple fix for the javascript problem would be to escape the CDATA tags.....a'lika so:


    [ September 26, 2005: Message edited by: Chris Snapp ]
    [ September 26, 2005: Message edited by: Chris Snapp ]
     
    Sheriff
    Posts: 67747
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    XML based JSP



    May I ask why? This has come up a few times before. The XML syntax for JSP is meant to be used by the JSP containers as an intermediate format, or for machine-generated JSPs where it is useful to build up a DOM and serialize it, but it's certainly not meant as something humans should want to generate.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic