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 6586979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:51:34+00:00 2026-05-25T16:51:34+00:00

I have a Struts action class that sets a String with the markup of

  • 0

I have a Struts action class that sets a String with the markup of a custom JSP tag as request attribute. The action class forwards this to a JSP page, which contains another tag wherein the request attribute is printed. However, the custom JSP tag is not parsed and is displayed as plain text. The following shows how the JSP has rendered it:

<%@ taglib uri="/tld/CdrReconTags.tld" prefix="reconTags" %>

 <reconTags:renderHTML>
  <form id=F_3_2>

    <table align='center' width='100%' style='border:1px solid black;'  cellpadding='0' cellspacing='0'>
      <tr>
        <td colspan='2'>&nbsp;</td>
      </tr>
      <tr>
        <td align='center'>
          <div class='label'>
            <strong style='white-space: nowrap;'>STARTDATE :&nbsp;</strong>
          </div>
        </td>
        <td>
          <div class='label'>
            <strong style='white-space: nowrap;'>
              <reconTags:reportDatesDropDown id="STARTDATE_3_3" />&nbsp;
              <span style='color:red;font-weight: bold; font-size: 20px;'>*</span>
            </strong>
          </div>
        </td>
        <td align='center'>
          <div class='label'>
            <strong style='white-space: nowrap;'>ENDDATE :&nbsp;</strong>
          </div>
        </td>
        <td>
          <div class='label'>
            <strong style='white-space: nowrap;'>
</reconTags:renderHTML>

Note the unparsed custom JSP tag <reconTags:reportDatesDropDown id="STARTDATE_3_3" />. How can I let JSP evaluate it? The following code is the taghandler for <reconTags:renderHTML> and does not evaluate the body, as shown in the output above.

public class DynamicHTMLRendererTagHandler extends BodyTagSupport 
{

    private static final long serialVersionUID = 6457283471933854138L;

    public int doStartTag() throws JspException 
    {
        return EVAL_BODY_BUFFERED;
    }

    public int doAfterBody() throws JspException 
    {
       /* Grab the body content */
        BodyContent body = this.getBodyContent();

        try 
        {
            body.writeOut(body.getEnclosingWriter());
        } catch (IOException e) 
        {
              throw new JspTagException(e.toString());      
        }
        return SKIP_BODY;
    }
}
  • 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. Editorial Team
    Editorial Team
    2026-05-25T16:51:35+00:00Added an answer on May 25, 2026 at 4:51 pm

    that reconTag should be with the initial code itself, and not by being added as a String output…

    Do Note that what JSP does is:

    1 – parse the document for tags.

    2 – fills up with the Java outputs that are requested by the document.

    Since this call is only done AFTER the tags are interpreted it’s normal for these tags to come out as plain text.

    If you want to add some sort of dynamic tags to your document you’ll have to figure out a way of building the document with these tags in place prior to having it parsed… this however, might be a huge headache, if not impossible.

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

Sidebar

Related Questions

I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but
I have a JSP struts application that uses Spring to integrate with the services/dao/database.
I have a problem with authorized SSL connection. I have created Struts Action that
I have a working Action and JSP form that I'm using for creating new
I've Struts 1 action class (actions are singletons by design in struts 1) that
I have this code for login validation using a Struts2 action class which calls
I am working on struts2. In my action class I have written some accessors
I have a Struts + Velocity structure like for example, a Person class, whose
We have a Struts 2 web application that's used by pretty much every employee
I have a project that integrates Struts 1 with Spring. I now wish to

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.