Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

bean:define not working

 
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am devloping one small application for learning.

I have tile definition

<definition name=".mainLayout" path="/layouts/mainLayout.jsp">
<put name="title" value="0101 Application"/>
<put name="header" value="/includes/header.jsp"/>
<put name="menu" value=".mainMenu"/>
<put name="footer" value="/includes/footer.jsp"/>
<put name="body" value=".main.body"/>
</definition>
<definition name=".mainMenu" path="/layouts/menuLayout.jsp">
<putList name="list">
<item link="/Employee" value="Employee" classtype="org.apache.struts.tiles.beans.SimpleMenuItem"/>
<item link="/Welcome" value="Department" classtype="org.apache.struts.tiles.beans.SimpleMenuItem"/>
<item link="/Welcome" value="Exit" classtype="org.apache.struts.tiles.beans.SimpleMenuItem"/>
</putList>
</definition>
<definition name=".main.body" path="/includes/mainBody.jsp">



my menuLayout.jsp is


Please help me

Regards

Rajesh
[ May 02, 2007: Message edited by: Rajesh Thakare ]
 
author & internet detective
Posts: 41073
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rajesh,
Where do you define "test" ?
 
Sandeep Awasthi
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne


<%@ page contentType="text/html; charset=Cp1252" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-nested" prefix="nested" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tile" %>

<tile:importAttribute />
<logic:iterate id="item" name="list" type="org.apache.struts.tiles.beans.MenuItem" >

<br>
<bean:define id="test" name="item" property="link" /><html:link action="<%=test %>" >
<bean:write name="item" property="value" />
</html:link>
</logic:iterate>
[ May 02, 2007: Message edited by: Rajesh Thakare ]
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rajesh,

You can give a try with specifying type attribute in bean efine tag as

<bean efine id="test" name="item" property="link" type="java.lang.String"/>

or try like <%=item.getLink()%> without specifying bean


Cheers !!!
Sumit Malik
 
Sandeep Awasthi
Ranch Hand
Posts: 597
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sumit,

It worked with <%=item.getLink()%> but why bean:define do not define scripting varibale that I could not understand.

thanks for reply.

Regards

Rajesh
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic