You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by robin bajaj <ro...@gmail.com> on 2006/11/16 21:38:23 UTC

bean:write not displaying the intended values

Hi Folks,

At Struts 1.x level,
I am writing the value of bean's property on a jsp page
using <bean:write name="bean" property="bean-property" scope="request"/> 
  tag , but nothing gets displayed on the web page.

Infact the generated HTML (view source in the browser), shows the tag's 
code as-is. <bean:write name="bean" property="bean-property" 
scope="request"/>

However,
I can display the value of bean's property using a scriptlet.

<%LoyaltyProfileDto loyaltyProfileDTO = 
(LoyaltyProfileDto)request.getAttribute("loyaltyProfileDTO");
out.println(loyaltyProfileDTO.getEMail());				%>

This scriptlet works fine and displays the bean property's value correctly.

I dont know what's wrong,
Any ideas ?
regards,
- R

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: bean:write not displaying the intended values

Posted by robin bajaj <ro...@gmail.com>.
Good Stuff, it worked, I was missing a quote in my taglib declaration.

Instead of <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
it was <%@ taglib uri=/WEB-INF/struts-bean.tld" prefix="bean" %>

Missing " before /WEB-INF

Thanks a ton,
- R

Chris Loschen wrote:
> Did you include the taglib reference in your JSP page? Something like this:
> 
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> 
> Without it, the JSP can't find the custom tag and you get the behavior you're describing.
> 
> Hope that helps.
> 
> Chris Loschen 
> 
> -----Original Message-----
> From: robin bajaj [mailto:robinbajaj@gmail.com] 
> Sent: Thursday, November 16, 2006 3:38 PM
> To: Struts Users Mailing List
> Subject: bean:write not displaying the intended values
> 
> Hi Folks,
> 
> At Struts 1.x level,
> I am writing the value of bean's property on a jsp page using <bean:write name="bean" property="bean-property" scope="request"/>
>   tag , but nothing gets displayed on the web page.
> 
> Infact the generated HTML (view source in the browser), shows the tag's code as-is. <bean:write name="bean" property="bean-property"
> scope="request"/>
> 
> However,
> I can display the value of bean's property using a scriptlet.
> 
> <%LoyaltyProfileDto loyaltyProfileDTO =
> (LoyaltyProfileDto)request.getAttribute("loyaltyProfileDTO");
> out.println(loyaltyProfileDTO.getEMail());				%>
> 
> This scriptlet works fine and displays the bean property's value correctly.
> 
> I dont know what's wrong,
> Any ideas ?
> regards,
> - R
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: bean:write not displaying the intended values

Posted by Chris Loschen <ch...@oracle.com>.
Did you include the taglib reference in your JSP page? Something like this:

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

Without it, the JSP can't find the custom tag and you get the behavior you're describing.

Hope that helps.

Chris Loschen 

-----Original Message-----
From: robin bajaj [mailto:robinbajaj@gmail.com] 
Sent: Thursday, November 16, 2006 3:38 PM
To: Struts Users Mailing List
Subject: bean:write not displaying the intended values

Hi Folks,

At Struts 1.x level,
I am writing the value of bean's property on a jsp page using <bean:write name="bean" property="bean-property" scope="request"/>
  tag , but nothing gets displayed on the web page.

Infact the generated HTML (view source in the browser), shows the tag's code as-is. <bean:write name="bean" property="bean-property"
scope="request"/>

However,
I can display the value of bean's property using a scriptlet.

<%LoyaltyProfileDto loyaltyProfileDTO =
(LoyaltyProfileDto)request.getAttribute("loyaltyProfileDTO");
out.println(loyaltyProfileDTO.getEMail());				%>

This scriptlet works fine and displays the bean property's value correctly.

I dont know what's wrong,
Any ideas ?
regards,
- R

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org