Re: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread Guillaume Carré

2007/3/12, [EMAIL PROTECTED] [EMAIL PROTECTED]:

Seems you cannot have a s:div tag
in a s:form tag because the generated HTML is not well-formed.


Have you tried s:form theme=simple.../s:form?
With the simple theme, you're in control of the generated HTML, it
doesn't generate tables.

--
Guillaume Carré

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



suggest a filename to a generated pdf

2007-03-12 Thread Zmitko, Jan
Hi,

I try do suggest a filename to the generated pdf´s. However the PDF should be 
display automaticly this meand without some further action of the user. 

This HTTP Header Information works

response.setHeader(Content-Disposition, attachment; filename= + fileName);

and this does not works

response.setHeader(Content-Disposition, inline; filename= + fileName);

Is the comibination of the values inline and filename not possible?

Thanks for any Ideas,

Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
Hi 

I have a form in which a Date is displayed, using fmt.  It's static text, so no 
user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that 
form, but you're redirected to the error page.

This is the error:
2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate

javax.servlet.ServletException: BeanUtils.populate

The form bean exists of a field, which is hidden, of the type java.util.Date.  
This is filled by the action, with the correct date.  When I look at the source 
of the page, the date is actually filled in, so that's not the problem.

I assume there's a problem with assigning the java.util.Date-type to a field in 
a DynaValidatorForm, but I'm not sure that's what causing the problem.  There's 
also no validation on that field.

Struts-config:
form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
form-property name=txtTokenStatus type=java.util.Date /
/form-bean

Does anybody know how to have a Date-field in your form, in a way you can 
assign it to a textfield and make sure you can also pass it to fmt:formatDate.

Tia

Grtz

Bjorn



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


Re: suggest a filename to a generated pdf

2007-03-12 Thread Mike Baroukh


don't know if it might help ...

attachment is used to open the pdf in the viewer, not in the browser window
inline is used to see it in the browser window. But I noticed it doesn't 
work on all plateforms.


for attachment, I use the folowing code :

// To enable IE Cache
response.setHeader(Pragma, ); // in case it wat defined elsewhere
response.setHeader(Cache-Control, ); // in case it was defined elsewhere
Calendar c = Calendar.getInstance();
c.add(Calendar.SECOND, 15);
response.setHeader(Expires, c.getTime().toString());

response.setContentLength(bytes.length);
response.setHeader(Content-Disposition, attachment; 
filename=\myname.pdf\);



Mike

Zmitko, Jan a écrit :

Hi,

I try do suggest a filename to the generated pdf´s. However the PDF should be display automaticly this meand without some further action of the user. 


This HTTP Header Information works

response.setHeader(Content-Disposition, attachment; filename= + fileName);

and this does not works

response.setHeader(Content-Disposition, inline; filename= + fileName);

Is the comibination of the values inline and filename not possible?

Thanks for any Ideas,

Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
Ok, I did some tests and debugging and this is the result:

The errormsg is Cannot assign value of type 'java.lang.String' to property 
'txtFieldName' of type 'java.util.Date'.

I fill that field with following code: modifyForm.set(txtFieldName,new 
Date());

So the object I'm assigning to that field is a Date-object, but for some reason 
it is converted to a String.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 9:40
To: user@struts.apache.org
Subject: DynaValidatorForm with java.util.Date

Hi 

I have a form in which a Date is displayed, using fmt.  It's static text, so no 
user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that 
form, but you're redirected to the error page.

This is the error:
2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate

javax.servlet.ServletException: BeanUtils.populate

The form bean exists of a field, which is hidden, of the type java.util.Date.  
This is filled by the action, with the correct date.  When I look at the source 
of the page, the date is actually filled in, so that's not the problem.

I assume there's a problem with assigning the java.util.Date-type to a field in 
a DynaValidatorForm, but I'm not sure that's what causing the problem.  There's 
also no validation on that field.

Struts-config:
form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
form-property name=txtTokenStatus type=java.util.Date /
/form-bean

Does anybody know how to have a Date-field in your form, in a way you can 
assign it to a textfield and make sure you can also pass it to fmt:formatDate.

Tia

Grtz

Bjorn



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Print property of a property using bean:write?

2007-03-12 Thread Laurie Harper

David Alves wrote:

Hi all,

I have a User object which has a Country object attached to it, 
representing the country that the user is from. If I do


bean:write name=user property=country /

then I get the output of Country.toString(). However, say I want to call 
one of the other methods in country, like population. Is there an 
elegant way to do this? Something like


bean:write name=user property=country.population /

where it would be translated behind-the-scenes into 
user.getCountry().getPopulation() If there's a way to do this with 
Struts Beans or if there's another tag library that would do it, I'd 
appreciate it if you could point me in the right direction. I want to 
avoid the use of % % if possible. Thanks for your time!


Without thinking about it very much, I would expect that one or other of 
these would work:


  bean:write name=user property=country.population /
  bean:write name=user.country property=population /

but failing that, JSTL would probably be the better choice:

  ${user.country.population}

No muss, no fuss. If you aren't familiar with JSTL, take an hour to 
learn it.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Re: Print property of a property using bean:write?

2007-03-12 Thread Raghupathy, Gurumoorthy
How about Struts nested tag library? If you want to use struts taglibs
only ...

Regards
Guru
 

---
Gurumoorthy Raghupathy
Email  :  [EMAIL PROTECTED]
Internal Extn : 2337 
External Phone  : 01483712337 
Nielsen Book
3rd Floor Midas House
62 Goldsworth Road
Woking Surrey GU21 6LQ
Visit us at  : http://www.nielsenbookdata.co.uk/ 

---

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: 12 March 2007 10:33
To: user@struts.apache.org
Subject: Re: Print property of a property using bean:write?

David Alves wrote:
 Hi all,
 
 I have a User object which has a Country object attached to it, 
 representing the country that the user is from. If I do
 
 bean:write name=user property=country /
 
 then I get the output of Country.toString(). However, say I want to
call 
 one of the other methods in country, like population. Is there an 
 elegant way to do this? Something like
 
 bean:write name=user property=country.population /
 
 where it would be translated behind-the-scenes into 
 user.getCountry().getPopulation() If there's a way to do this with 
 Struts Beans or if there's another tag library that would do it, I'd 
 appreciate it if you could point me in the right direction. I want to 
 avoid the use of % % if possible. Thanks for your time!

Without thinking about it very much, I would expect that one or other of

these would work:

   bean:write name=user property=country.population /
   bean:write name=user.country property=population /

but failing that, JSTL would probably be the better choice:

   ${user.country.population}

No muss, no fuss. If you aren't familiar with JSTL, take an hour to 
learn it.

L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
And the 3rd mail.  Is it possible to use an object that's different from 
java.lang.* as type for the dynavalidatorform?  I think that's what causing the 
issue here.  If it's not possible, then I'm in deep  :)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 10:26
To: user@struts.apache.org
Subject: RE: DynaValidatorForm with java.util.Date

Ok, I did some tests and debugging and this is the result:

The errormsg is Cannot assign value of type 'java.lang.String' to property 
'txtFieldName' of type 'java.util.Date'.

I fill that field with following code: modifyForm.set(txtFieldName,new 
Date());

So the object I'm assigning to that field is a Date-object, but for some reason 
it is converted to a String.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 9:40
To: user@struts.apache.org
Subject: DynaValidatorForm with java.util.Date

Hi 

I have a form in which a Date is displayed, using fmt.  It's static text, so no 
user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that 
form, but you're redirected to the error page.

This is the error:
2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate

javax.servlet.ServletException: BeanUtils.populate

The form bean exists of a field, which is hidden, of the type java.util.Date.  
This is filled by the action, with the correct date.  When I look at the source 
of the page, the date is actually filled in, so that's not the problem.

I assume there's a problem with assigning the java.util.Date-type to a field in 
a DynaValidatorForm, but I'm not sure that's what causing the problem.  There's 
also no validation on that field.

Struts-config:
form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
form-property name=txtTokenStatus type=java.util.Date /
/form-bean

Does anybody know how to have a Date-field in your form, in a way you can 
assign it to a textfield and make sure you can also pass it to fmt:formatDate.

Tia

Grtz

Bjorn



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] guice plugin - ROCKS!

2007-03-12 Thread Ron Chan

Guice is used as the internal IOC within struts2 but that is recommended for
use in applications
But there is now a plugin which will use an external version of guice to do
your depency injection

http://docs.google.com/Doc?id=dd2fhx4z_5df5hw8

I just converted a mini app over the weekend from using spring to guice and
first impressions is that it ROCKS!

Using the same set of managers and daos,  
- the app now starts up twice as fast
- using mvn jetty:run, recompiling and restarting the app no longer give me
memory problems
- I loose all the application-*.xml files and together with codebehind and
zero conf the number of xml files are drastically reduced

SWEET


-- 
View this message in context: 
http://www.nabble.com/-S2--guice-plugin---ROCKS%21-tf3388853.html#a9432699
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: s2] Is this a sensible way of doing in-line editing in a table?

2007-03-12 Thread Roger Varley

Following on from this, could anyone point me towards a
tutorial/example code on how to deal with an indexed edit technique
when I also need to use paging. For example, I have to do a similair
thing to the OP however I am restricted to editing 10 lines per page.
This would be easy if I could pass start and end values to the
s:iterator tag from my action class, but I can't see how to do that.
The only other way I can see to do this is to have both a full list of
line items and a smaller current page list that are maintained in my
action class.

Regards

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DynaValidatorForm with java.util.Date

2007-03-12 Thread Hubert Rabago

The fields of action forms, including DynaValidatorForms are populated
from request parameters, and these values are all in String variables.
I suggest using a String variable for the dyna validator form field
as well, and just parsing it to get the java.util.Date equivalent when
you use it in your Action classes.

Hubert

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

And the 3rd mail.  Is it possible to use an object that's different from 
java.lang.* as type for the dynavalidatorform?  I think that's what causing the 
issue here.  If it's not possible, then I'm in deep  :)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 10:26
To: user@struts.apache.org
Subject: RE: DynaValidatorForm with java.util.Date

Ok, I did some tests and debugging and this is the result:

The errormsg is Cannot assign value of type 'java.lang.String' to property 
'txtFieldName' of type 'java.util.Date'.

I fill that field with following code: modifyForm.set(txtFieldName,new 
Date());

So the object I'm assigning to that field is a Date-object, but for some reason 
it is converted to a String.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 9:40
To: user@struts.apache.org
Subject: DynaValidatorForm with java.util.Date

Hi

I have a form in which a Date is displayed, using fmt.  It's static text, so no 
user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that 
form, but you're redirected to the error page.

This is the error:
2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate

javax.servlet.ServletException: BeanUtils.populate

The form bean exists of a field, which is hidden, of the type java.util.Date.  
This is filled by the action, with the correct date.  When I look at the source 
of the page, the date is actually filled in, so that's not the problem.

I assume there's a problem with assigning the java.util.Date-type to a field in 
a DynaValidatorForm, but I'm not sure that's what causing the problem.  There's 
also no validation on that field.

Struts-config:
form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
form-property name=txtTokenStatus type=java.util.Date /
/form-bean

Does anybody know how to have a Date-field in your form, in a way you can 
assign it to a textfield and make sure you can also pass it to fmt:formatDate.

Tia

Grtz

Bjorn




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
Why does sql.Date work?  And the apache-site states that it's actually possible 
to use for instance java.util.ArrayList.  How do you do that? 
http://struts.apache.org/1.3.5/userGuide/building_controller.html, see section 
4.3.1.

-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 14:06
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

The fields of action forms, including DynaValidatorForms are populated
from request parameters, and these values are all in String variables.
 I suggest using a String variable for the dyna validator form field
as well, and just parsing it to get the java.util.Date equivalent when
you use it in your Action classes.

Hubert

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 And the 3rd mail.  Is it possible to use an object that's different from 
 java.lang.* as type for the dynavalidatorform?  I think that's what causing 
 the issue here.  If it's not possible, then I'm in deep  :)

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 10:26
 To: user@struts.apache.org
 Subject: RE: DynaValidatorForm with java.util.Date

 Ok, I did some tests and debugging and this is the result:

 The errormsg is Cannot assign value of type 'java.lang.String' to property 
 'txtFieldName' of type 'java.util.Date'.

 I fill that field with following code: modifyForm.set(txtFieldName,new 
 Date());

 So the object I'm assigning to that field is a Date-object, but for some 
 reason it is converted to a String.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 9:40
 To: user@struts.apache.org
 Subject: DynaValidatorForm with java.util.Date

 Hi

 I have a form in which a Date is displayed, using fmt.  It's static text, so 
 no user input is required.  The problem is the following.  When the 
 validation of that form fails, you return to that form.  Actually, it should 
 return to that form, but you're redirected to the error page.

 This is the error:
 2448020 12 03 09:29 [http-8080-Processor24] ERROR 
 org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
 BeanUtils.populate

 javax.servlet.ServletException: BeanUtils.populate

 The form bean exists of a field, which is hidden, of the type java.util.Date. 
  This is filled by the action, with the correct date.  When I look at the 
 source of the page, the date is actually filled in, so that's not the problem.

 I assume there's a problem with assigning the java.util.Date-type to a field 
 in a DynaValidatorForm, but I'm not sure that's what causing the problem.  
 There's also no validation on that field.

 Struts-config:
 form-bean name=ModifyUserForm 
 type=org.apache.struts.validator.DynaValidatorForm
 form-property name=txtTokenStatus type=java.util.Date /
 /form-bean

 Does anybody know how to have a Date-field in your form, in a way you can 
 assign it to a textfield and make sure you can also pass it to fmt:formatDate.

 Tia

 Grtz

 Bjorn



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DynaValidatorForm with java.util.Date

2007-03-12 Thread Niall Pemberton

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Why does sql.Date work?


Because BeanUtils (at the moment) comes with a registered converter
for jav.sql.Date - but not for java.util.Date. If you want it to
handle String--java.util.Date you need to register a Converter for
it:

 Converter dateConverter = new MyDateConverter();
 ConvertUtils.register(dateConverter, java.util.Date.class);

Your date converter will need to implement the following interface:

 http://tinyurl.com/2h459j

The section 4.3.1 you refer to below tells you which types are
supported out of the box.

Niall


And the apache-site states that it's actually possible to use for instance 
java.util.ArrayList.  How do you do that? 
http://struts.apache.org/1.3.5/userGuide/building_controller.html, see section 
4.3.1.



-Original Message-
From: Hubert Rabago [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 14:06
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

The fields of action forms, including DynaValidatorForms are populated
from request parameters, and these values are all in String variables.
 I suggest using a String variable for the dyna validator form field
as well, and just parsing it to get the java.util.Date equivalent when
you use it in your Action classes.

Hubert

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 And the 3rd mail.  Is it possible to use an object that's different from 
java.lang.* as type for the dynavalidatorform?  I think that's what causing the 
issue here.  If it's not possible, then I'm in deep  :)

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 10:26
 To: user@struts.apache.org
 Subject: RE: DynaValidatorForm with java.util.Date

 Ok, I did some tests and debugging and this is the result:

 The errormsg is Cannot assign value of type 'java.lang.String' to property 
'txtFieldName' of type 'java.util.Date'.

 I fill that field with following code: modifyForm.set(txtFieldName,new 
Date());

 So the object I'm assigning to that field is a Date-object, but for some 
reason it is converted to a String.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 9:40
 To: user@struts.apache.org
 Subject: DynaValidatorForm with java.util.Date

 Hi

 I have a form in which a Date is displayed, using fmt.  It's static text, so 
no user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that 
form, but you're redirected to the error page.

 This is the error:
 2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate

 javax.servlet.ServletException: BeanUtils.populate

 The form bean exists of a field, which is hidden, of the type java.util.Date. 
 This is filled by the action, with the correct date.  When I look at the source 
of the page, the date is actually filled in, so that's not the problem.

 I assume there's a problem with assigning the java.util.Date-type to a field 
in a DynaValidatorForm, but I'm not sure that's what causing the problem.  There's 
also no validation on that field.

 Struts-config:
 form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
 form-property name=txtTokenStatus type=java.util.Date /
 /form-bean

 Does anybody know how to have a Date-field in your form, in a way you can 
assign it to a textfield and make sure you can also pass it to fmt:formatDate.

 Tia

 Grtz

 Bjorn



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session values getting lost

2007-03-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dilip,

Dilip Ladhani wrote:
 I have  this wierd problem, I have spent a few hours debugging.

[index.jsp:]
 session.invalidate();
 session = request.getSession(true);
session.setAttribute(userInfo, user);
 
 Now I go to the jsp1, and retrieve the userInfo from session, all works
 well.
 Now, when I go to jsp2, (off a link in my header), and try to retrieve
 userInfo, I get a null Why's that?

Can you post the relevant code from both jsp1 and jsp2?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9Vyk9CaO5/Lv0PARAhAzAJ9DZ3gAtv85+OCyN57CkyMklOPg3ACgmD8j
bP7f+J/8rzMXvFe5QH+6NHU=
=t2l9
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Is it possible to mix pages that use tiles with those that do not?

2007-03-12 Thread Joe Yuen
I am trying to build an application which some pages use tiles that have a 
header, body and footer. I've managed to get the pages with those three tiles 
working but now whenever I want to forward to a page that doesn't have any 
tiles that page always appears in the body. Could someone explain to me how I 
should handle this problem?
 
Thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Print property of a property using bean:write?

2007-03-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Laurie,

Laurie Harper wrote:
 Without thinking about it very much, I would expect that one or other of
 these would work:
 
   bean:write name=user property=country.population /
   bean:write name=user.country property=population /

Regardless of the method of output, your code needs to both read and
write the date in the same format.

If the date will be shown to the user, formatting in their locale is
appropriate. If the date will not be shown, I always recommend ISO-8601
date formatting.

I have a similar situation in that I need to allow users to specify
their own date format preferences. I keep their formats in a Map in the
session, and I wrote a custom validator to validate dates against those
formats. My forms contain only Strings, so in the form handler action, I
use those same formats to create a new SimpleDateFormat object and parse
the date.

I find that non-String form fields often results in conversion problems
like this. They are difficult to debug, too, since the error messages
are usually something along the lines of field 'foo' is invalid, but
you aren't sure why. Unless you hack the code, you'll never find out
what's going on. If you use Strings, you can always disable validation
and start printing things out in your actions to help you debug.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9WIM9CaO5/Lv0PARAmMdAJ4lp3o4dbs/c3OGWwr57s/VNr1+NgCgqGmB
pWQ64zY+1t+Hw8DJghB7lAc=
=EqKm
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts/Tiles 1.1 app on Tomcat 5.5

2007-03-12 Thread Frank Russo
Has anyone had luck taking a Struts 1.1 app with Tiles, and dropping it into 
Tomcat 5.5 app? I saw a couple of old posts, but there weren't much in the way 
of responses. 
 
I'm trying this now, and I'm having some issues with jsp's. The app was working 
fine on Tomcat 4.18 prior. Obviously the jsp spec versions are different, so 
the main question is does anyone know of anything in the tiles code from this 
release that may not be compatible with jsp 2.0?
 
Thanks...


httpheader result and headers with - in the name

2007-03-12 Thread Ryan Fife
Hello.  I've been working on my first Struts2 application over the  
last couple of weeks and have been quite happy with it.  I do have a  
question about the httpheader result that I hope somebody can help me  
out with.


The documentation for the httpheader result mentions the param named  
header.a to set a HTTP header named a with the value given in the  
param element.  My first attempt was to create a X-MyMessage header  
to contain a bit of information for the integration team on the other  
side.  This didn't work.  I also tried other cases with mixed results.


Works:
param name=headers.aMy Message/param
param name=headers.BMy Message/param

Mixed results (all set in same response):
param name=headers.abMy Message/param
param name=headers.ABMy Message/param
param name=headers.aBMy Message/param

Doesn't work:
param name=headers.X-MyMessageMy Message/param
param name=headers.a.bMy Message/param

I tried with parse set to true and false and it didn't seem to make  
any difference.  I believe the parsing is for the text of the header  
messages, not the header names.  Is this not working correctly or am  
I missing something?


Best regards,

Ryan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
Where do I register such a convertor?  Simply add this code to my Action or do 
I have to add this somewhere else?

I've figured out what my problem was, but now sth else pops up.  I have a field 
with type java.util.ArrayList.  When I enter the form, the precedent Action 
fills the form.  On screen, the ArrayList is correctly processed.  Now, when I 
submit the form, all those values are gone.

I added html:hidden property=txtFieldForArrayList / to my JSP, but it turns 
out that was the problem for the previous error.  When I remove that field from 
my JSP, everything works correctly for the first time, but the second time I 
enter the page, this ArrayList is gone.

What am I doing wrong here?

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 14:49
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Why does sql.Date work?

Because BeanUtils (at the moment) comes with a registered converter
for jav.sql.Date - but not for java.util.Date. If you want it to
handle String--java.util.Date you need to register a Converter for
it:

  Converter dateConverter = new MyDateConverter();
  ConvertUtils.register(dateConverter, java.util.Date.class);

Your date converter will need to implement the following interface:

  http://tinyurl.com/2h459j

The section 4.3.1 you refer to below tells you which types are
supported out of the box.

Niall

 And the apache-site states that it's actually possible to use for instance 
 java.util.ArrayList.  How do you do that? 
 http://struts.apache.org/1.3.5/userGuide/building_controller.html, see 
 section 4.3.1.

 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 14:06
 To: Struts Users Mailing List
 Subject: Re: DynaValidatorForm with java.util.Date

 The fields of action forms, including DynaValidatorForms are populated
 from request parameters, and these values are all in String variables.
  I suggest using a String variable for the dyna validator form field
 as well, and just parsing it to get the java.util.Date equivalent when
 you use it in your Action classes.

 Hubert

 On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  And the 3rd mail.  Is it possible to use an object that's different from 
  java.lang.* as type for the dynavalidatorform?  I think that's what causing 
  the issue here.  If it's not possible, then I'm in deep  :)
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: maandag 12 maart 2007 10:26
  To: user@struts.apache.org
  Subject: RE: DynaValidatorForm with java.util.Date
 
  Ok, I did some tests and debugging and this is the result:
 
  The errormsg is Cannot assign value of type 'java.lang.String' to property 
  'txtFieldName' of type 'java.util.Date'.
 
  I fill that field with following code: modifyForm.set(txtFieldName,new 
  Date());
 
  So the object I'm assigning to that field is a Date-object, but for some 
  reason it is converted to a String.
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: maandag 12 maart 2007 9:40
  To: user@struts.apache.org
  Subject: DynaValidatorForm with java.util.Date
 
  Hi
 
  I have a form in which a Date is displayed, using fmt.  It's static text, 
  so no user input is required.  The problem is the following.  When the 
  validation of that form fails, you return to that form.  Actually, it 
  should return to that form, but you're redirected to the error page.
 
  This is the error:
  2448020 12 03 09:29 [http-8080-Processor24] ERROR 
  org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
  BeanUtils.populate
 
  javax.servlet.ServletException: BeanUtils.populate
 
  The form bean exists of a field, which is hidden, of the type 
  java.util.Date.  This is filled by the action, with the correct date.  When 
  I look at the source of the page, the date is actually filled in, so that's 
  not the problem.
 
  I assume there's a problem with assigning the java.util.Date-type to a 
  field in a DynaValidatorForm, but I'm not sure that's what causing the 
  problem.  There's also no validation on that field.
 
  Struts-config:
  form-bean name=ModifyUserForm 
  type=org.apache.struts.validator.DynaValidatorForm
  form-property name=txtTokenStatus type=java.util.Date /
  /form-bean
 
  Does anybody know how to have a Date-field in your form, in a way you can 
  assign it to a textfield and make sure you can also pass it to 
  fmt:formatDate.
 
  Tia
 
  Grtz
 
  Bjorn
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 This message is for the designated recipient only and may contain privileged, 
 proprietary, or otherwise private information.  If you have received it in 
 error, please notify the 

Re: [S2] guice plugin - ROCKS!

2007-03-12 Thread Romu

Should be a bomb on Spring forum .

readed the wiki etc , it reminded me the Gwt vs dojo .



2007/3/12, Ron Chan [EMAIL PROTECTED]:



Guice is used as the internal IOC within struts2 but that is recommended
for
use in applications
But there is now a plugin which will use an external version of guice to
do
your depency injection

http://docs.google.com/Doc?id=dd2fhx4z_5df5hw8

I just converted a mini app over the weekend from using spring to guice
and
first impressions is that it ROCKS!

Using the same set of managers and daos,
- the app now starts up twice as fast
- using mvn jetty:run, recompiling and restarting the app no longer give
me
memory problems
- I loose all the application-*.xml files and together with codebehind and
zero conf the number of xml files are drastically reduced

SWEET


--
View this message in context:
http://www.nabble.com/-S2--guice-plugin---ROCKS%21-tf3388853.html#a9432699
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Getting the AJAX Form Validations to work

2007-03-12 Thread Binil Thomas

Hi all,

I am trying out the Ajax Form validations in S2. I see the validations
example working perfectly fine in Showcase demo, but I can't get it to work
on my machine.

Here is what I did:

1) Created a maven project using the provided archetype.
2) Edited the struts.xml file to add my action:
struts

package name=twms extends=struts-default
action name=show class=validations.TryValidationAction 
method=show 
resultindex.jsp/result
result name=inputindex.jsp/result
/action   
/package
/struts
3) Created src/main/java/validations/TryValidationAction.java as:
package validations;
import com.opensymphony.xwork2.ActionSupport;
public class TryValidationAction extends ActionSupport {
public String show() {
System.out.println(Show: Name =  + name + , age =  + age);
return SUCCESS;
}

private String name;
private int age;
// .. getters and setters for the two properties
}
4) Created a
src/main/resources/validations/TryValidationAction-show-validations.xml file
as:
validators
field name=name
field-validator type=requiredstring
param name=trimtrue/param
messageName cannot be empty/message
/field-validator
/field
/validators
5) Created src/main/webapp/twms/index.jsp as:
%@ taglib prefix=s uri=/struts-tags %
html
head
titleTesting Validations/title
s:head theme=xhtml/
/head
body
s:form action=show.action theme=xhtml
s:textfield label=Name name=name/
s:textfield label=Age name=age/
s:submit value=Submit/
/s:form
/body
/html
6) Configured decorators.xml to exclude my action.

With this set up in place, I was able to load the form, and see the
validations working when it is submitted. But when I change the theme to
Ajax (in the head and the form), I get plenty of Dojo errors in FireBug, I
don't get any validation errors and I am not able to submit the form.

I am using version 2.0.3 of struts, as was set up by the archetype. Can
someone help me get this working?

Thanks,
Binil
PS: I can send my simple project setup, if anyone is interested.
-- 
View this message in context: 
http://www.nabble.com/Getting-the-AJAX-Form-Validations-to-work-tf3390223.html#a9436888
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DynaValidatorForm with java.util.Date

2007-03-12 Thread Niall Pemberton

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Where do I register such a convertor?  Simply add this code to my Action or do 
I have to add this somewhere else?

I've figured out what my problem was, but now sth else pops up.  I have a field 
with type java.util.ArrayList.  When I enter the form, the precedent Action 
fills the form.  On screen, the ArrayList is correctly processed.  Now, when I 
submit the form, all those values are gone.

I added html:hidden property=txtFieldForArrayList / to my JSP, but it turns 
out that was the problem for the previous error.  When I remove that field from my JSP, 
everything works correctly for the first time, but the second time I enter the page, this 
ArrayList is gone.

What am I doing wrong here?


Is the ArrayList gone or empty? Presumably just empty - since
DynaActionForm's should re-create the list even in request scope. You
could change the form to be session scope - or you need to add some
lazy list type behaviour

 http://wiki.apache.org/struts/StrutsCatalogLazyList
 http://wiki.apache.org/struts/LazyList

If you use one of the lazy ActionForm flavours it does this for you:

 
http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes

Niall


-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: maandag 12 maart 2007 14:49
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Why does sql.Date work?

Because BeanUtils (at the moment) comes with a registered converter
for jav.sql.Date - but not for java.util.Date. If you want it to
handle String--java.util.Date you need to register a Converter for
it:

  Converter dateConverter = new MyDateConverter();
  ConvertUtils.register(dateConverter, java.util.Date.class);

Your date converter will need to implement the following interface:

  http://tinyurl.com/2h459j

The section 4.3.1 you refer to below tells you which types are
supported out of the box.

Niall

 And the apache-site states that it's actually possible to use for instance 
java.util.ArrayList.  How do you do that? 
http://struts.apache.org/1.3.5/userGuide/building_controller.html, see section 
4.3.1.

 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 14:06
 To: Struts Users Mailing List
 Subject: Re: DynaValidatorForm with java.util.Date

 The fields of action forms, including DynaValidatorForms are populated
 from request parameters, and these values are all in String variables.
  I suggest using a String variable for the dyna validator form field
 as well, and just parsing it to get the java.util.Date equivalent when
 you use it in your Action classes.

 Hubert

 On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  And the 3rd mail.  Is it possible to use an object that's different from 
java.lang.* as type for the dynavalidatorform?  I think that's what causing the issue 
here.  If it's not possible, then I'm in deep  :)
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: maandag 12 maart 2007 10:26
  To: user@struts.apache.org
  Subject: RE: DynaValidatorForm with java.util.Date
 
  Ok, I did some tests and debugging and this is the result:
 
  The errormsg is Cannot assign value of type 'java.lang.String' to property 
'txtFieldName' of type 'java.util.Date'.
 
  I fill that field with following code: modifyForm.set(txtFieldName,new 
Date());
 
  So the object I'm assigning to that field is a Date-object, but for some 
reason it is converted to a String.
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: maandag 12 maart 2007 9:40
  To: user@struts.apache.org
  Subject: DynaValidatorForm with java.util.Date
 
  Hi
 
  I have a form in which a Date is displayed, using fmt.  It's static text, 
so no user input is required.  The problem is the following.  When the validation of 
that form fails, you return to that form.  Actually, it should return to that form, 
but you're redirected to the error page.
 
  This is the error:
  2448020 12 03 09:29 [http-8080-Processor24] ERROR 
org.apache.struts.util.RequestUtils  - javax.servlet.ServletException: 
BeanUtils.populate
 
  javax.servlet.ServletException: BeanUtils.populate
 
  The form bean exists of a field, which is hidden, of the type 
java.util.Date.  This is filled by the action, with the correct date.  When I look at 
the source of the page, the date is actually filled in, so that's not the problem.
 
  I assume there's a problem with assigning the java.util.Date-type to a 
field in a DynaValidatorForm, but I'm not sure that's what causing the problem.  
There's also no validation on that field.
 
  Struts-config:
  form-bean name=ModifyUserForm 
type=org.apache.struts.validator.DynaValidatorForm
  form-property name=txtTokenStatus type=java.util.Date /
  /form-bean
 
  Does anybody know how to have a 

Re: Getting the AJAX Form Validations to work

2007-03-12 Thread Musachy Barroso

Enable dojo debugging by setting debug=true on the head tag, and see if
there are any errors. Can you post the errors that you are seeing in FB?

regards
musachy

On 3/12/07, Binil Thomas [EMAIL PROTECTED] wrote:



Hi all,

I am trying out the Ajax Form validations in S2. I see the validations
example working perfectly fine in Showcase demo, but I can't get it to
work
on my machine.

Here is what I did:

1) Created a maven project using the provided archetype.
2) Edited the struts.xml file to add my action:
struts

package name=twms extends=struts-default
action name=show class=validations.TryValidationAction
method=show
resultindex.jsp/result
result name=inputindex.jsp/result
/action
/package
/struts
3) Created src/main/java/validations/TryValidationAction.java as:
package validations;
import com.opensymphony.xwork2.ActionSupport;
public class TryValidationAction extends ActionSupport {
public String show() {
System.out.println(Show: Name =  + name + , age =  + age);
return SUCCESS;
}

private String name;
private int age;
// .. getters and setters for the two properties
}
4) Created a
src/main/resources/validations/TryValidationAction-show-validations.xmlfile
as:
validators
field name=name
field-validator type=requiredstring
param name=trimtrue/param
messageName cannot be empty/message
/field-validator
/field
/validators
5) Created src/main/webapp/twms/index.jsp as:
%@ taglib prefix=s uri=/struts-tags %
html
head
titleTesting Validations/title
s:head theme=xhtml/
/head
body
s:form action=show.action theme=xhtml
s:textfield label=Name name=name/
s:textfield label=Age name=age/
s:submit value=Submit/
/s:form
/body
/html
6) Configured decorators.xml to exclude my action.

With this set up in place, I was able to load the form, and see the
validations working when it is submitted. But when I change the theme to
Ajax (in the head and the form), I get plenty of Dojo errors in FireBug, I
don't get any validation errors and I am not able to submit the form.

I am using version 2.0.3 of struts, as was set up by the archetype. Can
someone help me get this working?

Thanks,
Binil
PS: I can send my simple project setup, if anyone is interested.
--
View this message in context:
http://www.nabble.com/Getting-the-AJAX-Form-Validations-to-work-tf3390223.html#a9436888
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Hey you! Would you help me to carry the stone? Pink Floyd


Help: Populate DB Data into FormBean

2007-03-12 Thread Davis, John \(Lynch\)
Hi all,

I'm just getting started with Struts 1.3.x and I've run into a problem I
just can't seem to find a way to tackle. I am simply trying to load data
from a database and populate it in a form-bean.

The flow is like this: 

1. user logs in

2. authenticate user

3. display a main form with user specific data in
html:select

If I do static initialization of data in the ActionForm, the data shows
up just as I would expect.

My question is, where do I need to load the information and how do I
inject it into the form-bean object.

Skipping the jdbc connectivity at this point, I have tried the
following: 

public ActionForward execute(ActionMapping mapping,
ActionForm form,

HttpServletRequest request, HttpServletResponse
response)

throws Exception {

BuildMainForm bmf = (BuildMainForm)form;

ArrayList builds = new ArrayList();

builds.add(new LabelValueBean(build 1, build 1));

builds.add(new LabelValueBean(build 2, build 2));

builds.add(new LabelValueBean(build 3, build 3));

bmf.setBuilds(builds);



return mapping.findForward(Success);

} // End execute()

I tried putting this in my LoginAction class to no effect, and I have
put it in my MainAction class. Since my current forward action for my
main class just goes back to main, if I do click submit and get
forwarded back to the same page, the options do appear in my drop down.

I have the following tags in my jsp:

html:select property=buildNameOld

html:optionsCollection property=builds/

/html:select

and from my struts-config.xml

form-bean

name=loginForm

type=LoginForm/

form-bean

name=buildMainForm

type=BuildMainForm /

action path=/login 

type=LoginAction 

name=loginForm 

scope=request 

validate=false 

input=/login.jsp

forward name=Success path=/build_main.jsp /

forward name=Fail path=/login_fail.jsp /

/action

action path=/build_main 

type=BuildMainAction 

name=buildMainForm 

scope=request 

validate=false 

forward name=Success path=/build_main.jsp /

forward name=Fail path=/login_fail.jsp /

/action

Any guidance on this would be greatly appreciated.

Thanks,

Lynch



Struts-DisplayTag(partial list)

2007-03-12 Thread Daniel Chacón Sánchez

Hello, I', using struts framework and displaytag 1.0, all works great.

Now, I want to implement pagination using the the partial list (External
Paging and Sorting) for displaying records (display tag 1.1 facility).
I have this doubt:

 - For pagination we will be providing display tag only the records
 that required to be displayed from the full list i.e. if there are 500
 records from backend populated in full list, we will be creating a partial
 list of desired records (say 50) from full list and then feeding this
 partial list to display tag ?
 - Or we will be querying backend only for the desired 50 records ? And
 if so how we take care for sorting, page number etc. ?

Can someone share there experience for implementing partial list in display
tags?

Can someone give me some example code (what to put in the JSP, the action,
dao, etc)

Thanks!!!


RE: DynaValidatorForm with java.util.Date

2007-03-12 Thread bjorn.de.bakker
I can't see how that can solve my problem?  

The ArrayList is actually gone.  When I want to display the arraylist with 
c:forEach items=${ModifyCivilServantForm.map} var=formField
li${formField.key}: ${formField.value}/li
/c:forEach
Everything is gone.

The problem is, that list contains a few values, which need to be maintained 
after submitting.

This is the situation:
I have a Date-object and an arraylist containing a few objects.

What we do now is the following:  before the form is displayed, we have an 
action which fills the formfields with the corresponding values.  Say that you 
have a record you want to change, before the change-form is displayed, an 
action retrieves the album and fills the form with the right values.

Up till now, we didn't have any problems, because we only used java.lang.String 
or java.lang.Integer as types.  Now I have a Date-field and an ArrayList-field.

Prefilling those fields is not a problem.  The right values are displayed and 
everything is ok.  When I submit the form, those two fields are gone.  First I 
got that ERROR org.apache.struts.util.RequestUtils  - 
javax.servlet.ServletException: BeanUtils.populate
javax.servlet.ServletException: BeanUtils.populate error, but removing those 
input fields (whom are hidden) from the form solved the problem.  But when I 
submit, those values are gone.

Does anybody know how to fix this?

I tried writing that customconverter, but I don't know how or where to register 
it.  Simply adding that code to an Action-class doesn't solve it

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: maandag 12 maart 2007 16:46
To: Struts Users Mailing List
Subject: Re: DynaValidatorForm with java.util.Date

On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Where do I register such a convertor?  Simply add this code to my Action or 
 do I have to add this somewhere else?

 I've figured out what my problem was, but now sth else pops up.  I have a 
 field with type java.util.ArrayList.  When I enter the form, the precedent 
 Action fills the form.  On screen, the ArrayList is correctly processed.  
 Now, when I submit the form, all those values are gone.

 I added html:hidden property=txtFieldForArrayList / to my JSP, but it 
 turns out that was the problem for the previous error.  When I remove that 
 field from my JSP, everything works correctly for the first time, but the 
 second time I enter the page, this ArrayList is gone.

 What am I doing wrong here?

Is the ArrayList gone or empty? Presumably just empty - since
DynaActionForm's should re-create the list even in request scope. You
could change the form to be session scope - or you need to add some
lazy list type behaviour

  http://wiki.apache.org/struts/StrutsCatalogLazyList
  http://wiki.apache.org/struts/LazyList

If you use one of the lazy ActionForm flavours it does this for you:

  
http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes

Niall

 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: maandag 12 maart 2007 14:49
 To: Struts Users Mailing List
 Subject: Re: DynaValidatorForm with java.util.Date

 On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Why does sql.Date work?

 Because BeanUtils (at the moment) comes with a registered converter
 for jav.sql.Date - but not for java.util.Date. If you want it to
 handle String--java.util.Date you need to register a Converter for
 it:

   Converter dateConverter = new MyDateConverter();
   ConvertUtils.register(dateConverter, java.util.Date.class);

 Your date converter will need to implement the following interface:

   http://tinyurl.com/2h459j

 The section 4.3.1 you refer to below tells you which types are
 supported out of the box.

 Niall

  And the apache-site states that it's actually possible to use for instance 
  java.util.ArrayList.  How do you do that? 
  http://struts.apache.org/1.3.5/userGuide/building_controller.html, see 
  section 4.3.1.

  -Original Message-
  From: Hubert Rabago [mailto:[EMAIL PROTECTED]
  Sent: maandag 12 maart 2007 14:06
  To: Struts Users Mailing List
  Subject: Re: DynaValidatorForm with java.util.Date
 
  The fields of action forms, including DynaValidatorForms are populated
  from request parameters, and these values are all in String variables.
   I suggest using a String variable for the dyna validator form field
  as well, and just parsing it to get the java.util.Date equivalent when
  you use it in your Action classes.
 
  Hubert
 
  On 3/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   And the 3rd mail.  Is it possible to use an object that's different from 
   java.lang.* as type for the dynavalidatorform?  I think that's what 
   causing the issue here.  If it's not possible, then I'm in deep  :)
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: maandag 12 maart 2007 10:26
   To: user@struts.apache.org
   

Re: [S2] Getting the AJAX Form Validations to work

2007-03-12 Thread Binil Thomas

Hi Musachy,

Thanks for replying!

On FB I see HTTP 404s on:
1) http://localhost:8080/validations/stuts/dojo/src/widget/html/Tooltip.js
2) http://localhost:8080/validations/stuts/dojo/src/widget/html.js
3) http://localhost:8080/validations/stuts/dojo/src/widget.js
4) http://localhost:8080/validations/stuts/dojo/src/__package__.js
5) http://localhost:8080/validations/stuts/dojo/src.js
6) http://localhost:8080/validations/stuts/dojo/__package__.js

Also, on both FB and the page, I see the error:
Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js'
(I have enabled Dojo debug now). I think the Dojo widget is called
dojo.widget.Tooltip.

When the form first shows up I see the field error message for 'name' field.
When I fill out the field and tab out of it, no AJAX request is send to the
server (I am assuming that the expectation is that the form gets validated
at the server via an AJAX call onBlur).

When I click submit, an AJAX request is send and the server responds with
the HTML page for the action; but nothing happens to the page.

Here is the source of the page that is loaded into the browser when the form
is first shown:
html
head
titleTesting Validations/title
link rel=stylesheet href=/validations/struts/xhtml/styles.css
type=text/css/
script language=JavaScript type=text/javascript
// Dojo configuration
djConfig = {
baseRelativePath: /validations/struts/dojo,
isDebug: true,
bindEncoding: UTF-8,
debugAtAllCosts: true // not needed, but allows the Venkman debugger
to work with the includes
};
/script
script language=JavaScript type=text/javascript
src=/validations/struts/dojo/dojo.js/script
script language=JavaScript type=text/javascript
src=/validations/struts/simple/dojoRequire.js/script
script language=JavaScript type=text/javascript
src=/validations/struts/ajax/dojoRequire.js/script
script language=JavaScript type=text/javascript
src=/validations/struts/CommonFunctions.js/script

/head

body

form namespace= id=show action=show.action 

table class=wwFormTable
tr errorFor=show_name
td align=center valign=top colspan=2span
class=errorMessageName cannot be empty/span/td
/tr
tr
td class=tdLabellabel for=show_name
class=errorLabelName:/label/td
td
input type=text name=name value= id=show_name/

/td
/tr

tr
td class=tdLabellabel for=show_age
class=labelAge:/label/td
td
input type=text name=age value=0 id=show_age/
/td
/tr

tr
td colspan=2div align=rightinput type=submit
dojoType=struts:Bind event=onclick value=Submit  
id=show_0  /

/div/td
/tr


!-- javascript that is needed for tooltips --
script language=JavaScript
type=text/javascriptdojo.require(dojo.widget.html.Tooltip);dojo.require(dojo.fx.html);/script

/table
/form


/body
/html

Thanks,
Binil


Musachy Barroso wrote:
 
 Enable dojo debugging by setting debug=true on the head tag, and see if
 there are any errors. Can you post the errors that you are seeing in FB?
 

-- 
View this message in context: 
http://www.nabble.com/Getting-the-AJAX-Form-Validations-to-work-tf3390223.html#a9437856
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] updownselect tag in 2.0.6

2007-03-12 Thread Brian Thompson

Hello list,

The trivial examples on the wiki work fine, but my attempt at using
s:updownselect fails when I try to use listKey and listValue:

s:updownselect list=courseList name=selectedCourses
   allowMoveDown=true allowMoveUp=true
   label=Available Courses:
   multiple=true required=true
   value=selectedCourses
   allowSelectAll=true/

works, and it shows the results of my toString methods on the objects in
courseList.

Since I want data from specific fields in my objects, I added:

s:updownselect list=courseList name=selectedCourses
   allowMoveDown=true allowMoveUp=true
   label=Available Courses:
   multiple=true required=true
   value=selectedCourses
   allowSelectAll=true
   listKey=uuid listValue=displayName /

and instead of a very nice selection page, I get a runtime error:

[OLT] ERROR [http-8080-Processor25] runtime.error(96) |
Expected number, date, or string. parameters.nameValue evaluated instead to
freemarker.ext.beans.ArrayModel on line 60, column 101 in
template/simple/select.ftl.
The problematic instruction:
--
== if tag.contains(parameters.nameValue, itemKey) == true || (
parameters.nameValue?exists  parameters.nameValue?string == itemKey) [on
line 60, column 9 in template/simple/select.ftl]
in user-directive s.iterator [on line 40, column 1 in
template/simple/select.ftl]
in include /${templateDir}/simple/select.ftl [on line 7, column 1 in
template/simple/updownselect.ftl]
in include /${parameters.templateDir}/simple/updownselect.ftl [on line 3,
column 1 in template/css_xhtml/updownselect.ftl]
--

Java backtrace for programmers:
--
freemarker.template.TemplateException: Expected number, date, or string.
parameters.nameValue evaluated instead to freemarker.ext.beans.ArrayModel on
line 60, column 101 in template/simple/select.ftl.
(etc)

Has anyone had any luck with using updownselect tags in 2.0.6?  I didn't
have this problem in 2.0.5, so I'm hoping it's a simple fix.

Thanks!

-Brian


Re: [s2] updownselect tag in 2.0.6

2007-03-12 Thread Brian Thompson

After doing some further testing, I found that

   s:updownselect
   list=courseList
   name=nonsenseName
   listKey=uuid listValue=displayName/

works, but

   s:updownselect
   list=courseList
   name=selectedCourses
   listKey=uuid listValue=displayName/

Does not.  selectedCourses is a String array on my action object, and before
this issue popped up, I was using OGNL to autopopulate the array with the
selected ids from courseList.

Now, every variation on selectedCourses raises this error.

(I've tried
selectedCourses
'selectedCourses'
%{selectedCourses}
%{'selectedCourses'}
so far).

-Brian


Struts 2 newbie question

2007-03-12 Thread King, Leon C
How do you modify the alignment of a button?   Currently I'm  using the
following in my jsp:

s:submit type=button value=%{'submitForm('query')'}

label=Query Result /

 

which produces a button on one line.   I'd like to combine several
buttons on the same line.

 

Thanks,

 

Leon



Re: Session values getting lost

2007-03-12 Thread Dilip Ladhani

Sure. Actually, the code to access the session is in the action
classes and not the jsps. It's the same code in both actions (for jsp1
and jsp2)

String cdsID = 
((UserTO)request.getSession().getAttribute(userInfo)).getCdsID();

I tried another thing, instead of going to jsp1 from index page (which
was working), I am going to jsp2 (just changed the link and it
worked So the bottom line is the links through the index page
work, but the links throught the header.jsp (the header inserted using
tiles) does not work. Here's how I create the links

Index Page
a href/viewHistoryDefault.doHome Page/a

header,jsp
a href=/TrnTracker/viewSchedule.doSchedule Page/a

Is the context root (present in header, missing in index) making a difference??

thanks


On 3/12/07, Christopher Schultz [EMAIL PROTECTED] wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dilip,

Dilip Ladhani wrote:
 I have  this wierd problem, I have spent a few hours debugging.

[index.jsp:]
 session.invalidate();
 session = request.getSession(true);
session.setAttribute(userInfo, user);

 Now I go to the jsp1, and retrieve the userInfo from session, all works
 well.
 Now, when I go to jsp2, (off a link in my header), and try to retrieve
 userInfo, I get a null Why's that?

Can you post the relevant code from both jsp1 and jsp2?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9Vyk9CaO5/Lv0PARAhAzAJ9DZ3gAtv85+OCyN57CkyMklOPg3ACgmD8j
bP7f+J/8rzMXvFe5QH+6NHU=
=t2l9
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 newbie question

2007-03-12 Thread Pascal Lalonde

You'll have to modify the associated template within your project.

The actual form template (from the default xhtml) is wrapping inputs 
into a table, each input is appended has a row into it.


- Pascal

King, Leon C wrote:

How do you modify the alignment of a button?   Currently I'm  using the
following in my jsp:

s:submit type=button value=%{'submitForm('query')'}

label=Query Result /

 


which produces a button on one line.   I'd like to combine several
buttons on the same line.

 


Thanks,

 


Leon


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 newbie question

2007-03-12 Thread Paul Saumets
In your struts.properties file declare the following line:

struts.ui.theme=simple

then just wrap whatever you'd like around your input tags.

Regards,
Paul
  _  

From: King, Leon C [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Mon, 12 Mar 2007 14:23:14 -0400
Subject: Struts 2 newbie question

How do you modify the alignment of a button?   Currently I'm  using the
  following in my jsp:
  
  s:submit type=button value=%{'submitForm('query')'}
  
  label=Query Result /
  
   
  
  which produces a button on one line.   I'd like to combine several
  buttons on the same line.
  
   
  
  Thanks,
  
   
  
  Leon
  
  


Re: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread stanlick

Hey all --

Here is my page source and the corresponding generated generated HTML.  As
you can see, this DIV is not well-formed, and naturally does not rended
correctly.  Any help would be appreciated.

Thanks,
Scott

==


s:form action=register method=post id=registerForm

s:textfield name=user.username value=%{user.username}

label=%{getText('user.username')} size=40 labelposition=right /

s:textfield name=user.password value=%{user.password}

label=%{getText('user.password')} size=40 /

s:textfield name=user.firstName value=%{user.firstName}

label=%{getText('user.firstName')} size=40 /

s:textfield name=user.middleName value=%{user.middleName}

label=%{getText('user.middleName')} size=40 /

s:textfield name=user.lastName value=%{user.lastName}

label=%{getText('user.lastName')} size=40 /

s:textfield name=user.zip.zip value=%{user.zip.zip}

label=%{getText('user.zip')} size=10

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') /

s:div autoStart=false formId=registerForm theme=ajax

id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} /

s:submit value=%{getText('label.save')} /

/s:form

==


FORM id=registerForm name=register onsubmit=return true;

action=/dsms/register.action method=post

TABLE class=wwFormTable

TBODY

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_username

User Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_username size=40 name=user.username

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_password

Password:

/LABEL

/TD

TD

INPUT id=registerForm_user_password size=40 name=user.password

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_firstName

First Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_firstName size=40 name=user.firstName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_middleName

Middle Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_middleName size=40

name=user.middleName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_lastName

Last Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_lastName size=40 name=user.lastName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_zip_zip

Zip Code:

/LABEL

/TD

TD

INPUT id=registerForm_user_zip_zip

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic')

size=10 value=62025 name=user.zip.zip

/TD

/TR

DIV id=zipDiv showError=true listenTopics=zipEnteredTopic

href=http://localhost:8080/dsms/ZipCode.action;

formId=registerForm autoStart=false dojoType=struts:BindDiv

LABEL class=label for=user_zip_city

City:

/LABEL

/TD

TD

INPUT id=user_zip_city size=40 value=Edwardsville

name=user.zip.city

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=user_zip_state

State:

/LABEL

/TD

TD

INPUT id=user_zip_state size=2 value=IL name=user.zip.state

/TD

/TR

/DIV

TR

TD colSpan=2

DIV align=right

INPUT id=registerForm_0 type=submit value=Save

/DIV

/TD

/TR

/TBODY

/TABLE

/FORM


Re: Struts 2 newbie question

2007-03-12 Thread stanlick

Does this disallow Ajax support?

On 3/12/07, Paul Saumets [EMAIL PROTECTED] wrote:


In your struts.properties file declare the following line:

struts.ui.theme=simple

then just wrap whatever you'd like around your input tags.

Regards,
Paul
_

From: King, Leon C [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Mon, 12 Mar 2007 14:23:14 -0400
Subject: Struts 2 newbie question

How do you modify the alignment of a button?   Currently I'm  using the
following in my jsp:

 s:submit type=button value=%{'submitForm('query')'}

 label=Query Result /



which produces a button on one line.   I'd like to combine several
buttons on the same line.



Thanks,



Leon








--
Scott
[EMAIL PROTECTED]


RE: Struts 2 newbie question

2007-03-12 Thread King, Leon C
How do you include this template with your project?   I've modified the
'submit.ftl' file and placed it in the '/WEB-INF/classes' dir of my web
application.  Its not being picked up..

Thanks,

Leon

-Original Message-
From: Pascal Lalonde [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 2:36 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 newbie question

You'll have to modify the associated template within your project.

The actual form template (from the default xhtml) is wrapping inputs 
into a table, each input is appended has a row into it.

- Pascal

King, Leon C wrote:
 How do you modify the alignment of a button?   Currently I'm  using
the
 following in my jsp:

 s:submit type=button value=%{'submitForm('query')'}

 label=Query Result /

  

 which produces a button on one line.   I'd like to combine several
 buttons on the same line.

  

 Thanks,

  

 Leon


   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts/Tiles 1.1 app on Tomcat 5.5

2007-03-12 Thread Ray Clough
I've been using Tiles with all Struts versions since 1.1 and all the 
latest Tomcat versions.  I have not been able to use it with Struts 2.0, 
but others have reported that it works fine there, too, so it must be 
something I've done wrong.


- Ray Clough


Frank Russo wrote:
Has anyone had luck taking a Struts 1.1 app with Tiles, and dropping it into Tomcat 5.5 app? I saw a couple of old posts, but there weren't much in the way of responses. 
 
I'm trying this now, and I'm having some issues with jsp's. The app was working fine on Tomcat 4.18 prior. Obviously the jsp spec versions are different, so the main question is does anyone know of anything in the tiles code from this release that may not be compatible with jsp 2.0?
 
Thanks...


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 newbie question

2007-03-12 Thread Mark Menard
On 3/12/07 1:53 PM, Paul Saumets [EMAIL PROTECTED] wrote:

 In your struts.properties file declare the following line:
 
 struts.ui.theme=simple
 
 then just wrap whatever you'd like around your input tags.

That to me is a hammer-like solution. This will change all of his forms to
use the simple theme.

How about:

trtd colspan=2s:submit theme=simple  /s:submit theme=simple
//tr

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts 2 newbie question

2007-03-12 Thread King, Leon C
:)   That's what I figured out and implemented.   Thanks for the quick
help.

-Original Message-
From: Mark Menard [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 5:22 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 newbie question

On 3/12/07 1:53 PM, Paul Saumets [EMAIL PROTECTED]
wrote:

 In your struts.properties file declare the following line:
 
 struts.ui.theme=simple
 
 then just wrap whatever you'd like around your input tags.

That to me is a hammer-like solution. This will change all of his forms
to
use the simple theme.

How about:

trtd colspan=2s:submit theme=simple  /s:submit
theme=simple
//tr

Mark

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts/Tiles 1.1 app on Tomcat 5.5

2007-03-12 Thread Frank Russo
I've tracked my issues down to broken jsp code that was allowed by the jsp 
compiler in 4.1.18. I've had to play and fix a bit of jsp, but the transition 
overall was smooth... 

-Original Message-
From: Ray Clough [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 1:28 PM
To: Struts Users Mailing List
Subject: Re: Struts/Tiles 1.1 app on Tomcat 5.5

I've been using Tiles with all Struts versions since 1.1 and all the latest 
Tomcat versions.  I have not been able to use it with Struts 2.0, but others 
have reported that it works fine there, too, so it must be something I've done 
wrong.

- Ray Clough


Frank Russo wrote:
 Has anyone had luck taking a Struts 1.1 app with Tiles, and dropping it into 
 Tomcat 5.5 app? I saw a couple of old posts, but there weren't much in the 
 way of responses. 
  
 I'm trying this now, and I'm having some issues with jsp's. The app was 
 working fine on Tomcat 4.18 prior. Obviously the jsp spec versions are 
 different, so the main question is does anyone know of anything in the tiles 
 code from this release that may not be compatible with jsp 2.0?
  
 Thanks...

   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 newbie question

2007-03-12 Thread Ted Husted

On 3/12/07, Mark Menard [EMAIL PROTECTED] wrote:

On 3/12/07 1:53 PM, Paul Saumets [EMAIL PROTECTED] wrote:

 In your struts.properties file declare the following line:

 struts.ui.theme=simple


Or, in struts.xml,

   constant name=struts.ui.theme value=simple /

The struts.xml setting being the preferred approach.

- HTH, Ted
http://www.husted.com/ted/blog/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session values getting lost

2007-03-12 Thread Dave Newton
--- Dilip Ladhani [EMAIL PROTECTED] wrote:
 Index Page
 a href/viewHistoryDefault.doHome Page/a
 
 header,jsp
 a href=/TrnTracker/viewSchedule.doSchedule
 Page/a
 
 Is the context root (present in header, missing in
 index) making a difference??

Do both ways of making links work?! If you're creating
absolute URLs then aren't the above two links pointing
at separate webapps?

(As an aside, why aren't you building the struts links
with the struts tags?)

d.



 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread Bob Buffone
Hello,

I have been reading this posted and thought I would respond with
information about the Apache XAP project,
http://incubator.apache.org/xap (This could be taken as a solicitation,
if so, it probably is).  

One of the unique attributes about the XAP project is that is uses a XML
Markup language to display the user interface and control events.  This
make easy to integrate into server side frameworks like struts.  I have
posted a write up how integration works and uploaded a sample at
http://wiki.apache.org/incubator/xap/XAPStruts.

One other benefit of the XAP project integrated with struts would be to
use the xModify syntax to do page modification of the HTML DOM. By
outputting the xModify syntax from a struts action, you would get the in
page updating of Ajax but still control the page orchestration through
Struts. This is the best of both worlds.

Bob (Buffone)
XAP Committer

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 3:03 PM
To: Struts Users Mailing List
Subject: Re: Need more comprehensive AJAX Implementation Instructions

Hey all --

Here is my page source and the corresponding generated generated HTML.
As
you can see, this DIV is not well-formed, and naturally does not rended
correctly.  Any help would be appreciated.

Thanks,
Scott

==


s:form action=register method=post id=registerForm

s:textfield name=user.username value=%{user.username}

label=%{getText('user.username')} size=40 labelposition=right /

s:textfield name=user.password value=%{user.password}

label=%{getText('user.password')} size=40 /

s:textfield name=user.firstName value=%{user.firstName}

label=%{getText('user.firstName')} size=40 /

s:textfield name=user.middleName value=%{user.middleName}

label=%{getText('user.middleName')} size=40 /

s:textfield name=user.lastName value=%{user.lastName}

label=%{getText('user.lastName')} size=40 /

s:textfield name=user.zip.zip value=%{user.zip.zip}

label=%{getText('user.zip')} size=10

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') /

s:div autoStart=false formId=registerForm theme=ajax

id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} /

s:submit value=%{getText('label.save')} /

/s:form

==


FORM id=registerForm name=register onsubmit=return true;

action=/dsms/register.action method=post

TABLE class=wwFormTable

TBODY

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_username

User Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_username size=40 name=user.username

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_password

Password:

/LABEL

/TD

TD

INPUT id=registerForm_user_password size=40 name=user.password

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_firstName

First Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_firstName size=40 name=user.firstName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_middleName

Middle Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_middleName size=40

name=user.middleName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_lastName

Last Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_lastName size=40 name=user.lastName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_zip_zip

Zip Code:

/LABEL

/TD

TD

INPUT id=registerForm_user_zip_zip

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic')

size=10 value=62025 name=user.zip.zip

/TD

/TR

DIV id=zipDiv showError=true listenTopics=zipEnteredTopic

href=http://localhost:8080/dsms/ZipCode.action;

formId=registerForm autoStart=false dojoType=struts:BindDiv

LABEL class=label for=user_zip_city

City:

/LABEL

/TD

TD

INPUT id=user_zip_city size=40 value=Edwardsville

name=user.zip.city

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=user_zip_state

State:

/LABEL

/TD

TD

INPUT id=user_zip_state size=2 value=IL name=user.zip.state

/TD

/TR

/DIV

TR

TD colSpan=2

DIV align=right

INPUT id=registerForm_0 type=submit value=Save

/DIV

/TD

/TR

/TBODY

/TABLE

/FORM

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread stanlick

Ah joy!  More XML files :)  I'll take a look at it.  The more I learn about
the S2 UI, the more concerned I become.

Scott

On 3/12/07, Bob Buffone [EMAIL PROTECTED] wrote:


Hello,

I have been reading this posted and thought I would respond with
information about the Apache XAP project,
http://incubator.apache.org/xap (This could be taken as a solicitation,
if so, it probably is).

One of the unique attributes about the XAP project is that is uses a XML
Markup language to display the user interface and control events.  This
make easy to integrate into server side frameworks like struts.  I have
posted a write up how integration works and uploaded a sample at
http://wiki.apache.org/incubator/xap/XAPStruts.

One other benefit of the XAP project integrated with struts would be to
use the xModify syntax to do page modification of the HTML DOM. By
outputting the xModify syntax from a struts action, you would get the in
page updating of Ajax but still control the page orchestration through
Struts. This is the best of both worlds.

Bob (Buffone)
XAP Committer

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 12, 2007 3:03 PM
To: Struts Users Mailing List
Subject: Re: Need more comprehensive AJAX Implementation Instructions

Hey all --

Here is my page source and the corresponding generated generated HTML.
As
you can see, this DIV is not well-formed, and naturally does not rended
correctly.  Any help would be appreciated.

Thanks,
Scott

==


s:form action=register method=post id=registerForm

s:textfield name=user.username value=%{user.username}

label=%{getText('user.username')} size=40 labelposition=right /

s:textfield name=user.password value=%{user.password}

label=%{getText('user.password')} size=40 /

s:textfield name=user.firstName value=%{user.firstName}

label=%{getText('user.firstName')} size=40 /

s:textfield name=user.middleName value=%{user.middleName}

label=%{getText('user.middleName')} size=40 /

s:textfield name=user.lastName value=%{user.lastName}

label=%{getText('user.lastName')} size=40 /

s:textfield name=user.zip.zip value=%{user.zip.zip}

label=%{getText('user.zip')} size=10

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic') /

s:div autoStart=false formId=registerForm theme=ajax

id=zipDiv listenTopics=zipEnteredTopic href=%{zipUrl} /

s:submit value=%{getText('label.save')} /

/s:form

==


FORM id=registerForm name=register onsubmit=return true;

action=/dsms/register.action method=post

TABLE class=wwFormTable

TBODY

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_username

User Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_username size=40 name=user.username

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_password

Password:

/LABEL

/TD

TD

INPUT id=registerForm_user_password size=40 name=user.password

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_firstName

First Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_firstName size=40 name=user.firstName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_middleName

Middle Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_middleName size=40

name=user.middleName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_lastName

Last Name:

/LABEL

/TD

TD

INPUT id=registerForm_user_lastName size=40 name=user.lastName

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=registerForm_user_zip_zip

Zip Code:

/LABEL

/TD

TD

INPUT id=registerForm_user_zip_zip

onblur=javascript:dojo.event.topic.publish('zipEnteredTopic')

size=10 value=62025 name=user.zip.zip

/TD

/TR

DIV id=zipDiv showError=true listenTopics=zipEnteredTopic

href=http://localhost:8080/dsms/ZipCode.action;

formId=registerForm autoStart=false dojoType=struts:BindDiv

LABEL class=label for=user_zip_city

City:

/LABEL

/TD

TD

INPUT id=user_zip_city size=40 value=Edwardsville

name=user.zip.city

/TD

/TR

TR

TD class=tdLabel

LABEL class=label for=user_zip_state

State:

/LABEL

/TD

TD

INPUT id=user_zip_state size=2 value=IL name=user.zip.state

/TD

/TR

/DIV

TR

TD colSpan=2

DIV align=right

INPUT id=registerForm_0 type=submit value=Save

/DIV

/TD

/TR

/TBODY

/TABLE

/FORM

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Scott
[EMAIL PROTECTED]


Re: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread Guillaume Carré

2007/3/12, [EMAIL PROTECTED] [EMAIL PROTECTED]:

Hey all --

Here is my page source and the corresponding generated generated HTML.  As
you can see, this DIV is not well-formed, and naturally does not rended
correctly.  Any help would be appreciated.



try this:
s:form action=register method=post id=registerForm
theme=simple.../s:form
--
Guillaume Carré

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Need more comprehensive AJAX Implementation Instructions

2007-03-12 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
 As you can see, this DIV is not well-formed, and
 naturally does not rended correctly.  Any help would

 be appreciated.

What version of S2 are you using? I cut-and-pasted
your supplied JSP, created a dummy action and user
object, and get radically different results under S2
2.0.4 (and later) (like... my attributes have quotes,
the DIV renders in the right spot, etc.)

d.



 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts-DisplayTag(partial list)

2007-03-12 Thread Paul Benedict

Daniel,

 Or we will be querying backend only for the desired 50 records?
 And if so how we take care for sorting, page number etc. ?

Query only what you need. You need to pass information to your data 
layer of what is the starting record plus the number of records you 
want so perhaps you're going to display items 50-75 of 200. Devise a 
plan to do that.


 Can someone give me some example code (what to put in the JSP, the
 action, dao, etc)

You need to construct a method-local class of type PaginatedList and 
populate values about the list:


final YourResults results = ...;
PaginatedList versePage = new PaginatedList() {
public int getFullListSize() {
return results.getTotal();
}

public List getList() {
return results.getMyData();
}

public int getObjectsPerPage() {
return results.getPageSize();
}

public int getPageNumber() {
return page;
}

public String getSearchId() {
return null;
}

public String getSortCriterion() {
return null;
}

public SortOrderEnum getSortDirection() {
return SortOrderEnum.DESCENDING;
}
};

The YourResults object is whatever you have retrieved from your data 
layer. Then stick the object into the request and use it in the name 
attribute of your table. Please see the display tag examples for this:


http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s1] handle exception in processPopulate?

2007-03-12 Thread Paul Benedict

Strachan, Paul wrote:
 I resolved this myself by simply overriding the set(String, Object)
 method in my form, to ignore certain request parameter names that are
 not of type String in my LazyValidatorForm.


If you feel strongly about this, please create a JIRA issue for possible 
enhancement. You may have a good idea worth investigating :)


Paul


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau

I am trying to implement a flood control mechanism to prevent robots
requesting pages after pages at an inhuman rate.

My basic idea is this:
* A FirstInFirstOut List stored in the HttpSession, that records the time of
the user's last 10 requests.
* On each new request, a filter compares the current time with the time of
the 10th previous request.  If not enough time went by, redirect to a delay
page that requires the user to press a Continue button. Pipe the new
request and its time, and pipe out the 10th previous request.

The problem with that design:  in some cases, one single request from the
user will go through the filters several times because of various possible
internal redirects.  But I only want to record the times of the requests
coming directly from the user.

Therefore my question:  Is there a simple straightforward way, from the
filter's point of view, to distinguish between a request that came from
outside (from the user), from an internal request (one that came through a
redirection from ActionMapping to ActionMapping)?


Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Tamas Szabo

Hi,

What servlet api are you using?
Is it at least 2.4?

Tamas


On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:

I am trying to implement a flood control mechanism to prevent robots
requesting pages after pages at an inhuman rate.

My basic idea is this:
* A FirstInFirstOut List stored in the HttpSession, that records the time of
the user's last 10 requests.
* On each new request, a filter compares the current time with the time of
the 10th previous request.  If not enough time went by, redirect to a delay
page that requires the user to press a Continue button. Pipe the new
request and its time, and pipe out the 10th previous request.

The problem with that design:  in some cases, one single request from the
user will go through the filters several times because of various possible
internal redirects.  But I only want to record the times of the requests
coming directly from the user.

Therefore my question:  Is there a simple straightforward way, from the
filter's point of view, to distinguish between a request that came from
outside (from the user), from an internal request (one that came through a
redirection from ActionMapping to ActionMapping)?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau

Yes, I believe it is 2.4.

Also:
Struts 1.3.5
Tomcat 6.0.9

2007/3/12, Tamas Szabo [EMAIL PROTECTED]:


Hi,

What servlet api are you using?
Is it at least 2.4?

Tamas


On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:
 I am trying to implement a flood control mechanism to prevent robots
 requesting pages after pages at an inhuman rate.

 My basic idea is this:
 * A FirstInFirstOut List stored in the HttpSession, that records the
time of
 the user's last 10 requests.
 * On each new request, a filter compares the current time with the time
of
 the 10th previous request.  If not enough time went by, redirect to a
delay
 page that requires the user to press a Continue button. Pipe the new
 request and its time, and pipe out the 10th previous request.

 The problem with that design:  in some cases, one single request from
the
 user will go through the filters several times because of various
possible
 internal redirects.  But I only want to record the times of the requests
 coming directly from the user.

 Therefore my question:  Is there a simple straightforward way, from the
 filter's point of view, to distinguish between a request that came from
 outside (from the user), from an internal request (one that came through
a
 redirection from ActionMapping to ActionMapping)?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [S2] ModelDriven, Preparable and SessionAware do not work with Spring

2007-03-12 Thread Shih Lee

Hi All,

I managed to achieve what I wanted by using Struts 2 interceptor without
having Spring aoping the action class through dynamic proxy. Here is the
updated example.xml:

!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;

struts

constant name=struts.objectFactory value=spring /

package name=example namespace=/example extends=struts-default

interceptors
interceptor name=timeLoggingInterceptor
class=interceptor.TimeLoggingInterceptor/
/interceptors

default-interceptor-ref name=defaultStack/
   
action name=helloWorld class=example.HelloWorld
result/example/HelloWorld.jsp/result
/action

action name=Login_* method={1} class=example.Login
result name=input/example/Login.jsp/result
result type=redirect-actionMenu/result
/action

action name=Menu class=Menu
result/example/Menu.jsp/result
interceptor-ref name=defaultStack/
interceptor-ref name=timeLoggingInterceptor/
/action

action name=* class=example.ExampleSupport
result/example/{1}.jsp/result
/action

!-- Add actions here --
/package
/struts


An updated TimeLoggingInterceptor.java:

package interceptor;

import org.apache.log4j.Logger;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class TimeLoggingInterceptor extends AbstractInterceptor {

protected final Logger logger = Logger.getLogger(getClass());

public String intercept(ActionInvocation invocation) throws Exception {

long startTime = System.currentTimeMillis();

String result = invocation.invoke();

long endTime = System.currentTimeMillis();

logger.info(MenuAction: Time took =  + (endTime - startTime) 
+  ms);

return result;
}
}

So, I think it is better to go through the framework interceptor (Struts 2)
to aop the action class instead of using Spring interceptor. For other
purpooses, we can use Spring interceptors.

Thanks http://www.nabble.com/file/7125/applicationContext.xml
applicationContext.xml ,
Lee


Shih Lee wrote:
 
 
 Hi All,
 
 I think I know what is the trouble but am still not sure why is this a
 problem for Struts 2.0. I hope someone from the Struts community can help
 to
 shed some light.
 
 The problem is when I use
 org.springframework.aop.framework.ProxyFactoryBean to AOP the Action
 class. Once I remove the AOP piece such as the following, everything work
 just fine:
 
 !--bean id=Menu
 class=org.springframework.aop.framework.ProxyFactoryBean
   property name=proxyInterfaces
   valueexample.IMenu/value
   /property
   property name=interceptorNames
   list
   valuetimeLoggingAdvisor/value
   /list
   /property
   property name=target
   ref local=MenuTarget/
   /property
   /bean
   
   bean id=MenuTarget class=example.Menu singleton=false/--
   
   bean id=Menu class=example.Menu singleton=false/
 
 Any help is appreciated!
 
 Thanks,
 Lee
 
 
 Shih Lee wrote:
 
  Hi All,
 
 I have been playing with Struts 2.0 sample application, struts-blank, and
 integrates it with Spring 2.x. So far, I have not been having great
 success
 with it.
 
 
 
 I have followed all the steps needed to integrate Struts 2.0 with Spring
 2.0.
 Here is what I have done so far:
 
 1) Included struts2-spring-plugin-2.0.6.jar, spring.jar,
 struts2-core-2.0.6.jar and the dependent jars.
 
 2) Modified the example.xml to include spring object factory:
 
!DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts
 Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;
 
struts
 
   constant name=struts.objectFactory value=spring /
   package name=example namespace=/example
 extends=struts-default
 
   default-interceptor-ref name=defaultStack/
 
 action name=helloWorld class=helloWorld
 result/example/HelloWorld.jsp/result
 /action
 
 action name=Login_* method={1} class=example.Login
 result name=input/example/Login.jsp/result
 result type=redirect-actionMenu/result
 /action
 
 action name=Menu class=Menu
 result/example/Menu.jsp/result
 /action
 
 action name=* class=example.ExampleSupport
 result/example/{1}.jsp/result
 /action
 
 !-- Add actions here --
 /package
 
 /struts
 
 3) I have edited the spring 

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Tamas Szabo

Have a look at the documentation of the dispatcherType at
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd.

Then you can use dispatcher elements in your filter mappings
(filter-mappingType in the same xsd) to fire your filter just for
requests but not for forwards.

I pressume that by internal redirects in your initial mail you mean
forwards. Is this true?

Hope this helps,

Tamas


On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:

Yes, I believe it is 2.4.

Also:
Struts 1.3.5
Tomcat 6.0.9

2007/3/12, Tamas Szabo [EMAIL PROTECTED]:

 Hi,

 What servlet api are you using?
 Is it at least 2.4?

 Tamas


 On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:
  I am trying to implement a flood control mechanism to prevent robots
  requesting pages after pages at an inhuman rate.
 
  My basic idea is this:
  * A FirstInFirstOut List stored in the HttpSession, that records the
 time of
  the user's last 10 requests.
  * On each new request, a filter compares the current time with the time
 of
  the 10th previous request.  If not enough time went by, redirect to a
 delay
  page that requires the user to press a Continue button. Pipe the new
  request and its time, and pipe out the 10th previous request.
 
  The problem with that design:  in some cases, one single request from
 the
  user will go through the filters several times because of various
 possible
  internal redirects.  But I only want to record the times of the requests
  coming directly from the user.
 
  Therefore my question:  Is there a simple straightforward way, from the
  filter's point of view, to distinguish between a request that came from
  outside (from the user), from an internal request (one that came through
 a
  redirection from ActionMapping to ActionMapping)?
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau

2007/3/13, Tamas Szabo [EMAIL PROTECTED]:


Have a look at the documentation of the dispatcherType at
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd.



Thank you, I'll take a look.


I pressume that by internal redirects in your initial mail you mean

forwards. Is this true?



Sometimes forwards, and sometimes redirects.


Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Paul Benedict
There is no technical difference between a user request and a redirect, 
because the redirect causes a second user request.


If you're interested in knowing whether the action is being called as a 
forward, there are standard request attributes which the Container sets. 
For a forward it is javax.servlet.forward.request_uri and for an 
include it is javax.servlet.include.request_uri


Paul

Tamas Szabo wrote:

Have a look at the documentation of the dispatcherType at
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd.

Then you can use dispatcher elements in your filter mappings
(filter-mappingType in the same xsd) to fire your filter just for
requests but not for forwards.

I pressume that by internal redirects in your initial mail you mean
forwards. Is this true?

Hope this helps,

Tamas


On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:

Yes, I believe it is 2.4.

Also:
Struts 1.3.5
Tomcat 6.0.9

2007/3/12, Tamas Szabo [EMAIL PROTECTED]:

 Hi,

 What servlet api are you using?
 Is it at least 2.4?

 Tamas


 On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote:
  I am trying to implement a flood control mechanism to prevent robots
  requesting pages after pages at an inhuman rate.
 
  My basic idea is this:
  * A FirstInFirstOut List stored in the HttpSession, that records the
 time of
  the user's last 10 requests.
  * On each new request, a filter compares the current time with the 
time

 of
  the 10th previous request.  If not enough time went by, redirect to a
 delay
  page that requires the user to press a Continue button. Pipe 
the new

  request and its time, and pipe out the 10th previous request.
 
  The problem with that design:  in some cases, one single request from
 the
  user will go through the filters several times because of various
 possible
  internal redirects.  But I only want to record the times of the 
requests

  coming directly from the user.
 
  Therefore my question:  Is there a simple straightforward way, 
from the
  filter's point of view, to distinguish between a request that came 
from
  outside (from the user), from an internal request (one that came 
through

 a
  redirection from ActionMapping to ActionMapping)?
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]