You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn> on 2012/06/15 11:17:51 UTC

How to display 2 textfield while still being to use XML validation

Hi,
I’m new at struts2. I am having a problem that I want to use 2 text field in one line. But when I wrap them in a <table> tag, the validation messages is displayed wrong. When I use the simple theme, the validation wouldn’t work?
So, anyone have solution for that, please ? ☹
Sorry for my bad English

Thanks & best regards,

Nguyễn NGỌC HẢi (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn<ma...@fsoft.com.vn>
Cell: 0169.808.9435







Re: How to display 2 textfield while still being to use XML validation

Posted by Dave Newton <da...@gmail.com>.
On Mon, Jun 18, 2012 at 6:07 AM, Nguyen Ngoc Hai (FSU17.BU2) <
HaiNN3@fsoft.com.vn> wrote:

> I use Struts2 Spring Plugin 2.1.6.
>

You're using Struts 2.1.6 as well?

This makes no sense; that attribute works fine in Spring 3.0.

Probably not related, but I sure wouldn't use an old milestone release of
Spring 3.0; current Spring 3.0 is 3.0.7. Spring 3.0.0 M3 was released in
2009.

Dave

Re: How to display 2 textfield while still being to use XML validation

Posted by Dave Newton <da...@gmail.com>.
(I keep looking for the up-arrow so I can upvote mailing list answers.)

On Mon, Jun 18, 2012 at 6:41 AM, Łukasz Lenart <lukasz.lenart@googlemail.com
> wrote:

> 2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> > I use Struts2 Spring Plugin 2.1.6.
>
> That version was designed to run with Spring 2.5.3 and as specified in
> docs [1] it must work, maybe you're messing different versions of
> Spring libs ?
>
> [1]
> http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes
>
>
> Regards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> I use Struts2 Spring Plugin 2.1.6.

That version was designed to run with Spring 2.5.3 and as specified in
docs [1] it must work, maybe you're messing different versions of
Spring libs ?

[1] http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


RE: How to display 2 textfield while still being to use XML validation

Posted by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn>.
I use Struts2 Spring Plugin 2.1.6. 

Thanks & best regards,

NGUYễN NGỌC HẢI (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn
Cell: 0169.808.9435


IMPORTANT NOTICE
The information in this e-mail and any attached files is CONFIDENTIAL and may be legally privileged or prohibited from disclosure and unauthorized use. The views of the author may not necessarily reflect those of the Company. It is intended solely for the addressee, or the employee or agent responsible for delivering such materials to the addressee. If you have received this message in error please return it to the sender then delete the email and destroy any copies of it. If you are not the intended recipient, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication or any action taken or omitted to be taken in reliance upon this message or its attachments is prohibited and may be unlawful. At present the integrity of e-mail across the Internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a result of the use of this medium to transmit information by or to the FPT Software JSC 


-----Original Message-----
From: Łukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: Monday, June 18, 2012 4:22 PM
To: Struts Users Mailing List
Subject: Re: How to display 2 textfield while still being to use XML validation

Are you using Struts2 Spring Plugin ?

http://struts.apache.org/2.x/docs/spring-plugin.html


Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/ Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
Are you using Struts2 Spring Plugin ?

http://struts.apache.org/2.x/docs/spring-plugin.html


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


RE: How to display 2 textfield while still being to use XML validation

Posted by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn>.
When I added scope in eclipse, it said that "attribute scope must be declared for element bean", when I built ignoring this message, I got a 404 Not Found.
This is kind of confusing, because I have read several example and they run scope well.

Thanks & best regards,

NGUYễN NGỌC HẢI (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn
Cell: 0169.808.9435




-----Original Message-----
From: Łukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: 2012年6月18日 15:00
To: Struts Users Mailing List
Subject: Re: How to display 2 textfield while still being to use XML validation

2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> I use Spring Framework 3.0 M3

hmm... scope="prototype" should work, what kind of exception do you get ?


Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/ Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@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: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> I use Spring Framework 3.0 M3

hmm... scope="prototype" should work, what kind of exception do you get ?


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


RE: How to display 2 textfield while still being to use XML validation

Posted by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn>.
I use Spring Framework 3.0 M3

Thanks & best regards,

NGUYễN NGỌC HẢI (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn
Cell: 0169.808.9435



-----Original Message-----
From: Łukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: Monday, June 18, 2012 1:35 PM
To: Struts Users Mailing List
Subject: Re: How to display 2 textfield while still being to use XML validation

2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> Yes I am using Spring and also Hibernate.
> I am so sorry for replying late. I am using my company's email that I can't check at home.
> Could you show me where I can add scope="prototype", I added it into my applicationContext.xml, but it would not run.
>
> <bean id="demo" class="action.demo" scope="prototype"> </bean>

Which version of Spring ?


Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/ Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/6/18 Nguyen Ngoc Hai (FSU17.BU2) <Ha...@fsoft.com.vn>:
> Yes I am using Spring and also Hibernate.
> I am so sorry for replying late. I am using my company's email that I can't check at home.
> Could you show me where I can add scope="prototype", I added it into my applicationContext.xml, but it would not run.
>
> <bean id="demo" class="action.demo" scope="prototype">
> </bean>

Which version of Spring ?


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


RE: How to display 2 textfield while still being to use XML validation

Posted by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn>.
Yes I am using Spring and also Hibernate.
I am so sorry for replying late. I am using my company's email that I can't check at home.
Could you show me where I can add scope="prototype", I added it into my applicationContext.xml, but it would not run.

<bean id="demo" class="action.demo" scope="prototype">
</bean>

Thanks & best regards,

NGUYễN NGỌC HẢI (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn
Cell: 0169.808.9435




-----Original Message-----
From: Łukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: Friday, June 15, 2012 6:02 PM
To: Struts Users Mailing List
Subject: Re: How to display 2 textfield while still being to use XML validation

Do you use Spring ? If so, action must have scope="prototype"


Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/ Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@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: How to display 2 textfield while still being to use XML validation

Posted by Paul Mefford <pa...@gmail.com>.
I found the default themes not full featured enough to use out of the box.
My recommendation is write your own theme using xhtml as a starting point.
If you don't want to do that use the xhtml theme as it is the most complete
with it you get limited ability to design a nice form because of all the
table elements that come with it.



On Fri, Jun 15, 2012 at 5:02 AM, Łukasz Lenart <lukasz.lenart@googlemail.com
> wrote:

> Do you use Spring ? If so, action must have scope="prototype"
>
>
> Regards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
Do you use Spring ? If so, action must have scope="prototype"


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


RE: How to display 2 textfield while still being to use XML validation

Posted by "Nguyen Ngoc Hai (FSU17.BU2)" <Ha...@fsoft.com.vn>.
Thank you very much, it helps so much on validation and format issues.
But when I use the simple theme, the validation display multiple times as long as I continue to trigger the validation.
Ex: 1rst time I submit form, it return:

[field1] 
*must not be null

But when I tried to trigger a again by pressing submit, it return

[field1] 
*must not be null
*must not be null

Do you have any idea for this?

Thanks & best regards,

NGUYễN NGỌC HẢI (MR.)
Developer
Business Unit No2

FPT  Software Strategic Unit No.17
Add: 8th Floor, FPT Building, Pham Hung Road, Cau Giay Dist, Hanoi, Vietnam
E-mail: hainn3@fsoft.com.vn
Cell: 0169.808.9435




-----Original Message-----
From: Łukasz Lenart [mailto:lukasz.lenart@googlemail.com] 
Sent: Friday, June 15, 2012 4:22 PM
To: Struts Users Mailing List
Subject: Re: How to display 2 textfield while still being to use XML validation

Use simple theme and add <s:actionerror/> tag to display validation messages or <s:fielderror/> per each field

http://struts.apache.org/2.x/docs/actionerror.html
http://struts.apache.org/2.x/docs/fielderror.html


Regards
--
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/ Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: How to display 2 textfield while still being to use XML validation

Posted by Łukasz Lenart <lu...@googlemail.com>.
Use simple theme and add <s:actionerror/> tag to display validation
messages or <s:fielderror/> per each field

http://struts.apache.org/2.x/docs/actionerror.html
http://struts.apache.org/2.x/docs/fielderror.html


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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