Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP 2 Tag Files

 
Chris Snapp
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
    • 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 ]
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64847
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • 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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic