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

  • SEARCH
  • Home
  • 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 6061575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:57:10+00:00 2026-05-23T08:57:10+00:00

In the documentation, the name inside a <bean:write> tag is mentioned to be the

  • 0

In the documentation, the “name” inside a <bean:write> tag is mentioned to be the name of the bean whose property has to be printed. If the property isn’t mentioned, the value of the bean itself is printed.

But if I set an attribute in the Action class like :

setAttribute("dda","hello");

and in the JSP say :

<bean:write name="dda"/>

I get “hello” even though “dda” is not the name of any bean.

Why does that happen? And what is meant by “bean itself is printed”? Is its object’s hashcode rendered?

  • 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-23T08:57:11+00:00Added an answer on May 23, 2026 at 8:57 am

    The documentation says the following about the name attribute:

    Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be rendered.

    Pay close attention to this wording: the attribute name of the bean.

    Let’s lose the naming “bean” for a moment and talk about objects (since a bean is just a special kind of object).

    You can create an object and place it as attribute in a scope (request.setAttribute(...), session.setAttribute(...) etc). And you place it with an attribute name. This is like a map if you will, the attribute name is the key and the object is the value.

    What <bean:write> does is lookup an object with the name attribute you give it (by means of jspContext.findAttribute(...)). Now it has an object to work with!

    If you also specify a property attribute for the tag, the tag will try to call a getter with the property name on that object. Now we are talking about beans because by definition a bean has getters/setters for its properties.

    But in your example you have set a string "hello" with a named attribute "dda" and you specified no property attribute for <bean:write>. A string is not a bean by definition because it has no getters/setters, it is just a plain object. In this case, the tag falls-back to printing the object itself; as the documentations again specifies: the usual toString() conversions will be applied. "hello".toString() is still "hello" so that gets printed.

    Instead of "hello" just place a new Object() in your code and you will see the Object.toString() method being called and you get something like java.lang.Object@123456 printed out.

    Place instead a bean with a getBla getter and a <bean:write name="dda" property="bla" /> will trigger the call to the dda bean for the bla’s property getter.

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

Sidebar

Related Questions

I'm trying to find documentation on how I can override a property name in
On the iReport documentation I found these XPath queries: /addressbook/category@name /addressbook/category/person@id /addressbook/category/person+LASTNAME /addressbook/category/person+FIRSTNAME /addressbook/category/person+hobbies*hobby
According to the sqlite3 documentation , The COLLATE clause following each column name defines
I've seen it everywhere. In documentation, web sites, help screens, you name it. Why?
Documentation says: The Grails team discourages the embedding of core application logic inside controllers,
for example here in documentation http://api.jquery.com/attribute-contains-selector/ it says $('input[name*=man]') I would write instead $(input[name*='man'])
The API documentation gave me hopes last night with bindInfoWindowHtml. But it doesn't seem
According to the documentation AbsoluteOptions[expr,name] gives the absolute setting for the option name. AbsoluteOptions
I apologize that this isn't a question on how to use Mathematica, but rather
I've got an app that has a handheld layout.xml and a tablet layout.xml. Inside

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.