struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul McCulloch <paul.mccull...@axiossystems.com>
Subject RE: bean:define vs c:set
Date Thu, 29 Jul 2004 15:38:29 GMT
<bean:define> creates a scoped attribute AND a scripting variable, whereas
<c:set> just created the scoped attribute. In your example you are making
use of the scripting variable feature (as the data is already available as a
scoped attribute).

But, with JSP2, all tags magically become EL aware (I believe). So you
should be able to just do:

<pg:pager maxPageItems="${optionsForm.pageItems}"/>

Paul

> -----Original Message-----
> From: Kris Barnhoorn [mailto:kris@biassweb.be]
> Sent: Thursday, July 29, 2004 4:25 PM
> To: 'Struts Users Mailing List'
> Subject: bean:define vs c:set
> 
> 
> Hi,
> 
> First of all I'd like to thank the contributors of this 
> mailinglist. I'm
> using struts for over 1.5 years now and i always found answers in
> archives.
> 
> 
> In this mailinglist and in the contrib/el there is often 
> suggested that
> the best way to prepare for smooth transition to JSP 2.0 is to use el
> tags now and once the application runs on a container that 
> supports JSP
> 2.0 just change the links to the tags in web.xml.
> 
> Well found an inconvenience in the fact that the define tag was not
> ported.
> 
> I have a value in a request variable that specifies who many 
> page items
> should be displayed on the page.
> But because the pager tag hasn't el capabilities i had to use 
> the define
> tag like:
> 
> <bean:define id="pageItems" name="optionsForm" property="pageItems"
> type="java.lang.Integer"/>
> 
> <pg:pager 
> 	maxPageItems="<%=pageItems.intValue()%>">
> 	
> //items
> </pg:pager>
> 
> 
> In the el way it should be like:
> 
> <c:set var="pageItems" value="${optionsForm.pageItems}"/>
> 
> <pg:pager 
> 	maxPageItems="<%=pageItems.intValue()%>">
> 	
> //items
> </pg:pager>
> 
> --> but the var pageItems can't be use in scriptlet (not in c or c_rt)
> 
> 
> So I guess is there a way to work around this without declaring the
> pageItems like this?
> 
> <% Integer pageItems =
> ((com.mycompany.foo.struts.OptionsForm)request.getAttribute("o
ptionsForm
> ")).getItems();%>
> 
> 
> Thank you
> Kris.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not the addressee
indicated in this message (or responsible for delivery of the message to such person), you
may not copy or deliver this message to anyone. In such case, you should destroy this message,
and notify us immediately. If you or your employer does not consent to Internet email messages
of this kind, please advise us immediately. Opinions, conclusions and other information expressed
in this message are not given or endorsed by my Company or employer unless otherwise indicated
by an authorised representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via
electronic mail attachments we cannot guarantee that attachments do not contain computer virus
code.  You are therefore strongly advised to undertake anti virus checks prior to accessing
the attachment to this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for loss or damage
howsoever caused.
**********************************************************************


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


Mime
View raw message