Strange behaviour on i18n

2010-07-10 Thread Franz Wong
Hi,

I have an i18n web site with struts 2. I don't know why the i18n text is not
loaded properly. I expect "檢索詞不能空白" (Chinese characters), but it turns out
"檢索詞不不能空白". But if I make any change on the html (e.g. the order of
attributes or remove some elements), the text is loaded without any problem.

Thanks.
Franz

Problem html code :

"
onClick="searchButtonClick('');"/>

(HTML : )

However, the following html code works fine.

');" value=""/>

(HTML : )

Properties file :

search.searchMethod=檢索方法
search.searchMethod.Title=書名
search.searchMethod.Author=著者
search.searchMethod.Subject=主題
search.searchMethod.Series=叢書
search.searchMethod.TitleKeyword=書名關鍵詞
search.searchMethod.AuthorKeyword=著者關鍵詞
search.searchMethod.SubjectKeyword=主題關鍵詞
search.searchTerm=檢索詞
search.searchTermCannotBeEmpty=檢索詞不能空白
search=檢索

Here is the whole jsp file.

<%...@taglib prefix="s" uri="/struts-tags" %>









" onFocus="searchTermOnFocus(this,
'');" onBlur="searchTermOnBlur(this,
'');"/>
"
onClick="searchButtonClick('');"/>



RE: validation and form display problem

2010-07-10 Thread Martin Gainty

you could use the org.apache.struts2.config_browser.ShowValidatorAction

then use java.beans.Introspector to acquire the bean from Validator.class

 

try 

{ 

java.beans.BeanInfo beanInfoFrom = 
java.beans.Introspector.getBeanInfo(validator.getClass(), Object.class);

} 

catch (IntrospectionException e) 

{

LOG.error("An error occurred", e);

addActionError("An error occurred while introspecting a validator of type " + 
validator.getClass().getName());

return ERROR;

}


//make sure you get back non null validator from getSelectedValidator() accessor

public com.opensymphony.xwork2.validator.Validator

 getSelectedValidator() {

return (com.opensymphony.xwork2.validator.Validator) validators.get(selected);

}


Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

> Date: Sat, 10 Jul 2010 18:10:32 -0400
> Subject: validation and form display problem
> From: vangj...@googlemail.com
> To: user@struts.apache.org
> 
> i have a form that i display. but to display that form, i have to
> fetch some data from the database and then place that data on the
> valuestack (via backing beans). when the form is displayed, it expects
> that those backing beans should be populated. the form then posts to a
> save action.
> 
> i have a --validation.xml that validates the form
> values. i have specified that if the result is "input" then go back to
> the form. the problem is that when the result is "input" and the
> form/page is reloaded, the beans are no longer populated and the form
> displays as blank.
> 
> is there a way to intercept or is there a hook that i can grab to have
> an opportunity to populate my backing beans?
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

RE: OutOfMemoryError: PermGen space!!!! Dont know why?

2010-07-10 Thread Martin Gainty

sounds as if class and method objects could possibly be missed by GC..try this 
for running under Jboss using Sun JVM (bin/run.conf) settings

 

-Xms128m 

-Xmx512m

-Dsun.rmi.dgc.client.gcInterval=360

-Dsun.rmi.dgc.server.gcInterval=360

-XX:+UseConcMarkSweepGC

-XX:+CMSPermGenSweepingEnabled

-XX:+CMSClassUnloadingEnabled

-XX:MaxPermSize=512m
-Xverify:none

 

of course these settings would be different for IBM JVM
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

> From: vikram.g.by...@accenture.com
> To: user@struts.apache.org
> Date: Fri, 9 Jul 2010 13:21:03 +0530
> Subject: RE: OutOfMemoryError: PermGen space Dont know why?
> 
> -XX:PermSize=64M -XX:MaxPermSize=128M, these parameters define
> "PermGenSpace", this is where all class files are loaded. 
> 
> Check out your Heap memory size. The PermGenSpace should be 1/4th of your
> allocated Heap memory. 
> 
> 
> 
> Best Regards,
> 
> Vikram
> -Original Message-
> From: Brian Thompson [mailto:elephant...@gmail.com] 
> Sent: Friday, July 09, 2010 1:14 PM
> To: Struts Users Mailing List
> Subject: Re: OutOfMemoryError: PermGen space Dont know why?
> 
> You could also adjust your eclipse.ini to give more memory to the JVM:
> 
> -XX:PermSize=64M -XX:MaxPermSize=128M
> 
> Add it to the --vmargs section of the file.
> 
> -Brian
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
  
_
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

RE: Struts2+Hinerneta Validator+Spring

2010-07-10 Thread Martin Gainty


basicStackHibernate: Like Struts2 basickStack (NO validations here!), but with 
Hibernate Core session and transaction injections capability.

defaultStackHibernate: Like Struts2 defaultStack, but DO NOT USE Struts2 
validation methods (annotation and XML). Uses Hibernate Validation framework 
instead.

defaultStackHibernateStrutsValidation: Struts2 defaultStack + plugin 
basicStackHibernate. 
 
The Hibernate Validator on google has the necessary information you need with 
working configurations and sample code

http://code.google.com/p/full-hibernate-plugin-for-struts2/wiki/2_Hibernate_Validator_integration


SPRING Specific:

JBoss has a good tutorial for intergrating 
org.springframework.orm.hibernate3.LocalSessionFactoryBean to map preUpdate and 
preInsert events

   
   

http://community.jboss.org/wiki/HibernateValidatorandSpring

you will need to configure in the dataSource

 

Viel Gluck,
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.



 

> Date: Sat, 10 Jul 2010 08:43:31 -0700
> From: afatt...@yahoo.com
> Subject: Struts2+Hinerneta Validator+Spring
> To: user@struts.apache.org
> 
> Hi,
> 
> I want to use hibernate validation with struts and spring. I found the  "Full 
> Hibernate Plugin" which combines the struts 2 and hibernate and hibernate 
> validation. 
> It has its own API for using the hibernate, but it does not use the Spring. 
> However, I want to use is!
> So:
> 1- Can I use "Full Hibernate Plugin",  "Hibernate Validation" feature only. 
> 2- If not, are there any other frameworks which helps us with that.
> 3- I found a method described in 
> http://vamshisomanchi.wordpress.com/2008/07/26/struts-20-hibernate-validator/ 
> any other simpler way
> 
> ~Regards,
> ~~Alireza Fattahi
> 
> 
> 
  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

Re: Currency Formatting

2010-07-10 Thread Chris Pratt
Define something like:

format.currency={0,number,currency}

In your applications.properties file, then use:



HTH
  (*Chris*)

On Sat, Jul 10, 2010 at 5:53 AM, Chris Miles  wrote:

> Hi
>
> If I am displaying a Double to a JSP page what is the recommended way to
> format this is as a currency to two decimal points?
>
> Thanks
>
> Chris


validation and form display problem

2010-07-10 Thread Jake Vang
i have a form that i display. but to display that form, i have to
fetch some data from the database and then place that data on the
valuestack (via backing beans). when the form is displayed, it expects
that those backing beans should be populated. the form then posts to a
save action.

i have a --validation.xml that validates the form
values. i have specified that if the result is "input" then go back to
the form. the problem is that when the result is "input" and the
form/page is reloaded, the beans are no longer populated and the form
displays as blank.

is there a way to intercept or is there a hook that i can grab to have
an opportunity to populate my backing beans?

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



Struts2+Hinerneta Validator+Spring

2010-07-10 Thread Alireza Fattahi
Hi,

I want to use hibernate validation with struts and spring. I found the  "Full 
Hibernate Plugin" which combines the struts 2 and hibernate and hibernate 
validation. 
It has its own API for using the hibernate, but it does not use the Spring. 
However, I want to use is!
So:
1- Can I use "Full Hibernate Plugin",  "Hibernate Validation" feature only. 
2- If not, are there any other frameworks which helps us with that.
3- I found a method described in 
http://vamshisomanchi.wordpress.com/2008/07/26/struts-20-hibernate-validator/ 
any other simpler way

~Regards,
~~Alireza Fattahi


  

Currency Formatting

2010-07-10 Thread Chris Miles
Hi

If I am displaying a Double to a JSP page what is the recommended way to format 
this is as a currency to two decimal points?

Thanks

Chris

Re: hi please help me struts2

2010-07-10 Thread Salish S
thanks for the reply
so by using the struts 2.1.8 jar files from apache the validation by giving
he validation="true" has to worked
for that i asked

on using hibernate the hibernate will make the class by anotation and for
the validation also we has to do the same how can i make a crud with
hibernate as model jsp as view struts2 as controller.
in the struts2 is that the interceptor is excluded for the validation to
remove for inpit and how


On Fri, Jul 9, 2010 at 6:19 PM, Brian Thompson wrote:

> For client-side validation:  Just write a javascript function and have
> it run for either the onclick event of the form submit button or the
> onsubmit event for the form itself.
>
> For "Hibernate by property file", I'm not sure what you mean.  I've
> always used either hibernate.cfg.xml files or annotations in the model
> classes.  Could you post an example of what you're trying to do?
>
> -Brian
>
>
>
> On Fri, Jul 9, 2010 at 7:39 AM, Salish S  wrote:
> > -- Forwarded message --
> > From: Salish S 
> > Date: Fri, Jul 9, 2010 at 6:07 PM
> > Subject: hi please help me struts2
> > To: "es...@vaannila.com" 
> >
> >
> > Hi
> > i had gone through the struts2 crud in the
> >
> http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html
> >
> > its fine and goog pgm for me
> > but the problem came when i want to add client side validation how i add
> > clientside validation
> > i had gone though the hibernate validation also its also fine
> >
> http://www.vaannila.com/struts-2/struts-2-tutorial/struts-2-hibernate-validation-tutorial-1.html
> >
> > is that clientside validation is doing therer
> > and very important is that
> > How can i use hibernate by property file not that by the
> hibernate.cfg.xml
> > file to connectt to db in the same example
> >
> > please help me
> > thenkuse
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Struts2 remote commands execution

2010-07-10 Thread Lukasz Lenart
2010/7/10 Meder Kydyraliev :
> There's a critical remote commands execution vulnerability in XWork(used by
> Struts2), which fixed in 2.2.0, which isn't released yet but can be
> downloaded here: http://people.apache.org/builds/struts/2.2.0/
>
> More details about this vulnerability can be found here:
> http://blog.o0o.nu/2010/07/cve-2010-1870-struts2xwork-remote.html

Thanks, I put your blog for reference in Struts 2.2.0 Notes [1]

[1] https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.2.0


Kind regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl

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



Struts2 remote commands execution

2010-07-10 Thread Meder Kydyraliev
There's a critical remote commands execution vulnerability in XWork(used by
Struts2), which fixed in 2.2.0, which isn't released yet but can be
downloaded here: http://people.apache.org/builds/struts/2.2.0/

More details about this vulnerability can be found here:
http://blog.o0o.nu/2010/07/cve-2010-1870-struts2xwork-remote.html

Meder