Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 61853 invoked from network); 22 Feb 2005 01:32:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Feb 2005 01:32:23 -0000 Received: (qmail 93977 invoked by uid 500); 22 Feb 2005 01:32:13 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 93698 invoked by uid 500); 22 Feb 2005 01:32:12 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 93684 invoked by uid 99); 22 Feb 2005 01:32:12 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of pc.leung@gmail.com designates 64.233.184.207 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.207) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 21 Feb 2005 17:32:11 -0800 Received: by wproxy.gmail.com with SMTP id 36so1259506wra for ; Mon, 21 Feb 2005 17:32:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=k2F1VBxwV2dnx6qSJiYElFAEY8ZjNBt922iYyw9BtIrKwjPgEGcjZOaboKh1ekRR1aEs09vyAfOaY+sYqg+qUfsyt8P3gFhgiY9r21R0oy4zu2B3mTKh4nsd94QcKbRLtRXcdhrESRGSgfnfPwxkevFBS7WqUyQyuKmo+2XcOok= Received: by 10.54.27.7 with SMTP id a7mr221516wra; Mon, 21 Feb 2005 17:32:08 -0800 (PST) Received: by 10.54.54.35 with HTTP; Mon, 21 Feb 2005 17:32:08 -0800 (PST) Message-ID: Date: Tue, 22 Feb 2005 09:32:08 +0800 From: Daniel PC Leung Reply-To: Daniel PC Leung To: Struts Users Mailing List Subject: How can the controller class of Tiles get the attribute of other Action class? Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have the following controller class. I would like to change the parameter of createMenuItem dynamically based on the user group after login. How can the controller class of Tiles get the attribute of of other Action class? Thanks public class MyMenuAction implements Controller { private MenuItem createMenuItem (String label, String link) { SimpleMenuItem item = new SimpleMenuItem(); item.setLink(link); item.setValue(label); return item; } private List getLinks() { List list = new ArrayList(); list.add(createMenuItem ("Option1", "/option1")); list.add(createMenuItem ("Option2", "/option2")); list.add(createMenuItem ("Option3", "/option3")); return list; } public void perform (ComponentContext context, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws ServletException, IOException { List items = (List) getLinks(); context.putAttribute ("items", items); } } --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org