Hi, thanks for your answer. However, I have 2 issues:
1) formatDate tag must not have a body, but i have worked this around through scripting variable 2) I don't see how the format of the date changes accrding to selected locale. There is one locale in session (the struts one - Globals.LOCALE_KEY) but this one has no influence. So I've tried to change the locale settings in windows to, e.g. ENGLISH, but the date is still shown in the original format (Czech). Here is the snip of JSP code I am using: <bean:define id="date" name="document" property="lastChangedDate" type="java.util.Date"/> <fmt:formatDate value="<%=date%>" dateStyle="FULL"/> Radek > -----Original Message----- > From: Paul McCulloch [mailto:[EMAIL PROTECTED] > Sent: Friday, August 27, 2004 11:04 AM > To: 'Struts Users Mailing List' > Subject: RE: Bean's get method with parameter > > > A getter with a paramteter is not a bean property, and so won't be > accessible with the usual tags. > > I'd suggest that the formatting of your date is the > responsibility of your > view layer, and not the form bean. The easiest way to do waht > you ar after > is to use the JSTL's <fmt: formatDate> tag: > > <fmt: formatDate> > <bean:write name="theClass" > property="lastChangedDateString"/> > </fmt: formatDate> > > This will automatically pick up the request locale. > > Paul > > > -----Original Message----- > > From: Vaclavik Radek [mailto:[EMAIL PROTECTED] > > Sent: Friday, August 27, 2004 9:53 AM > > To: [EMAIL PROTECTED] > > Subject: Bean's get method with parameter > > > > > > Hi, > > > > this question may have a simple answer, but currently I don't > > see it :) > > > > From my JSP I wanto access some bean's property which > > returns, say, date as > > string in localized format, depending on currently selected locale > > (Globals.LOCALE_KEY). > > > > Currently, I have method like this in my bean: > > getLastChangedDateString(Locale locale){ > > .. > > return some_string > > } > > > > Therefor, the returned date string is formatted accordingly > to current > > locale. Is it possible to pass this parameter (locale) to the > > get method, > > from jsp? Something like: > > <bean:write name="theClass" > > property="lastChangedDateString(here_I_need_the_current_locale)"/> > > > > OR > > > > another solution came to my mind: Have the method > > getLastChagedDateString() > > without parameters and let the method find out the current > > locale itself. > > But here I don't know wheter, and if so then how, the bean > > has access to > > current session in order to retrieve the current locale. > > > > Any hints? > > > > > > Thanks in advance. > > > > Radek > > > > _____________________________ > > > > Ing. Radek Václavík > > ICS Department - webmaster > > > > ZeNTIVA a.s. > > U Kabelovny 130, 102 37 Praha 10 > > Czech Republic > > tel. +420 267 243 296 > > _____________________________ > > > > > > > ********************************************************************** > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >