You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ilja S." <il...@frontdesk.ee> on 2006/09/22 16:30:34 UTC

bean:write formatKey tag

Hello
Could you please explain why i get "JspException: Wrong format string: 
'###,###.00' " when I use <bean:write formatKey="global.format"> when 
other then "EN" locale is in user's session?

At the same time if use "format" tag <bean:write format="###,###.00"> 
then no matter what locale is in session it is working fine AND do 
format according to locale

Thanks in advance

-- 
*************************************
Best Regards
Ilja


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


Re: xwork-core-2.2.3.jar in Maven repository probably corrupt

Posted by Maurizio Cucchiara <mc...@apache.org>.
OK,
please let us know.
Maurizio Cucchiara

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


Re: xwork-core-2.2.3.jar in Maven repository probably corrupt

Posted by Chris Mawata <ch...@mathcove.net>.
I'll try that (deleting the jar) tomorrow.  Ihave to drive 100 miles to 
work this morning. Right now I have the manually downloaded one in the 
local m2 repository.
Cheers
Chris Mawata

On 9/7/2011 2:12 AM, Maurizio Cucchiara wrote:
> Have you already tryied to delete xwork jar under your M2 repository, such
> that maven tryies to download again the artifact on the next iteration?
>
> Maurizio Cucchiara
>
> Il giorno 07/set/2011 04.36, "Chris Mawata"<
> chris_mawata_struts@mathcove.net>  ha scritto:
> The xwork-core-2.2.3.jar we are getting via Maven seems to be corrupt.
>
> In my pom if I have
>
> <dependency>
>         <groupId>org.apache.struts</**groupId>
>         <artifactId>struts2-core</**artifactId>
>         <version>2.2.1</version>
> </dependency>
>
> I get no issues and the application runs.
>
> If I have
>
> <dependency>
>         <groupId>org.apache.struts</**groupId>
>         <artifactId>struts2-core</**artifactId>
>         <version>2.2.3</version>
> </dependency>
>
> it fails with
>
> ERROR] COMPILATION ERROR :
> [INFO] ------------------------------**------------------------------**-
> [ERROR] error: error reading C:\Documents and Settings\Administrator\.m2\**
> repository\org\apache\struts\**xwork\xwork-core\2.2.3\xwork-**core-2.2.3.jar;
> invalid LOC header (bad signature)
> [INFO] 1error
>
>
> If I replace the xwork-core-2.2.3.jar in my local repository with one I
> manually download from
> http://grepcode.com/snapshot/**repo1.maven.org/maven2/org.**
> apache.struts.xwork/xwork-**core/2.2.3<http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.2.3>
>
> then I get no errors and the application runs.
>
> BTW the jar that came down via Maven is 664 KB while the one I manually
> downloaded is 602 KB
>
> Cheers
> Chris Mawata
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: xwork-core-2.2.3.jar in Maven repository probably corrupt

Posted by Chris Mawata <ch...@mathcove.net>.
Thanks, Maurizio. That worked.
Cheers
Chris Mawata
On 9/7/2011 2:12 AM, Maurizio Cucchiara wrote:
> Have you already tryied to delete xwork jar under your M2 repository, such
> that maven tryies to download again the artifact on the next iteration?
>
> Maurizio Cucchiara
>
> Il giorno 07/set/2011 04.36, "Chris Mawata"<
> chris_mawata_struts@mathcove.net>  ha scritto:
> The xwork-core-2.2.3.jar we are getting via Maven seems to be corrupt.
>
> In my pom if I have
>
> <dependency>
>         <groupId>org.apache.struts</**groupId>
>         <artifactId>struts2-core</**artifactId>
>         <version>2.2.1</version>
> </dependency>
>
> I get no issues and the application runs.
>
> If I have
>
> <dependency>
>         <groupId>org.apache.struts</**groupId>
>         <artifactId>struts2-core</**artifactId>
>         <version>2.2.3</version>
> </dependency>
>
> it fails with
>
> ERROR] COMPILATION ERROR :
> [INFO] ------------------------------**------------------------------**-
> [ERROR] error: error reading C:\Documents and Settings\Administrator\.m2\**
> repository\org\apache\struts\**xwork\xwork-core\2.2.3\xwork-**core-2.2.3.jar;
> invalid LOC header (bad signature)
> [INFO] 1error
>
>
> If I replace the xwork-core-2.2.3.jar in my local repository with one I
> manually download from
> http://grepcode.com/snapshot/**repo1.maven.org/maven2/org.**
> apache.struts.xwork/xwork-**core/2.2.3<http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.2.3>
>
> then I get no errors and the application runs.
>
> BTW the jar that came down via Maven is 664 KB while the one I manually
> downloaded is 602 KB
>
> Cheers
> Chris Mawata
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.**apache.org<us...@struts.apache.org>
> For additional commands, e-mail: user-help@struts.apache.org
>


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


Re: xwork-core-2.2.3.jar in Maven repository probably corrupt

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Have you already tryied to delete xwork jar under your M2 repository, such
that maven tryies to download again the artifact on the next iteration?

Maurizio Cucchiara

Il giorno 07/set/2011 04.36, "Chris Mawata" <
chris_mawata_struts@mathcove.net> ha scritto:
The xwork-core-2.2.3.jar we are getting via Maven seems to be corrupt.

In my pom if I have

<dependency>
       <groupId>org.apache.struts</**groupId>
       <artifactId>struts2-core</**artifactId>
       <version>2.2.1</version>
</dependency>

I get no issues and the application runs.

If I have

<dependency>
       <groupId>org.apache.struts</**groupId>
       <artifactId>struts2-core</**artifactId>
       <version>2.2.3</version>
</dependency>

it fails with

ERROR] COMPILATION ERROR :
[INFO] ------------------------------**------------------------------**-
[ERROR] error: error reading C:\Documents and Settings\Administrator\.m2\**
repository\org\apache\struts\**xwork\xwork-core\2.2.3\xwork-**core-2.2.3.jar;
invalid LOC header (bad signature)
[INFO] 1error


If I replace the xwork-core-2.2.3.jar in my local repository with one I
manually download from
http://grepcode.com/snapshot/**repo1.maven.org/maven2/org.**
apache.struts.xwork/xwork-**core/2.2.3<http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.2.3>

then I get no errors and the application runs.

BTW the jar that came down via Maven is 664 KB while the one I manually
downloaded is 602 KB

Cheers
Chris Mawata


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

xwork-core-2.2.3.jar in Maven repository probably corrupt

Posted by Chris Mawata <ch...@mathcove.net>.
The xwork-core-2.2.3.jar we are getting via Maven seems to be corrupt.

In my pom if I have

<dependency>
	<groupId>org.apache.struts</groupId>
	<artifactId>struts2-core</artifactId>
	<version>2.2.1</version>
</dependency>
		
I get no issues and the application runs.

If I have

<dependency>
	<groupId>org.apache.struts</groupId>
	<artifactId>struts2-core</artifactId>
	<version>2.2.3</version>
</dependency>

it fails with

ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: error reading C:\Documents and Settings\Administrator\.m2\repository\org\apache\struts\xwork\xwork-core\2.2.3\xwork-core-2.2.3.jar; invalid LOC header (bad signature)
[INFO] 1error


If I replace the xwork-core-2.2.3.jar in my local repository with one I manually download from
http://grepcode.com/snapshot/repo1.maven.org/maven2/org.apache.struts.xwork/xwork-core/2.2.3

then I get no errors and the application runs.

BTW the jar that came down via Maven is 664 KB while the one I manually downloaded is 602 KB

Cheers
Chris Mawata


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


Re: bean:write formatKey tag

Posted by Dave Newton <da...@gmail.com>.
Man, I hope so, otherwise it's gonna be like five years past its delivery
date.

Dave

On Tue, Aug 30, 2011 at 7:48 AM, bvikas <bv...@live.com> wrote:

> Hello,
>
> Did you find a solution to the above problem? What is the solution? Did you
> have to use localeKey attribute or is the solution something different?
>
> Please post.
>
> Thanks
> Vikas
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/bean-write-formatKey-tag-tp3452029p4749744.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: bean:write formatKey tag

Posted by bvikas <bv...@live.com>.
Hello,

Did you find a solution to the above problem? What is the solution? Did you
have to use localeKey attribute or is the solution something different?

Please post.

Thanks
Vikas

--
View this message in context: http://struts.1045723.n5.nabble.com/bean-write-formatKey-tag-tp3452029p4749744.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: bean:write formatKey tag

Posted by "Ilja S." <il...@frontdesk.ee>.
And I was looking more on this question and seems that keypoint of this 
that when I use "format" property DecimalFormat applyPattern(String 
pattern) method is called, and when "formatKey" property is used then 
applyLocalizedPattern(String pattern) method is called.

So seems that in resource file pattern must be in a "localized 
notation". So I don't understand why struts developers used this method, 
while applyPattern(String pattern) is working just fine. With this 
method struts users don't have to have patterns in "localized notation" 
(btw where to find these notations for locales?). And therefore struts 
users can have one common for example "###,###.00" pattern in a resource 
file and all numbers will be correctly formatted to visitor's locale. 
That makes code more portable and you can do change in one file rather 
than changing in each jsp...


Ilja S. wrote:
> Hi
> Thanks for reply but I'm still confused
> What you mean "expected behavior"? In link to bugzilla you provided this 
> is considered as a bug and it says it is fixed in Struts 1.2 family.
> I'm using 1.2.9
> As I understood this tag should format according to current locale.
> All I want that numbers were formatted for users, and I don't want do 
> this in business layer or in ActionForm. And seems that "format" 
> property of <bean:write> is working correct while "formatKey" is not, 
> even if I have resource file for other non-"en" locale.
> 
> So if this is expected behavior and NOT a bug, how then use this tag?
> 
> Thanks in advance
> 
> Christopher Goldman wrote:
>> On Fri, 2006-09-22 at 17:30 +0300, Ilja S. wrote:
>>> Hello
>>> Could you please explain why i get "JspException: Wrong format 
>>> string: '###,###.00' " when I use <bean:write 
>>> formatKey="global.format"> when other then "EN" locale is in user's 
>>> session?
>>>
>>> At the same time if use "format" tag <bean:write format="###,###.00"> 
>>> then no matter what locale is in session it is working fine AND do 
>>> format according to locale
>>>
>>> Thanks in advance
>>
>> Ilja,
>>
>> Tere!
>>
>> This is the expected behavior.  I'm not sure what version of Struts
>> you're using, but you can check out the source for the (1.x)
>> <bean:write> tag here:
>>
>> http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/WriteTag.java?view=markup 
>>
>>
>> The relevant part is from lines 330 to 348 (indenting modified):
>>
>> if (formatString != null) {
>>   try {
>>     format = NumberFormat.getNumberInstance(locale);
>>
>>     if (formatStrFromResources) {
>>       ((DecimalFormat) format).applyLocalizedPattern(
>>         formatString);
>>     } else {
>>       ((DecimalFormat) format).applyPattern(formatString);
>>     }
>>   } catch (IllegalArgumentException e) {
>>     JspException ex =
>>       new JspException(messages.getMessage(
>>           "write.format", formatString));
>>
>>     TagUtils.getInstance().saveException(pageContext, ex);
>>     throw ex;
>>   }
>> }
>>
>> There seems to be some discussion of this in the Struts JIRA system:
>>
>> http://issues.apache.org/struts/browse/STR-1865?page=all
>>
>> See Ted Husted's comments.  Of course, he's talking about the date (not
>> number) formatting, but it only serves to highlight the distinction
>> between the handling of the two types.  Note that if you look at the
>> code immediately following what is quoted here, you'll see that the
>> SimpleDateFormat constructor is *always* passed the locale.
>>
>> I found all this stuff by Googling various combinations of "WriteTag",
>> ".applyLocalizedPattern", and "IllegalArgumentException"
>>
>> Hea õnn!
>>
>> Chris
>>
> 
> 


-- 
*************************************
Best Regards
Ilja


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


Re: bean:write formatKey tag

Posted by "Ilja S." <il...@frontdesk.ee>.
Hi
Thanks for reply but I'm still confused
What you mean "expected behavior"? In link to bugzilla you provided this 
is considered as a bug and it says it is fixed in Struts 1.2 family.
I'm using 1.2.9
As I understood this tag should format according to current locale.
All I want that numbers were formatted for users, and I don't want do 
this in business layer or in ActionForm. And seems that "format" 
property of <bean:write> is working correct while "formatKey" is not, 
even if I have resource file for other non-"en" locale.

So if this is expected behavior and NOT a bug, how then use this tag?

Thanks in advance

Christopher Goldman wrote:
> On Fri, 2006-09-22 at 17:30 +0300, Ilja S. wrote:
>> Hello
>> Could you please explain why i get "JspException: Wrong format string: 
>> '###,###.00' " when I use <bean:write formatKey="global.format"> when 
>> other then "EN" locale is in user's session?
>>
>> At the same time if use "format" tag <bean:write format="###,###.00"> 
>> then no matter what locale is in session it is working fine AND do 
>> format according to locale
>>
>> Thanks in advance
> 
> Ilja,
> 
> Tere!
> 
> This is the expected behavior.  I'm not sure what version of Struts
> you're using, but you can check out the source for the (1.x)
> <bean:write> tag here:
> 
> http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/WriteTag.java?view=markup
> 
> The relevant part is from lines 330 to 348 (indenting modified):
> 
> if (formatString != null) {
>   try {
>     format = NumberFormat.getNumberInstance(locale);
> 
>     if (formatStrFromResources) {
>       ((DecimalFormat) format).applyLocalizedPattern(
>         formatString);
>     } else {
>       ((DecimalFormat) format).applyPattern(formatString);
>     }
>   } catch (IllegalArgumentException e) {
>     JspException ex =
>       new JspException(messages.getMessage(
>           "write.format", formatString));
> 
>     TagUtils.getInstance().saveException(pageContext, ex);
>     throw ex;
>   }
> }
> 
> There seems to be some discussion of this in the Struts JIRA system:
> 
> http://issues.apache.org/struts/browse/STR-1865?page=all
> 
> See Ted Husted's comments.  Of course, he's talking about the date (not
> number) formatting, but it only serves to highlight the distinction
> between the handling of the two types.  Note that if you look at the
> code immediately following what is quoted here, you'll see that the
> SimpleDateFormat constructor is *always* passed the locale.
> 
> I found all this stuff by Googling various combinations of "WriteTag",
> ".applyLocalizedPattern", and "IllegalArgumentException"
> 
> Hea õnn!
> 
> Chris
> 


-- 
*************************************
Best Regards
Ilja


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


Re: bean:write formatKey tag

Posted by Christopher Goldman <cg...@dhapdigital.com>.
On Fri, 2006-09-22 at 17:30 +0300, Ilja S. wrote:
> Hello
> Could you please explain why i get "JspException: Wrong format string: 
> '###,###.00' " when I use <bean:write formatKey="global.format"> when 
> other then "EN" locale is in user's session?
> 
> At the same time if use "format" tag <bean:write format="###,###.00"> 
> then no matter what locale is in session it is working fine AND do 
> format according to locale
> 
> Thanks in advance

Ilja,

Tere!

This is the expected behavior.  I'm not sure what version of Struts
you're using, but you can check out the source for the (1.x)
<bean:write> tag here:

http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/WriteTag.java?view=markup

The relevant part is from lines 330 to 348 (indenting modified):

if (formatString != null) {
  try {
    format = NumberFormat.getNumberInstance(locale);

    if (formatStrFromResources) {
      ((DecimalFormat) format).applyLocalizedPattern(
        formatString);
    } else {
      ((DecimalFormat) format).applyPattern(formatString);
    }
  } catch (IllegalArgumentException e) {
    JspException ex =
      new JspException(messages.getMessage(
          "write.format", formatString));

    TagUtils.getInstance().saveException(pageContext, ex);
    throw ex;
  }
}

There seems to be some discussion of this in the Struts JIRA system:

http://issues.apache.org/struts/browse/STR-1865?page=all

See Ted Husted's comments.  Of course, he's talking about the date (not
number) formatting, but it only serves to highlight the distinction
between the handling of the two types.  Note that if you look at the
code immediately following what is quoted here, you'll see that the
SimpleDateFormat constructor is *always* passed the locale.

I found all this stuff by Googling various combinations of "WriteTag",
".applyLocalizedPattern", and "IllegalArgumentException"

Hea õnn!

Chris

-- 
Christopher D. Goldman
cgoldman@dhapdigital.com
415.962.4884


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


Re: bean:write formatKey tag

Posted by Chris Pratt <th...@gmail.com>.
I'm just guessing but is global.format missing from your other
ApplicationResource files?  Maybe it's trying to tell you it couldn't find
the right format string for the users browser, not that the string itself is
invalid.
  (*Chris*)

On 9/22/06, Ilja S. <il...@frontdesk.ee> wrote:
>
> Hello
> Could you please explain why i get "JspException: Wrong format string:
> '###,###.00' " when I use <bean:write formatKey="global.format"> when
> other then "EN" locale is in user's session?
>
> At the same time if use "format" tag <bean:write format="###,###.00">
> then no matter what locale is in session it is working fine AND do
> format according to locale
>
> Thanks in advance
>
> --
> *************************************
> Best Regards
> Ilja
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

pass parameter between actions

Posted by Tony Smith <qu...@yahoo.com>.
Hi, 

I have to actions, action1 and action2, 

<action
    path="/action1"
    type="JavaCodeAction1"
    name="action1Form"
    scope="request"
    validate="true">
    <forward name="success" path="action1"/>
    <forward name="default" path="/home.do"/>
</action>           
         

<action
    path="/action2"
    type="JavaCodeAction2"
    name="action2Form"
    scope="request"
    validate="true">
    <forward name="success" path="something"/>
    <forward name="default" path="/home.do"/>
</action>

Inside action1, 

    protected ActionForward execute(
         ActionMapping mapping, 
         ActionForm form,
         HttpServletRequest request,        
         HttpServletResponse respose)
            throws Exception {
  
	 String id = 100; //or other number
         ....

    }

Once action1 is successful, I would like to call
action2 with the link action2.do?id=100. However, I do
not know how to pass the parameter "id" to action2. 

Could anyone help?

Thanks,

qq


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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