struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <ja...@metastuff.com>
Subject Re: struts:link tag
Date Tue, 12 Sep 2000 11:00:20 GMT
RE: struts:link tag
Till

Here's the source code for my copy of the LinkTag.java if you want to try it out. You'll need
to add the following extra attribute to your struts.tld file too as I've added a new attribute
"id" to LinkTag for the optional name of the query parameter. If you don't use the id attribute
then the bean property name is used for the query parameter name.

    <attribute>
      <name>id</name>
      <required>false</required>
      <rtexprvalue>false</rtexprvalue>
    </attribute>

Regards
James

James Strachan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web: http://www.metastuff.com
mail: james@metastuff.com

  ----- Original Message ----- 
  From: Otto, Till 
  To: 'struts-user@jakarta.apache.org' 
  Sent: 12 September 2000 10:03
  Subject: RE: struts:link tag


  Hi James 
  Excellent, thank you.  Will this go into the main distribution (any time soon)? 
  -Till 

  > -----Original Message----- 
  > From: James Strachan [mailto:james@metastuff.com] 
  > Sent: Tuesday, September 12, 2000 10:40 AM 
  > To: struts-user@jakarta.apache.org 
  > Subject: Re: struts:link tag 
  > 
  > 
  > struts:link tagHi Till 
  > 
  > I sent a patch to the struts-dev list to do exactly that. 
  > Here are the mails 
  > with a patch to do as you need 
  > 
  > http://archive.covalent.net/jakarta/struts-dev/2000/09/0004.xml 
  > http://archive.covalent.net/jakarta/struts-dev/2000/09/0003.xml 
  > 
  > Regards 
  > James 
  > 
  > James Strachan 
  > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  > web: http://www.metastuff.com 
  > mail: james@metastuff.com 
  > 
  > ----- Original Message ----- 
  > From: Otto, Till 
  > To: 'struts-user@jakarta.apache.org' 
  > Sent: 12 September 2000 08:33 
  > Subject: struts:link tag 
  > 
  > 
  > Hello! 
  > I would like to display a list of items with hyperlinks to an 
  > "edit page" 
  > for each line item.  Just like the subscription section in 
  > registration.jsp 
  > of the struts-example application. 
  > The example uses a custom tag for this purpose.  This seems 
  > to be an awful 
  > lot of work for this common task, doesn't it?  The only 
  > alternative I found 
  > is to use the "map feature" of the struts:link tag via the 
  > name and property 
  > attributes. 
  > Wouldn't it be nice to have another attribute in the 
  > struts:link tag, e.g. 
  > "param" that specified the property of a bean given in the 
  > name attribute? 
  > The name and value of the specified property would then be 
  > appended to the 
  > href of the hyperlink. 
  > Like this: 
  > <struts:link href="editSubscription.do" name="subscription" 
  > param="id"> 
  > My subscription</struts:link> 
  > If a subscription bean with a property "id" existed and id's 
  > value were 
  > 1001, this would evaluate to 
  > <a href="editSubscription.do?id=1001"> 
  > My subscription</a> 
  > 
  > 
  > Does this make sense? Hope it wasn't too confusing. 
  > -Till 
  > 


Mime
View raw message