What is the difference between bean:write and bean:message

Editorial / Best Answer

Answered by: Syam Raj

  • Mar 16th, 2007


bean:write is used to display the value of a property in a java bean or ur action form.

bean:message is used to display the label...which are picked from the message resources...

Showing Answers 1 - 8 of 8 Answers

S Prithviraj

  • Jul 20th, 2006
 

In Jakarta Struts - you may be knowing that - both are custom tags defined in HTML Tag library.

Both are used for accessing Java beans.

Bean:Message - is to access a java bean that will display a message such as " For more details on the product displayed in this web site please contact a phone number 12345.."

Bean: write - is to display a data from the model; example "Number of People visited this site is: 1234

Bean does not directly write. the Tag is used to take help of these Beans for the above mentioned purposes

  Was this answer useful?  Yes

siva kumar reddy

  • Aug 3rd, 2006
 

hi

in the jsp

<% @taglib uri="/tags/struts-bean" pefix="bean" %>

<ul>

<bean:messages var="msg" property="propone">it will returns errors in the formbean tag

<li>

<bean:wrtite id="var"/>it will returns data abt the formbean

</li>

</bean:messages>

</ul>

  Was this answer useful?  Yes

Syam Raj

  • Mar 16th, 2007
 

bean:write is used to display the value of a property in a java bean or ur action form.

bean:message is used to display the label...which are picked from the message resources...

Suresh

  • Oct 11th, 2007
 

bean:message retrieves an internationalized message for the specified locale, using the specified message key, and write it to the output stream. Up to five parametric replacements (such as "{0}") may be specified.

The message key may be specified directly, using the key attribute, or indirectly, using the name and property attributes to obtain it from a bean.

Retrieve the value of the specified bean property, and render it to the current JspWriter as a String.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions