You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by meeboo <de...@gmail.com> on 2008/03/16 23:12:51 UTC

Hi all

I have set my struts.date.format properties but they seem to have no effect
at all. The set value is 
struts.date.format=yyyy-MM-dd but when using the <s:date> tag the format is
for example "Jan 14, 2008 8:00:00 AM". All my other properties take effect
so there's no problem with setting other values via the struts.properties
file.

In this case am trying to print a java.util.Date object with <s:date
name="starts" />. It will print out fine if I for instance use <s:date
name="myDate" format="%{@com.test.StrutsSupport@MY_FORMAT}" />

I've also noticed that since you can't nest S2 tags the <s:date> tag becomes
pretty useless because you can't use it within <s:url> actions. Is there a
way around this?

Thanks!
-- 
View this message in context: http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16084868.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re:

Posted by meeboo <de...@gmail.com>.
Thanks for the reply. I did try nesting a <s:date> tag within a <s:url> but
no dice. This is what I tried:

<s:url action="date/">
<s:date name="starts" />
</s:url>

I didn't even think this would, but it actually did render the following
result
http://localhost:8080/myapp/2007-05-12 day/ 

I was expecting http://localhost:8080/myapp/day/2007-05-12.action

Also I noticed that there seems to be a bug with the var attribute in
<s:url> (it doesn't work at all)

Maybe someone can shed some light on these issues? 



Alexis Pigeon wrote:
> 
> Hi,
> 
> On 18/03/2008, meeboo <de...@gmail.com> wrote:
>>
>>  Has anyone had success with <s:date /> and setting the
>> struts.date.format
>>  property?
>>
>>  meeboo wrote:
>>  >
>>  > Hi all
>>  >
>>  > I have set my struts.date.format properties but they seem to have no
>>  > effect at all.
> 
> [snip]
> 
>>  > I've also noticed that since you can't nest S2 tags the <s:date> tag
>>  > becomes pretty useless because you can't use it within <s:url>
>> actions. Is
>>  > there a way around this?
> 
> I can't help you with your issue about setting the struts.date.format
> property (I never needed the <s:date> tag so far), but as for
> "nesting" S2 tags, most often it can easily be done using the
> <s:param> tag. See the examples in the tag reference [1].
> 
> HTH,
> alexis
> 
> [1] http://struts.apache.org/2.0.11/docs/url.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16149006.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re:

Posted by Alexis Pigeon <pi...@gmail.com>.
Hi,

On 18/03/2008, meeboo <de...@gmail.com> wrote:
>
>  Has anyone had success with <s:date /> and setting the struts.date.format
>  property?
>
>  meeboo wrote:
>  >
>  > Hi all
>  >
>  > I have set my struts.date.format properties but they seem to have no
>  > effect at all.

[snip]

>  > I've also noticed that since you can't nest S2 tags the <s:date> tag
>  > becomes pretty useless because you can't use it within <s:url> actions. Is
>  > there a way around this?

I can't help you with your issue about setting the struts.date.format
property (I never needed the <s:date> tag so far), but as for
"nesting" S2 tags, most often it can easily be done using the
<s:param> tag. See the examples in the tag reference [1].

HTH,
alexis

[1] http://struts.apache.org/2.0.11/docs/url.html

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


Re:

Posted by meeboo <de...@gmail.com>.
Has anyone had success with <s:date /> and setting the struts.date.format
property?


meeboo wrote:
> 
> Hi all
> 
> I have set my struts.date.format properties but they seem to have no
> effect at all. The set value is 
> struts.date.format=yyyy-MM-dd but when using the <s:date> tag the format
> is for example "Jan 14, 2008 8:00:00 AM". All my other properties take
> effect so there's no problem with setting other values via the
> struts.properties file.
> 
> In this case am trying to print a java.util.Date object with <s:date
> name="starts" />. It will print out fine if I for instance use <s:date
> name="myDate" format="%{@com.test.StrutsSupport@MY_FORMAT}" />
> 
> I've also noticed that since you can't nest S2 tags the <s:date> tag
> becomes pretty useless because you can't use it within <s:url> actions. Is
> there a way around this?
> 
> Thanks!
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Adate%3E-tp16084868p16116709.html
Sent from the Struts - User mailing list archive at Nabble.com.


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