Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 44105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:36:00+00:00 2026-05-10T15:36:00+00:00

Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that

  • 0

Embedded custom-tag in dynamic content (nested tag) not rendering.

I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that contains a second custom tag that I would like to also be rendered. The problem is that the tag invocation is rendered as plaintext.

An example might serve me better.

1 Pull information from a database and return it to the page via a javabean. Send this info to a custom tag for outputting.

<jsp:useBean id='ImportantNoticeBean' scope='page' class='com.mysite.beans.ImportantNoticeProcessBean'/>  <%-- Declare the bean --%> <c:forEach var='noticeBean' items='${ImportantNoticeBean.importantNotices}'> <%-- Get the info --%>     <mysite:notice importantNotice='${noticeBean}'/> <%-- give it to the tag for processing --%> </c:forEach> 

this tag should output a box div like so

*SNIP* class for custom tag def and method setup etc out.println('<div class=\'importantNotice\'>'); out.println('   ' + importantNotice.getMessage()); out.println('   <div class=\'importantnoticedates\'>Posted: ' + importantNotice.getDateFrom() + ' End: ' + importantNotice.getDateTo()</div>'); out.println('   <div class=\'noticeAuthor\'>- ' + importantNotice.getAuthor() + '</div>'); out.println('</div>'); *SNIP* 

This renders fine and as expected

<div class='importantNotice'>     <p>This is a very important message. Everyone should pay attenton to it.</p>     <div class='importantnoticedates'>Posted: 2008-09-08 End: 2008-09-08</div>     <div class='noticeAuthor'>- The author</div> </div> 

2 If, in the above example, for instance, I were to have a custom tag in the importantNotice.getMessage() String:

*SNIP* 'This is a very important message. Everyone should pay attenton to it. <mysite:quote author='Some Guy'>Quote this</mysite:quote>' *SNIP* 

The important notice renders fine but the quote tag will not be processed and simply inserted into the string and put as plain text/html tag.

<div class='importantNotice'>     <p>This is a very important message. Everyone should pay attenton to it. <mysite:quote author='Some Guy'>Quote this</mysite:quote></p>     <div class='importantnoticedates'>Posted: 2008-09-08 End: 2008-09-08</div>     <div class='noticeAuthor'>- The author</div> </div> 

Rather than

<div class='importantNotice'>     <p>This is a very important message. Everyone should pay attenton to it. <div class='quote'>Quote this <span class='authorofquote'>Some Guy</span></div></p>    // or wahtever I choose as the output     <div class='importantnoticedates'>Posted: 2008-09-08 End: 2008-09-08</div>     <div class='noticeAuthor'>- The author</div> </div> 

I know this has to do with processors and pre-processors but I am not to sure about how to make this work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:36:01+00:00Added an answer on May 10, 2026 at 3:36 pm

    Just using

    <bodycontent>JSP</bodycontent> 

    is not enough. You should do soimething like

    JspFragment body = getJspBody();  StringWriter stringWriter = new StringWriter();  StringBuffer buff = stringWriter.getBuffer();  buff.append('<h1>');  body.invoke(stringWriter);  buff.append('</h1>');  out.println(stringWriter); 

    to get inner tags rendered (example is for SimpleTag doTag method).

    However, in the question’s code I see that inner tag is comming from a string which is not rendered as a part of JSP, but just some random string. I do not think you can force JSP translator to parse it.

    You can use regexp in your case or try to redesign your code in a way to have a jsp like this:

    <jsp:useBean id='ImportantNoticeBean' scope='page class='com.mysite.beans.ImportantNoticeProcessBean'/> <c:forEach var='noticeBean' items='${ImportantNoticeBean.importantNotices}'>     <mysite:notice importantNotice='${noticeBean}'>         <mysite:quote author='Some Guy'>Quote this</mysite:quote>         <mysite:messagebody author='Some Guy' />     </mysite:notice> </c:forEach> 

    I whould go with regexp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 91k
  • Answers 91k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer They're static methods that can be added to other types… May 11, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer Just have users install with the .Net 3.5 SP1 Bootstrapper.… May 11, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer It isn't 100%.... most importantly, 3.5 and 3.5SP1 both include… May 11, 2026 at 6:13 pm

Related Questions

I need users to mark some section of text with custom tags, I can't
I am writing a program that does a lot of writes to a Postgres
I have a custom DataGridView column that uses an embedded control that pops up
We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.