aspose file tools*
The moose likes Struts and the fly likes bean:define not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:define not working" Watch "bean:define not working" New topic
Author

bean:define not working

Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
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 ]

Sandeep
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Rajesh,
Where do you define "test" ?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
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 ]
Sumit Malik
Ranch Hand

Joined: Jan 05, 2007
Posts: 84
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


If at first you don't succeed, don't try skydiving
Sandeep Awasthi
Ranch Hand

Joined: Oct 23, 2003
Posts: 597
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
 
 
subject: bean:define not working