RE: File upload using DynaActionForm/SynaValidatorForm

2006-11-29 Thread Mano Chinthaka Dasanayaka
HI,
Ok...But I'm Using IBM Web sphere 5.1 Server..
So is there any server specific settings to enable file uploading via
SSL...??
Thanks In advance

Regards,
Mano

-Original Message-
From: Chris Searle [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 28, 2006 7:50 PM
To: Struts Users Mailing List
Subject: Re: File upload using DynaActionForm/SynaValidatorForm

Mano Chinthaka Dasanayaka wrote:
 Hi, 
 
 Any way ...this will not work through SSL
 
 I used this to an APP and worked fine in HTTP 
 
 But failed when HTTPS...
 
 Can you please have a look into this too...Thanks.

Worked fine for me. We have apache2 sitting serving via SSL and talking
AJP13 to jboss on localhost (well - the tomcat instance inside jboss) -
and it uploads the file just fine.

-- 
Chris Searle
[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]



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Thank u Chris,
I will try that !
Do u have a solution for number 1) ?


Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

Extra remark all CSS and JS files will be cached by the browser, so
including CSS in all webpages does not decrease the performance.

On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:

Thank u Chris,
I will try that !
Do u have a solution for number 1) ?




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



Re: Does Struts 2 solve the action chaining problem?

2006-11-29 Thread Yujun Liang

To solve the action chaining problem, I wrote a subclass of
RequestProcessor. In the subclass, override some templates method. In the
last method of process(), I set a flag in request, and I check for this flag
in some methods and if the flag is there, it means it is the chained action
and the processor will skip those template methods.

I think at least the following methods don't need to be executed in the
chained actions,
processHeader
processLocale,
processPopulate,
processValidate,

I solved the action chaining problem by extending the RequestProcessor, and
it also improved the performance.

For version 1.2.9

Regards

On 11/29/06, Craig McClanahan [EMAIL PROTECTED] wrote:


On 11/28/06, Tarek Nabil [EMAIL PROTECTED] wrote:

 Hi,

 One of the problems with Struts was that if you had a page that requires
 some setup and this page submits to an Action, then you would not be
 able to set validate to true on that action because if validation
 problems occur then Struts will take you directly to the input JSP
 without performing the setup and your JSP wouldn't work.

 A solution to that would be to specify the input of the action as the
 setup action, which means you're doing action chaining and Struts is not
 good at that (it will reset your form among other things).

 The solution of choice for us so far was to call validate() ourselves in
 the action and if a validation problem occurs then we call the setup
 method (eventually you start using your action methods as an API which
 still was not good).

 Another problematic scenario is the case when you're editing some
 database record for example. When you go to your setup action for the
 first time, you will populate drop down lists for example, and then load
 the existing values from the database to your JSP fields. If the user
 attempts to save and some problem occurs then in the setup action, you
 will need to again populate the drop down lists, but you will NOT want
 to overwrite the user's inputs with the existing data. This is very
 similar to the first problem, but you would also need to pass some flag
 to the setup method to tell it whether to copy the data from the
 database to your ActionForm.

 Does Struts 2 or even WW 2.2.4 solve that problem in an elegant way? I
 remember coming across something about using Interceptors for that, but
 that would mean creating an Interceptor for almost every action of that
 type. I also noticed that there are some warnings in the documentation
 against using action chaining in Struts 2 as well.


Interceptors are an O-O oriented approach to this kind of issue, but there
are ligther weight alternatives. For the particular need of a setup
action, consider the use of the Preparable interface in Struts 2.  It's
pretty similar to what the Tiles Controller interface supported in
Struts
1.x ... a chance for your business logic to set up the stuff that is
needed
for rendering a particular view.

If you're looking at JSF as a view technology, you'll likely be interested
in what Shale http://shale.apache.org/; has to offer, particularly in
the
View Controller feature.  Not only does the View Controller functionality
support the setup scenario (via the prerender() callback method on the
ViewController interface), it also supports cleaning up *after* the view
has
been rendered, via the destroy() callback.

Craig





--
Yujun Liang
[EMAIL PROTECTED]


Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

They will be cached if the user 'surf' on the webpage,
if I have thousand pages, and he may see two pages,
i am going to store 1000's css files in his cache.

2006/11/29, Mark Bakker [EMAIL PROTECTED]:


Extra remark all CSS and JS files will be cached by the browser, so
including CSS in all webpages does not decrease the performance.

On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
 Thank u Chris,
 I will try that !
 Do u have a solution for number 1) ?



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




Design

2006-11-29 Thread Michel Van Asten
Hi,

We have to developp a new application and we want to with a good design.

Basically we have a set of functionalities (user management, user data control, 
user data conversion, ...) the availabilty of those functionalities is 
controlled via a dynamic menu.


Hi planned to define one action for each functionality. 
But for the menu whats the best solution ?

I see two solutions :

1° Adding an extra action for the menu and implement Action chaining if I need 
to jump back to the menu.
2° All the actions extends a base class wich implement menu management routine 
and I use global forward.

Regards,

Michel Van Asten


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



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

Ohh like that... guess I miss read something :,) if this is the
case I would not use the header tile how you defined it... is it then
not more sensible to create several header tiles, I like JSP that are
still more or less readable as HTML without the magic things in
config files.

ofcourse you can also go for  Chris route.


On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:

They will be cached if the user 'surf' on the webpage,
if I have thousand pages, and he may see two pages,
i am going to store 1000's css files in his cache.

2006/11/29, Mark Bakker [EMAIL PROTECTED]:

 Extra remark all CSS and JS files will be cached by the browser, so
 including CSS in all webpages does not decrease the performance.

 On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
  Thank u Chris,
  I will try that !
  Do u have a solution for number 1) ?
 
 

 -
 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: Design

2006-11-29 Thread Mark Bakker

I would not implement a menu using Actions. You can use a CSS to
define your menu. In my opinion using struts actions just to go from
one url to the next is a bit overkill. tiles is also a good solution
to the menu problem.

On 11/29/06, Michel Van Asten [EMAIL PROTECTED] wrote:

Hi,

We have to developp a new application and we want to with a good design.

Basically we have a set of functionalities (user management, user data control, 
user data conversion, ...) the availabilty of those functionalities is 
controlled via a dynamic menu.


Hi planned to define one action for each functionality.
But for the menu whats the best solution ?

I see two solutions :

1° Adding an extra action for the menu and implement Action chaining if I need 
to jump back to the menu.
2° All the actions extends a base class wich implement menu management routine 
and I use global forward.

Regards,

Michel Van Asten


-
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, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Mark,

I don't understand your solution,
It's the first time I try to implement Tiles,
Could u tell me what *you* would do ?
U mean making more than one base layout ?
And in my jsp pages insert different base layouts ?

2006/11/29, Mark Bakker [EMAIL PROTECTED]:


Ohh like that... guess I miss read something :,) if this is the
case I would not use the header tile how you defined it... is it then
not more sensible to create several header tiles, I like JSP that are
still more or less readable as HTML without the magic things in
config files.

ofcourse you can also go for  Chris route.


On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
 They will be cached if the user 'surf' on the webpage,
 if I have thousand pages, and he may see two pages,
 i am going to store 1000's css files in his cache.

 2006/11/29, Mark Bakker [EMAIL PROTECTED]:
 
  Extra remark all CSS and JS files will be cached by the browser, so
  including CSS in all webpages does not decrease the performance.
 
  On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
   Thank u Chris,
   I will try that !
   Do u have a solution for number 1) ?
  
  
 
  -
  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: Design

2006-11-29 Thread Michel
Thanks for the answer

Maybe my question was not so clear...
But the question is where should I put the code to update the dynamic menu. 

Kind Regards,

-Original Message-
From: Mark Bakker [mailto:[EMAIL PROTECTED] 
Sent: mercredi 29 novembre 2006 11:19
To: Struts Users Mailing List
Subject: Re: Design

I would not implement a menu using Actions. You can use a CSS to
define your menu. In my opinion using struts actions just to go from
one url to the next is a bit overkill. tiles is also a good solution
to the menu problem.

On 11/29/06, Michel Van Asten [EMAIL PROTECTED] wrote:
 Hi,

 We have to developp a new application and we want to with a good design.

 Basically we have a set of functionalities (user management, user data
control, user data conversion, ...) the availabilty of those functionalities
is controlled via a dynamic menu.


 Hi planned to define one action for each functionality.
 But for the menu whats the best solution ?

 I see two solutions :

 1° Adding an extra action for the menu and implement Action chaining if I
need to jump back to the menu.
 2° All the actions extends a base class wich implement menu management
routine and I use global forward.

 Regards,

 Michel Van Asten


 -
 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]



RE: Design

2006-11-29 Thread David Pinho (Hexadecimal)
Have you looked into Struts Menu?
It has a declarative approach where you can specify menus in xml but also a 
taglib that may allow you to build them dynamically.
It's pretty nifty.
Regarding the navigation, I'd stick with the first solution you pointed out.
Using inheritance seems a bit overkill plus it reduces the decoupling between 
your actions (suppose you want to use them outside of the menu context).

David

-Original Message-
From: Michel Van Asten [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 29 de Novembro de 2006 9:53
To: Struts Users Mailing List
Subject: Design

Hi,

We have to developp a new application and we want to with a good design.

Basically we have a set of functionalities (user management, user data control, 
user data conversion, ...) the availabilty of those functionalities is 
controlled via a dynamic menu.


Hi planned to define one action for each functionality. 
But for the menu whats the best solution ?

I see two solutions :

1° Adding an extra action for the menu and implement Action chaining if I need 
to jump back to the menu.
2° All the actions extends a base class wich implement menu management routine 
and I use global forward.

Regards,

Michel Van Asten


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



AVISO

Esta mensagem e quaisquer anexos seus podem conter informação confidencial para 
uso exclusivo do destinatário. Cabe ao destinatário assegurar a verificação de 
vírus e outras medidas que assegurem que esta mensagem não afecta os seus 
sistemas. Se não for o destinatário, não deverá usar, distribuir ou copiar este 
e-mail, devendo proceder à sua eliminação e informar o emissor. É estritamente 
proibido o uso, a distribuição, a cópia ou qualquer forma de disseminação não 
autorizada deste e-mail e seus anexos. Obrigado.

DISCLAIMER
This e-mail and its attachments may contain confidential information for 
exclusive use of its recipient. It is your responsibility to carry out 
appropriate virus and other checks to ensure that this message and any 
attachments do not affect your systems / data. If you are not the intended 
recipient you must not use, distribute or reproduce this e-mail and you must 
notify the sender and delete the entire email. Any unauthorized use, 
dissemination, distribution or copying of this message and its attachments is 
strictly prohibited. Thank You.

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



RE: Themes and templates

2006-11-29 Thread Juan Espinosa
Thanks mark for your help, i will give a try to your advices

Regards Juan

-Mensaje original-
De: Mark Shifman [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 28 de Noviembre de 2006 05:20 p.m.
Para: Struts Users Mailing List
Asunto: Re: Themes and templates

If you set
struts.ui.theme=simple in the struts.properties file you won't fight with
the templates and it will be sort of like good old struts 1.

However, there are other gotchas in store.  You have to get validation
errors on the screen yourself using s:fielderror/ since the theme cleverly
puts the validation errors next to the invalid fields but not with simple.
This is how I have done it but there is probably a better way:
s:if test=hasErrors()
h3span style=color:red; font-weight:boldValidation
Error/span/h3
s:actionerror/
s:fielderror/
/s:if
The hasErrors() comes from the value stack from you action that extended
ActionSupport.

But this didn't really answer your question of how to make themes and
templates work for you :(.


Juan Espinosa wrote:
 Hi to all, im building an struts2 based application and i dont understan
the
 concept of themes an templates. In the past i used struts 1, and in the
view
 i used jsp tags and struts tags like iterate and others.
  
 Now in the application that im buildin i use tags provided by struts like
 s:action s:include s:iterator,  s:form etc. the problem started when i was
 using the radio button tag that renders radio buttons based on a list. The
 buttons are put side by side... and i want to put one below the other
  
 label radio1 label radio2 (now)
  
 label radio1
 label radio2 (mi needs)
  
 I want to know if render of buttons tables forms and other tags are based
on
 this templates..and how i could change it
  
 Regards
  
 Juan
  
  
  
  
  

   


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [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]



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

I think if you have so many kb CSS files in your system, the best
solution is not make one tile over the complete header. In stead you
could create header tiles for subsets what re-use the same CSS files.
You could name them something like this

header-home.jsp (including home.css text-block.css etc etc)
header-shop.jsp (including shop.css, item.css, etc, etc)
and more

this approach will result in fewer CSS downloads at one page load.

I hope this is more clear... I don't know if this is a smart thing to
do in your situation. downloading 100Kb CSS is not a performance
bottle neck. In most cases the CSS files will be zipped and transfered
to the client. Transfering files in .zip must be turned on your
webserver.

Again if you have several Mb's of CSS files it is maybee interesting
to do something about it, otherwise just stick with your original
approuch.

On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:

Mark,

I don't understand your solution,
It's the first time I try to implement Tiles,
Could u tell me what *you* would do ?
U mean making more than one base layout ?
And in my jsp pages insert different base layouts ?

2006/11/29, Mark Bakker [EMAIL PROTECTED]:

 Ohh like that... guess I miss read something :,) if this is the
 case I would not use the header tile how you defined it... is it then
 not more sensible to create several header tiles, I like JSP that are
 still more or less readable as HTML without the magic things in
 config files.

 ofcourse you can also go for  Chris route.


 On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
  They will be cached if the user 'surf' on the webpage,
  if I have thousand pages, and he may see two pages,
  i am going to store 1000's css files in his cache.
 
  2006/11/29, Mark Bakker [EMAIL PROTECTED]:
  
   Extra remark all CSS and JS files will be cached by the browser, so
   including CSS in all webpages does not decrease the performance.
  
   On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
Thank u Chris,
I will try that !
Do u have a solution for number 1) ?
   
   
  
   -
   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]



Re: Does Struts 2 solve the action chaining problem?

2006-11-29 Thread Mark Menard
On 11/29/06 12:44 AM, Tarek Nabil [EMAIL PROTECTED] wrote:

 One of the problems with Struts was that if you had a page that requires
 some setup and this page submits to an Action, then you would not be
 able to set validate to true on that action because if validation
 problems occur then Struts will take you directly to the input JSP
 without performing the setup and your JSP wouldn't work.

Yes, that can be an issue in Struts 1, as far as I know, but then again I
never did serious Struts 1 development.

As for S2 it's not an issue. With a reasonably configured interceptor stack
and the use of the Preparable interface the issue doesn't exist.
 
 A solution to that would be to specify the input of the action as the
 setup action, which means you're doing action chaining and Struts is not
 good at that (it will reset your form among other things).

I haven't found a need for chaining yet in my S2 development. Using the
prepare() method has sufficed for me.
 
 The solution of choice for us so far was to call validate() ourselves in
 the action and if a validation problem occurs then we call the setup
 method (eventually you start using your action methods as an API which
 still was not good).

Agreed, it would be nice if it just happened. You can do this in S2.
Basically I have my interceptor stack configured to apply parameters to my
action, run prepare, apply parameters again, then validate, then execute.
All very neat.
 
 Another problematic scenario is the case when you're editing some
 database record for example. When you go to your setup action for the
 first time, you will populate drop down lists for example, and then load
 the existing values from the database to your JSP fields. If the user
 attempts to save and some problem occurs then in the setup action, you
 will need to again populate the drop down lists, but you will NOT want
 to overwrite the user's inputs with the existing data. This is very
 similar to the first problem, but you would also need to pass some flag
 to the setup method to tell it whether to copy the data from the
 database to your ActionForm.

Again I think the well configured interceptor stack has you covered. If you
apply parameters after your prepare the users input will over write the
values you've retrieved from the database, thereby preserving their input.

Alternatively you could prepare the model once for the duration of the
users interaction with a process by storing the data in the user's
session, or in a conversation scope (cf. JIRA WW-1514 for an idea on how to
do this, note this interceptor/interface is not done yet, nor is it
official).
 
 Does Struts 2 or even WW 2.2.4 solve that problem in an elegant way? I
 remember coming across something about using Interceptors for that, but
 that would mean creating an Interceptor for almost every action of that
 type. I also noticed that there are some warnings in the documentation
 against using action chaining in Struts 2 as well.

Can't speak to the chaining issues. But as I've written I think you can
solve the whole issue using the Prepareable interface and a well configured
interceptor stack. Also, remember that you don't need to use the same stack
for every action. You can apply interceptor stacks at the action and package
level. That makes it pretty easy to manage.

Take care,

Mark

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



RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Dave Newton
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 (interestingly, in IE I get a syntax error, because it's trying to 
 interpret the markup as script, but in FF it just quietly doesn't 
 work, not even a notice in Firebug).

Something else interesting in FF:

eval(foobar/foo/bar)

XML tag name mismatch

eval(foo)

unexpected end of XML source

Dave


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



RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Dave Newton
How about not having so many bloody CSS files?

 -Original Message-
 From: Thomas Thomas [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 29, 2006 4:43 AM
 To: Struts Users Mailing List
 Subject: Re: Struts Tiles, Lose of Performance ? :-(
 
 They will be cached if the user 'surf' on the webpage,
 if I have thousand pages, and he may see two pages,
 i am going to store 1000's css files in his cache.
 
 2006/11/29, Mark Bakker [EMAIL PROTECTED]:
 
  Extra remark all CSS and JS files will be cached by the browser, so
  including CSS in all webpages does not decrease the performance.
 
  On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
   Thank u Chris,
   I will try that !
   Do u have a solution for number 1) ?
  
  
 
  
 -
  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: Design

2006-11-29 Thread Martin Gainty
A struts 1.x solution would be to include generic edit* mappingThis example 
employs wildcard characters for Naming Action Classes,specifying Form 
Name,Forwarded 
pathhttp://struts.apache.org/1.2.9/userGuide/building_controller.html!-- 
Generic edit* mapping implemented with action path=/SomeName* --!-- Note 
the use of parameters for consructing name of Action Classes e.g. 
EditAAction,EditBAction --!-- Note the ability to select a specific Form 
based on the parameter passed in AForm, BForm --!-- Note the capability of 
forwarding to specific jsp based on parameter passed in as in A.jsp,B.jsp--
action
path=/edit*
type=org.apache.struts.webapp.example.Edit{1}Action
name={1}Form
scope=request
validate=false
forward 
name=failure 
path=/mainMenu.jsp/
forward 
name=success 
path=/{1}.jsp/
/actionAnyone else?Martin --This e-mail communication and any attachments may 
contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: David Pinho (Hexadecimal) [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 5:55 AM
Subject: RE: Design


Have you looked into Struts Menu?
It has a declarative approach where you can specify menus in xml but also a 
taglib that may allow you to build them dynamically.
It's pretty nifty.
Regarding the navigation, I'd stick with the first solution you pointed out.
Using inheritance seems a bit overkill plus it reduces the decoupling between 
your actions (suppose you want to use them outside of the menu context).

David

-Original Message-
From: Michel Van Asten [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 29 de Novembro de 2006 9:53
To: Struts Users Mailing List
Subject: Design

Hi,

We have to developp a new application and we want to with a good design.

Basically we have a set of functionalities (user management, user data control, 
user data conversion, ...) the availabilty of those functionalities is 
controlled via a dynamic menu.


Hi planned to define one action for each functionality. 
But for the menu whats the best solution ?

I see two solutions :

1° Adding an extra action for the menu and implement Action chaining if I need 
to jump back to the menu.
2° All the actions extends a base class wich implement menu management routine 
and I use global forward.

Regards,

Michel Van Asten


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



AVISO

Esta mensagem e quaisquer anexos seus podem conter informação confidencial para 
uso exclusivo do destinatário. Cabe ao destinatário assegurar a verificação de 
vírus e outras medidas que assegurem que esta mensagem não afecta os seus 
sistemas. Se não for o destinatário, não deverá usar, distribuir ou copiar este 
e-mail, devendo proceder à sua eliminação e informar o emissor. É estritamente 
proibido o uso, a distribuição, a cópia ou qualquer forma de disseminação não 
autorizada deste e-mail e seus anexos. Obrigado.

DISCLAIMER
This e-mail and its attachments may contain confidential information for 
exclusive use of its recipient. It is your responsibility to carry out 
appropriate virus and other checks to ensure that this message and any 
attachments do not affect your systems / data. If you are not the intended 
recipient you must not use, distribute or reproduce this e-mail and you must 
notify the sender and delete the entire email. Any unauthorized use, 
dissemination, distribution or copying of this message and its attachments is 
strictly prohibited. Thank You.

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



Re: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Martin Gainty
I haven't seen Ajax functionality embedded in Struts so I provided the solution 
as the classic 5 min qd solution
I wholeheartedly agree that JavaScript and any 'pseudolanguage' that ends 
with Script should be avoided at all costs!

Thanks Frank,

M-
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: Frank W. Zammetti [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 12:49 AM
Subject: Re: Struts, AJAX, JSP, and JavaScript question


 That will only work if the response is nothing but JavaScript, in which 
 case your 100% correct (although many people say that eval() should be 
 renamed evil() and should be avoided like the plague... I'm not *quite* 
 that extreme in my avoidance of it).
 
 As a quick proof:
 
 html
   head
   script
 var s = ;
 //s +=  + html + ;
 //s +=  + head + ;
 //s +=  + script + ;
 s += alert('test');;
 //s +=  + /script + ;
 //s +=  + /head + ;
 //s +=  + body + ;
 //s += Hello;
 //s +=  + /body + ;
 //s +=  + /html + ;
 function testit() {
   eval(s);
 }
   /script
   /head
   body
 The Body
 input type=button value=testit onclick=testit();
   /body
 /html
 
 Load this file in your browser and you'll find that you get an alert, as 
 expected... now, uncomment the commented lines and reload and you'll see 
 that it no longer pops the alert (interestingly, in IE I get a syntax 
 error, because it's trying to interpret the markup as script, but in FF 
 it just quietly doesn't work, not even a notice in Firebug).
 
 So, if the idea is to execute script blocks that are part of an HTML 
 response, a simple eval() won't work... but if all your returning is 
 script, then I definitely echo Chris' suggestion and would go with 
 eval() (regardless of who wants to slap your hand with a ruler).
 
 Frank
 
 
 Chris Pratt wrote:
 Or you could just call eval(ajax.responseText).
  (*Chris*)
 
 On 11/28/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:

 Hi Adam,

 If your doing straight AJAX yourself, i.e., directly interacting with the
 XMLHttpRequest object, this won't execute script for you automatically.
 In fact, it won't do much of anything for you automatially, aside from
 parsing XML if that's your return type.  Otherwise, it's just text to the
 object and you'll have to execute scripts yourself.

 Another poster gave you some info if your using S2, but I'm guessing by
 your description your using S1.  In that case, continue reading! :)

 The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
 you... you can certainly switch over to using APT, but if you just want
 some code to execute scripts, take a look here:


 http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup
  


 Down around line 313 you'll find the execScripts() function... simply 
 yank
 that out and use it on the responseText from XMLHttpRequest and you'll be
 good to go.

 If you are interested in looking at APT, here's a link:


 http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html
  


 And for JWP in general:

 http://javawebparts.sourceforge.net

 Hth,
 Frank


 -- 
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM/Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
 Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, November 28, 2006 3:43 pm, Adam Gordon wrote:
  I have a JSP and there's a link in the rendered page that makes an AJAX
  call
  (to a Struts action) when clicked.  The results of that action, and the
  contents of the response are set as the innerHTML on a hidden div
  defined
  inside the afore mentioned rendered page.  The div is then un-hid.
 
  Everything is working correctly except for one part:  When the div is
  displayed, the JavaScript code in the contents returned by the AJAX 
 call
  isn't being executed and thus, the contents of the div aren't set up
  correctly.
 
  Does anyone know a way to have the JavaScript be executed?  Or force 
 the
  browser to execute it?
 
  I used to have an iframe and everything worked great, but there was a
  bad
  side effect with session timeouts and so we've decided to not use them.
 
  Any help would be appreciated.  Thanks.
 
  -Adam
 
 


 

Re: Does Struts 2 solve the action chaining problem?

2006-11-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tarek,

Tarek Nabil wrote:
 One of the problems with Struts was that if you had a page that requires
 some setup and this page submits to an Action, then you would not be
 able to set validate to true on that action because if validation
 problems occur then Struts will take you directly to the input JSP
 without performing the setup and your JSP wouldn't work.
 
 A solution to that would be to specify the input of the action as the
 setup action, which means you're doing action chaining and Struts is not
 good at that (it will reset your form among other things).
 
 The solution of choice for us so far was to call validate() ourselves in
 the action and if a validation problem occurs then we call the setup
 method (eventually you start using your action methods as an API which
 still was not good).

I totally disagree. If you have an action that you want to use like
this, you can always set up two different mappings -- one that /does/
validate and another that does /not/ validate.

My experience has been that Struts is very good at action chaining...
in fact, that's the major advantage of Struts in the first place: the
ability to map URIs to actions and specify their relationships through
forward mappings.

 Another problematic scenario is the case when you're editing some
 database record for example. When you go to your setup action for the
 first time, you will populate drop down lists for example, and then load
 the existing values from the database to your JSP fields. If the user
 attempts to save and some problem occurs then in the setup action, you
 will need to again populate the drop down lists, but you will NOT want
 to overwrite the user's inputs with the existing data. This is very
 similar to the first problem, but you would also need to pass some flag
 to the setup method to tell it whether to copy the data from the
 database to your ActionForm.

In this case, what you want is something like:

LoadAction - EditAction - Display form

Form submits to SaveAction, which has EditAction as input (not LoadAction).

This is pretty standard stuff, and works beautifully.

 Does Struts 2 or even WW 2.2.4 solve that problem in an elegant way?

I really hope so, since Struts 1.x also does.

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

iD8DBQFFbYyx9CaO5/Lv0PARArpHAJ0U3fHybMWepSZxPjciDU3+6M2PwQCgoy8B
FRlfdQsyONpgqGvrHBuZuFw=
=EbD/
-END PGP SIGNATURE-

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



RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Chris Loschen
Perhaps I'm missing something -- I don't know that much about JS and less about 
Ajax -- but these error messages look like they're exactly right to me. In the 
first case, you're starting element foo, then element bar, then ending element 
foo before you end the child element bar. That's ill-formed XML, and one way of 
describing that is as an XML tag name mismatch. In the second case, you've 
got a start element tag but no end element tag, so the XML parser would reach 
the end of the evaluated document without the close to element foo and you'd 
get exactly what you did get -- unexpected end of XML source.

I wonder about what Frank wrote -- his example would have been well-formed XML, 
but its root element was html, so it wouldn't have been valid in the place in 
the document where it was being evaluated because the DTD for HTML and/or XHTML 
only allows a single html root element, not a child html element under that. 
I'm not sure if eval is supposed to be producing an entire page of html 
separate from the surrounding document, but it doesn't look that way since you 
can also eval fragments and code which doesn't include any tags at all. If 
you're not supposed to be evaluating an entirely separate page, I would guess 
that you would need to eval the code which needs to appear in the head section 
of the document and the code which needs to appear in the body separately.

Not sure if that makes sense -- still waking up this morning. Hope it helps.

Chris

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 29, 2006 7:49 AM
To: Struts Users Mailing List
Subject: RE: Struts, AJAX, JSP, and JavaScript question

From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 (interestingly, in IE I get a syntax error, because it's trying to 
 interpret the markup as script, but in FF it just quietly doesn't 
 work, not even a notice in Firebug).

Something else interesting in FF:

eval(foobar/foo/bar)

XML tag name mismatch

eval(foo)

unexpected end of XML source

Dave


-
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]



Form not found for locale 'en_US' warning message

2006-11-29 Thread kumar.vinodh

 
Hi all,

I am seeing the below warning message whenever form bean is accessed.

WARN  [ValidatorResources] Form 'callcontrolForm' not found for locale
'en_US'

In struts-config.xml I have

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml/
set-property property=stopOnFirstError value=true / /plug-in


This was a known bug in 1.2.9 version,
http://issues.apache.org/bugzilla/show_bug.cgi?id=38081

But ver 1.3.5 claimed to fix this bug. 

Even after migrating to 1.3.5 version, I am seeing the warning messages
getting printed in the console. 

Do I need to modify some files manually for this??? 


I am not using the validation framework for struts, but still the
warning message is thrown for all the request made to server. As I am
polling the server frequently console is flooded with this warning
message.


Is it necessary to include validator plug-in in strutsconfig.xml , when
the validation framework is not used?

Your help and guidance on the same is very much appreciated.

Thanks,
Vinodh



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.
 
www.wipro.com

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



RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Dave Newton
From: Chris Loschen [mailto:[EMAIL PROTECTED]
 Perhaps I'm missing something 

Yes; that eval evaluates *javascript*.

Dave


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



RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Dave Newton
From: Dave Newton [mailto:[EMAIL PROTECTED]
 From: Chris Loschen [mailto:[EMAIL PROTECTED]
  Perhaps I'm missing something
 
 Yes; that eval evaluates *javascript*.

...generally.

In FireBug if you eval(bbaz/b) in the console it will print a bold
baz.

Dave


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



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

my idea:D

On 11/29/06, Dave Newton [EMAIL PROTECTED] wrote:

How about not having so many bloody CSS files?

 -Original Message-
 From: Thomas Thomas [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 29, 2006 4:43 AM
 To: Struts Users Mailing List
 Subject: Re: Struts Tiles, Lose of Performance ? :-(

 They will be cached if the user 'surf' on the webpage,
 if I have thousand pages, and he may see two pages,
 i am going to store 1000's css files in his cache.

 2006/11/29, Mark Bakker [EMAIL PROTECTED]:
 
  Extra remark all CSS and JS files will be cached by the browser, so
  including CSS in all webpages does not decrease the performance.
 
  On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
   Thank u Chris,
   I will try that !
   Do u have a solution for number 1) ?
  
  
 
  
 -
  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]



Re: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Musachy Barroso
You will save a lot of time if you use something that is done already, 
and tested, like the links provided by Frank. If you still want to try 
it yourself you can check Bind.js :


http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=markup

musachy

Frank W. Zammetti wrote:

Hi Adam,

If your doing straight AJAX yourself, i.e., directly interacting with the
XMLHttpRequest object, this won't execute script for you automatically. 
In fact, it won't do much of anything for you automatially, aside from

parsing XML if that's your return type.  Otherwise, it's just text to the
object and you'll have to execute scripts yourself.

Another poster gave you some info if your using S2, but I'm guessing by
your description your using S1.  In that case, continue reading! :)

The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this for
you... you can certainly switch over to using APT, but if you just want
some code to execute scripts, take a look here:

http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup

Down around line 313 you'll find the execScripts() function... simply yank
that out and use it on the responseText from XMLHttpRequest and you'll be
good to go.

If you are interested in looking at APT, here's a link:

http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html

And for JWP in general:

http://javawebparts.sourceforge.net

Hth,
Frank


  



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



Re: Struts 2 / AJax : Ajax with Freemarker examples

2006-11-29 Thread Musachy Barroso
On the next release(2.0.2), Dojo 0.4 will be included and we have some 
ajax tags to help with the ajax stuff, like remote link, remote 
button, and autocompleter(still working on it), a tabbed control (we 
had one before), and an ajaxed Div.


regards
musachy

hanasaki wrote:

I have the luxury of using any/current versions.  Ask? I asked here...

==
Subject:
Re: Struts 2 / AJax : Ajax with Freemarker examples
From:
Musachy Barroso [EMAIL PROTECTED]
Date:
Tue, 28 Nov 2006 09:55:26 -0500
To:
Struts Users Mailing List user@struts.apache.org

What version are you using? It doesn't seem to be much documentation
about struts + ajax, but feel free to ask. There is a video and an slide
presentation here:
http://cwiki.apache.org/S2WIKI/articles-and-press.html, but I think the
video link is broken.

-
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, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Mark,
what are u calling header ?
Really I don't understand your solution,

How about not having so many bloody CSS files?

How ?



2006/11/29, Mark Bakker [EMAIL PROTECTED]:


my idea:D

On 11/29/06, Dave Newton [EMAIL PROTECTED] wrote:
 How about not having so many bloody CSS files?

  -Original Message-
  From: Thomas Thomas [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, November 29, 2006 4:43 AM
  To: Struts Users Mailing List
  Subject: Re: Struts Tiles, Lose of Performance ? :-(
 
  They will be cached if the user 'surf' on the webpage,
  if I have thousand pages, and he may see two pages,
  i am going to store 1000's css files in his cache.
 
  2006/11/29, Mark Bakker [EMAIL PROTECTED]:
  
   Extra remark all CSS and JS files will be cached by the browser, so
   including CSS in all webpages does not decrease the performance.
  
   On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:
Thank u Chris,
I will try that !
Do u have a solution for number 1) ?
   
   
  
   
  -
   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]




[OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Dave Newton
From: Thomas Thomas [mailto:[EMAIL PROTECTED]
  How about not having so many bloody CSS files?
 How ?

Delete some?

Seriously; why are your styles so spread out? Don't you have a
consistent style (perhaps with minor differences) for the site? Why does
each page/section need its own?

Dave


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



Re: [OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Because if I have a lot of pages, and a page has a error in its layout,
I can easily find the code because I have separate css files for each file.
If I have a common CSS for all the pages, I think the code will be long ...
I must say i'm not sure about what I'm doing, what do u think of my
arguments ?

2006/11/29, Dave Newton [EMAIL PROTECTED]:


From: Thomas Thomas [mailto:[EMAIL PROTECTED]
  How about not having so many bloody CSS files?
 How ?

Delete some?

Seriously; why are your styles so spread out? Don't you have a
consistent style (perhaps with minor differences) for the site? Why does
each page/section need its own?

Dave


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




Re: [OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

well header is your naming

On 11/28/06, Thomas Thomas [EMAIL PROTECTED] wrote:

div id=base_header
tiles:insert attribute=header/
/div


more info about CSS you can find here:

http://www.w3schools.com/css/default.asp

On 11/29/06, Dave Newton [EMAIL PROTECTED] wrote:

From: Thomas Thomas [mailto:[EMAIL PROTECTED]
  How about not having so many bloody CSS files?
 How ?

Delete some?

Seriously; why are your styles so spread out? Don't you have a
consistent style (perhaps with minor differences) for the site? Why does
each page/section need its own?

Dave


-
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: [OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Dave Newton
From: Thomas Thomas [mailto:[EMAIL PROTECTED]
 what do u think of my arguments ?

I think you have too many CSS files :)

I've seen sites with maybe 2-3, but if your site pages are supposed to
look the same you might want to consolidate all your style information
to avoid duplicating information.

What is so different about each page that you have to have all those
files? If the answer is very little then you might want to reconsider.

If the answer is a lot then... you might not be using CSS in the way
(I think :) it was intended, or you may just be a special case :)

Dave


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



Re: [OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Mark Bakker

well the idea of CSS is to separate styling from the actual web page...

how you implemented it you are mis-using CSS... look to all mayor
websites.. they all using one CSS file. may bee you can find the code
easily, but you need to fix the same bug on several places.

With your strategy you could just use plane HTML.

On 11/29/06, Mark Bakker [EMAIL PROTECTED] wrote:

well header is your naming

On 11/28/06, Thomas Thomas [EMAIL PROTECTED] wrote:
 div id=base_header
 tiles:insert attribute=header/
 /div

more info about CSS you can find here:

http://www.w3schools.com/css/default.asp

On 11/29/06, Dave Newton [EMAIL PROTECTED] wrote:
 From: Thomas Thomas [mailto:[EMAIL PROTECTED]
   How about not having so many bloody CSS files?
  How ?

 Delete some?

 Seriously; why are your styles so spread out? Don't you have a
 consistent style (perhaps with minor differences) for the site? Why does
 each page/section need its own?

 Dave


 -
 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: [OT] RE: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Yes, I think you are right,
I'm doing this all wrong :-(

I can't include jsp's in a static way with Tiles ?

Before Tiles I used dynamic includes and static includes,
I will lose some eprformance here because with Tiles it is only dynamic.


2006/11/29, Dave Newton [EMAIL PROTECTED]:


From: Thomas Thomas [mailto:[EMAIL PROTECTED]
 what do u think of my arguments ?

I think you have too many CSS files :)

I've seen sites with maybe 2-3, but if your site pages are supposed to
look the same you might want to consolidate all your style information
to avoid duplicating information.

What is so different about each page that you have to have all those
files? If the answer is very little then you might want to reconsider.

If the answer is a lot then... you might not be using CSS in the way
(I think :) it was intended, or you may just be a special case :)

Dave


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




Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Antonio Petrelli

Thomas Thomas ha scritto:

Yes, I think you are right,
I'm doing this all wrong :-(

I can't include jsp's in a static way with Tiles ?


Use jsp:include or [EMAIL PROTECTED] instead. Using Tiles does not mean that 
you cannot use standard tags.


Ciao
Antonio

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



Re: struts-html question.... puzzling problem...

2006-11-29 Thread maya
thank you all very much for your help..  finally got it to work w/struts 
1.1 (I had tried earlier version before, but 1.2.9, since hadn't been 
able to find 1.1)


now need to deal w/WAR-file thing, unfortunately don't know how to 
unpack/deploy WAR files..  I tried about a year ago to learn to use WAR 
files, couldn't get it to work.. there is indeed a 
struts-documentation.war in the 1.1 download..  found WAR-file 
instructions for example here, 
http://www.jguru.com/faq/view.jsp?EID=123229, but it's for tomcat 3.2.. 
I hope this will work on Tomcat 5.5 (since struts 1.1 is rather old..) 
can I assume url for docs then will be struts-documentation/index.jsp?


how exactly does this WAR-thing work???  :) again, thank you very much..



Wendy Smoak wrote:

On 11/28/06, maya [EMAIL PROTECTED] wrote:


thank you very much..  downloaded lib and src downloads..  when
unzipped, found that all files under docs are xmls not htmls..


You're probably looking at the source of the html pages, which is xml.

The documentation is inside struts-documentation.war, which you can
deploy to a servlet container, or just unzip somewhere.


wonder also if there's an equiv. to this pg for 1.3.5...
http://struts.apache.org/1.3.5/struts-taglib/tlddoc/index.html


  http://struts.apache.org/1.1/userGuide/

 From the menu, under Developer Guides, choose a tag library, then
either the API Reference (above) or the Package Description.




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



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

Ah 

Well I could have a layout thanks to Tiles which would be inherited by the
pages,
and just use jsp:include or [EMAIL PROTECTED] then ...
What's the advantage of having tiles:insert attribute=header/ ? Finally
it's just the fact that the name of the page is not hardcoded in the
application, but in the XML file instead.

2006/11/29, Antonio Petrelli [EMAIL PROTECTED]:


Thomas Thomas ha scritto:
 Yes, I think you are right,
 I'm doing this all wrong :-(

 I can't include jsp's in a static way with Tiles ?

Use jsp:include or [EMAIL PROTECTED] instead. Using Tiles does not mean that
you cannot use standard tags.

Ciao
Antonio

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




RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Frank W. Zammetti
Yeah, those messages make sense I think... I guess FF realizes that your
trying to eval something that's purely markup and tries to parse it as
XML... incorrect nesting of the tags in the first case makes sense for
that message, as no closing tag makes sense for the second, if it were
trying to parse it.  I guess maybe it examines the contents your eval'ing
and differentiates between pure markup and script?  Interesting!

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Wed, November 29, 2006 7:48 am, Dave Newton wrote:
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 (interestingly, in IE I get a syntax error, because it's trying to
 interpret the markup as script, but in FF it just quietly doesn't
 work, not even a notice in Firebug).

 Something else interesting in FF:

 eval(foobar/foo/bar)

 XML tag name mismatch

 eval(foo)

 unexpected end of XML source

 Dave


 -
 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]



[OT] RE: Re: struts-html question.... puzzling problem...

2006-11-29 Thread Dave Newton
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
 how exactly does this WAR-thing work???

This may not be your best approach to learning JEE.

Have you considered getting a book that discusses JEE and moving on to
Struts from there?

Dave


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



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Antonio Petrelli

Thomas Thomas ha scritto:

Ah 

Well I could have a layout thanks to Tiles which would be inherited by 
the

pages,
and just use jsp:include or [EMAIL PROTECTED] then ...
What's the advantage of having tiles:insert attribute=header/ ? 
Finally

it's just the fact that the name of the page is not hardcoded in the
application, but in the XML file instead.


So what do you need? A statically-included JSP page or something else?

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



RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Dave Newton
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 I guess maybe it examines the contents your eval'ing
 and differentiates between pure markup and script?  Interesting!

It must be; I didn't know it would do that.

My first thought (here, by thought I mean hope) was that FF had made
XML into a first-class language construct :D

Dave

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



Re: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Frank W. Zammetti
On Wed, November 29, 2006 8:30 am, Martin Gainty wrote:
 I wholeheartedly agree that JavaScript and any 'pseudolanguage' that
 ends with Script should be avoided at all costs!

Wait, don't put those words in my mouth :)  I said some people consider
eval() to be bad, not scripting languages... I have no problem with
scripting languages when used correctly (and I'm not as fanatical about
avoiding eval() as some people are). :)

Frank



 Thanks Frank,

 M-
 This e-mail communication and any attachments may contain confidential and
 privileged information for the use of the
 designated recipients named above. If you are not the intended recipient,
 you are hereby notified that you have received
 this communication in error and that any review, disclosure,
 dissemination, distribution or copying of it or its
 contents
 - Original Message -
 From: Frank W. Zammetti [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wednesday, November 29, 2006 12:49 AM
 Subject: Re: Struts, AJAX, JSP, and JavaScript question


 That will only work if the response is nothing but JavaScript, in which
 case your 100% correct (although many people say that eval() should be
 renamed evil() and should be avoided like the plague... I'm not *quite*
 that extreme in my avoidance of it).

 As a quick proof:

 html
   head
   script
 var s = ;
 //s +=  + html + ;
 //s +=  + head + ;
 //s +=  + script + ;
 s += alert('test');;
 //s +=  + /script + ;
 //s +=  + /head + ;
 //s +=  + body + ;
 //s += Hello;
 //s +=  + /body + ;
 //s +=  + /html + ;
 function testit() {
   eval(s);
 }
   /script
   /head
   body
 The Body
 input type=button value=testit onclick=testit();
   /body
 /html

 Load this file in your browser and you'll find that you get an alert, as
 expected... now, uncomment the commented lines and reload and you'll see
 that it no longer pops the alert (interestingly, in IE I get a syntax
 error, because it's trying to interpret the markup as script, but in FF
 it just quietly doesn't work, not even a notice in Firebug).

 So, if the idea is to execute script blocks that are part of an HTML
 response, a simple eval() won't work... but if all your returning is
 script, then I definitely echo Chris' suggestion and would go with
 eval() (regardless of who wants to slap your hand with a ruler).

 Frank


 Chris Pratt wrote:
 Or you could just call eval(ajax.responseText).
  (*Chris*)

 On 11/28/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:

 Hi Adam,

 If your doing straight AJAX yourself, i.e., directly interacting with
 the
 XMLHttpRequest object, this won't execute script for you
 automatically.
 In fact, it won't do much of anything for you automatially, aside
 from
 parsing XML if that's your return type.  Otherwise, it's just text to
 the
 object and you'll have to execute scripts yourself.

 Another poster gave you some info if your using S2, but I'm guessing
 by
 your description your using S1.  In that case, continue reading! :)

 The AjaxParts Taglib (APT) in Java Web Parts (JWP) takes care of this
 for
 you... you can certainly switch over to using APT, but if you just
 want
 some code to execute scripts, take a look here:


 http://javawebparts.cvs.sourceforge.net/javawebparts/javawebparts/WEB-INF/src/javawebparts/ajaxparts/taglib/resources/AjaxPartsTaglib.js?view=markup


 Down around line 313 you'll find the execScripts() function... simply
 yank
 that out and use it on the responseText from XMLHttpRequest and you'll
 be
 good to go.

 If you are interested in looking at APT, here's a link:


 http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html


 And for JWP in general:

 http://javawebparts.sourceforge.net

 Hth,
 Frank


 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM/Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
 Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

 On Tue, November 28, 2006 3:43 pm, Adam Gordon wrote:
  I have a JSP and there's a link in the rendered page that makes an
 AJAX
  call
  (to a Struts action) when clicked.  The results of that action, and
 the
  contents of the response are set as the innerHTML on a hidden div
  defined
  inside the afore mentioned rendered page.  The div is then
 un-hid.
 
  Everything is working correctly except for one part:  When the div
 is
  displayed, the JavaScript code in the contents returned by the AJAX
 call
  isn't being executed and thus, the contents of the div aren't set
 up
  correctly.
 
  Does anyone know a way to have the JavaScript be executed?  Or force
 the
  browser to execute it?
 
  I used to have an iframe and everything worked 

RE: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Frank W. Zammetti
Yeah, can't say I knew it either :)

One would assume then that what you ge back from eval()'ing valid XML is a
Document object that you can then use DOM methods on, just as you do in IE
if you get responseXML from XMLHttpRequest (assuming it was in fact an XML
response)... that'd be pretty close to first-class language construct :)

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Wed, November 29, 2006 10:38 am, Dave Newton wrote:
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 I guess maybe it examines the contents your eval'ing
 and differentiates between pure markup and script?  Interesting!

 It must be; I didn't know it would do that.

 My first thought (here, by thought I mean hope) was that FF had made
 XML into a first-class language construct :D

 Dave

 -
 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: Form not found for locale 'en_US' warning message

2006-11-29 Thread Niall Pemberton

On 11/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:


Hi all,

I am seeing the below warning message whenever form bean is accessed.

WARN  [ValidatorResources] Form 'callcontrolForm' not found for locale
'en_US'

In struts-config.xml I have

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
value=/WEB-INF/validator-rules.xml/
set-property property=stopOnFirstError value=true / /plug-in


This was a known bug in 1.2.9 version,
http://issues.apache.org/bugzilla/show_bug.cgi?id=38081

But ver 1.3.5 claimed to fix this bug.


Well the warning was only a bug in certain circumstances (when
rendering only the static javascript) - in other circumstances its
still a valid warning and gets produceda and means you don't have
things configured properly.


Even after migrating to 1.3.5 version, I am seeing the warning messages
getting printed in the console.

Do I need to modify some files manually for this???


I am not using the validation framework for struts, but still the
warning message is thrown for all the request made to server. As I am
polling the server frequently console is flooded with this warning
message.


I don't understand - above you have the struts-config.xml showing
you've configured validator - but you say you're not using it? This
doesn't make sense to me.


Is it necessary to include validator plug-in in strutsconfig.xml , when
the validation framework is not used?


No don't configure it and don't use any of the validator flavour
ActionForms and you shouldn't get the warning message.

Niall


Your help and guidance on the same is very much appreciated.

Thanks,
Vinodh


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



Re: [OT] RE: Re: struts-html question.... puzzling problem...

2006-11-29 Thread maya
thank you very much for your help..  I'm a developer, mostly front-end 
(but very experienced) also know Java programming (and JSP/back-end), I 
started learning Java about three years ago and I like programming a 
lot.. know very well how to use Tomcat, servlets, etc..


started a new job a few months ago where I use struts, I have no 
problems at work, since deal mostly w/front-end (custom tags, etc..) but 
since I also have an interest in programing, and do have back-end 
experience, want to learn struts from the ground up, i.e., want to be 
able to create a complete app from scratch w/struts (write the classes, 
everything..) and thus as a learning exercise want to write my own 
little CMS with struts for uploading/displaying photos (could do this 
every easily in way I'm used to, namely putting all processing code in 
JSP itself, but do want to learn how to do it with struts..)


the WAR-file thing has really eluded me.. but now have no choice but 
learn how to deal w/it since otherwise won't be able to look @ docs for 
struts 1.1


would appreciate some suggestions.. thank you very much..


Dave Newton wrote:

From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
how exactly does this WAR-thing work???


This may not be your best approach to learning JEE.

Have you considered getting a book that discusses JEE and moving on to
Struts from there?

Dave



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



RE: Re: [OT] RE: Re: struts-html question.... puzzling problem...

2006-11-29 Thread Dave Newton
From: news [mailto:[EMAIL PROTECTED] On Behalf Of maya
 the WAR-file thing has really eluded me.. 

http://www.google.com/search?q=war+file

1) http://access1.sun.com/techarticles/simple.WAR.html
2) http://en.wikipedia.org/wiki/WAR_(file_format)

Dave


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



Newbie question about using beans in html:link tags

2006-11-29 Thread priya

I am trying to use Struts for an account creation application


  1. In my JSP page I am using a List (named results) to get account
  information (name, id and more.. )
  2. The list stores this information in an AccountInfo bean and I am
  using a for loop to go through the List.
  3. I am using a Map to pass values to the next Action and I was
  wondering if I can use the AccountInfo Bean instead since it has all the
  information?
  4. I am not using a use:bean tag and just creating it as seen below
  (AccountInfo ai = (AccountInfo) results.get(count);)



 %
   for (int count = 0; count  results.size; count++) {
   AccountInfo ai = (AccountInfo) results.get(count);
 %

tr
   td%=ai.getLname()%, %=ai.getFname()% /td
   td%=ai.getUsername()%/td
   td%=ai.getId()%/td


 %java.util.HashMap map =new java.util.HashMap();
   map.put(firstName, String.valueOf(ai.getFname()));
   map.put(lastName, String.valueOf(ai.getLname()));
   map.put(userName, String.valueOf(ai.getUsername()));
   pageContext.setAttribute(map,map);%

   td width=3%
   html:link page=/showCreate.do name=mapimg
src=images/acct.jpg width=16 height=20 border=0 title=Create
Account/html:link
   /td
/tr

 %}%

Any suggestions?
Priya


RE: Newbie question about using beans in html:link tags

2006-11-29 Thread Asthana, Rahul
Would you mind using jstl?
c:url value=/showCreate.do var=url
c:param name=firstName value=${ai.getFname()}/
c:param name=lastName value=${ai.getLname()}/
/c:url
Caveat: I havent used it myself.But I remember having come across code like 
that.
AFAIK, html:link doesnt support passing multiple params except by a Map.

-Original Message-
From: priya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 29, 2006 3:25 PM
To: Struts Users Mailing List
Subject: Newbie question about using beans in html:link tags


I am trying to use Struts for an account creation application


   1. In my JSP page I am using a List (named results) to get account
   information (name, id and more.. )
   2. The list stores this information in an AccountInfo bean and I am
   using a for loop to go through the List.
   3. I am using a Map to pass values to the next Action and I was
   wondering if I can use the AccountInfo Bean instead since it has all the
   information?
   4. I am not using a use:bean tag and just creating it as seen below
   (AccountInfo ai = (AccountInfo) results.get(count);)



  %
for (int count = 0; count  results.size; count++) {
AccountInfo ai = (AccountInfo) results.get(count);
  %

 tr
td%=ai.getLname()%, %=ai.getFname()% /td
td%=ai.getUsername()%/td
td%=ai.getId()%/td


  %java.util.HashMap map =new java.util.HashMap();
map.put(firstName, String.valueOf(ai.getFname()));
map.put(lastName, String.valueOf(ai.getLname()));
map.put(userName, String.valueOf(ai.getUsername()));
pageContext.setAttribute(map,map);%

td width=3%
html:link page=/showCreate.do name=mapimg
src=images/acct.jpg width=16 height=20 border=0 title=Create
Account/html:link
/td
 /tr

  %}%

Any suggestions?
Priya

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



Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Thomas Thomas

I'm trying to understand Tiles ...

Instead of this :
** tiles-defs.xml **
 definition name=.base page=/layout/base.jsp
   put  name=header   value=/incl/header/header.jsp/
   put  name=info value=/incl/info/info.jsp/
   put  name=menu_top value=/incl/menu_top/menu_top.html/
   put  name=menu_left
value=/incl/menu_left/menu_left.jsp/
   put  name=center value=/incl/blank.jsp/
   put  name=footer   value=/incl/footer/footer.jsp/
 /definition

** base.jsp **
body id=base_body
   div id=base_header
   tiles:insert attribute=header/
   /div
   div id=base_info
   tiles:insert attribute=info/
   /div
   [...]

I could have this :

** tiles-defs.xml **
 definition name=.base page=/layout/base.jsp
 /definition

** base.jsp **
body id=base_body
   div id=base_header
   [EMAIL PROTECTED] page=incl/header.jsp %
   /div
   div id=base_info
   jsp:include page=incl/info.jsp.jsp/
   /div
   [...]

What's the advantage of using tiles:insert attribute=header/ instead of
the jsp includes.


Re: Newbie question about using beans in html:link tags

2006-11-29 Thread priya

Hi Rahul,

I was trying to reduce the amount of code if its possible (?) since the
action would display a jsp page with account information and then the user
would review the information  submit another action to finally create the
account.

Since I already have all the information in a bean I was hoping on getting
to know how to use beans instead of having to set attributes seperately.. I
have a lot of attributes to set other than name, id, etc...all this will be
passed around quite a lot..

Priya




On 11/29/06, Asthana, Rahul [EMAIL PROTECTED] wrote:


Would you mind using jstl?
c:url value=/showCreate.do var=url
c:param name=firstName value=${ai.getFname()}/
c:param name=lastName value=${ai.getLname()}/
/c:url
Caveat: I havent used it myself.But I remember having come across code
like that.
AFAIK, html:link doesnt support passing multiple params except by a Map.

-Original Message-
From: priya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 29, 2006 3:25 PM
To: Struts Users Mailing List
Subject: Newbie question about using beans in html:link tags


I am trying to use Struts for an account creation application


   1. In my JSP page I am using a List (named results) to get account
   information (name, id and more.. )
   2. The list stores this information in an AccountInfo bean and I am
   using a for loop to go through the List.
   3. I am using a Map to pass values to the next Action and I was
   wondering if I can use the AccountInfo Bean instead since it has all
the
   information?
   4. I am not using a use:bean tag and just creating it as seen below
   (AccountInfo ai = (AccountInfo) results.get(count);)



  %
for (int count = 0; count  results.size; count++) {
AccountInfo ai = (AccountInfo) results.get(count);
  %

 tr
td%=ai.getLname()%, %=ai.getFname()% /td
td%=ai.getUsername()%/td
td%=ai.getId()%/td


  %java.util.HashMap map =new java.util.HashMap();
map.put(firstName, String.valueOf(ai.getFname()));
map.put(lastName, String.valueOf(ai.getLname()));
map.put(userName, String.valueOf(ai.getUsername()));
pageContext.setAttribute(map,map);%

td width=3%
html:link page=/showCreate.do name=mapimg
src=images/acct.jpg width=16 height=20 border=0 title=Create
Account/html:link
/td
 /tr

  %}%

Any suggestions?
Priya

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




RE: Newbie question about using beans in html:link tags

2006-11-29 Thread Asthana, Rahul
Priya,
As a short term solution you can create a new tag,as in myLibrary:link which 
derives from html:link and knows how to deal with AccountInfo bean. 
But if I may,I would suggest rethinking the architecture of your application, 
as in maintaining the AccountInfo object in session instead of passing it 
through URL encoding.
Cheers
Rahul


-Original Message-
From: priya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 29, 2006 4:23 PM
To: Struts Users Mailing List
Subject: Re: Newbie question about using beans in html:link tags


Hi Rahul,

I was trying to reduce the amount of code if its possible (?) since the
action would display a jsp page with account information and then the user
would review the information  submit another action to finally create the
account.

Since I already have all the information in a bean I was hoping on getting
to know how to use beans instead of having to set attributes seperately.. I
have a lot of attributes to set other than name, id, etc...all this will be
passed around quite a lot..

Priya




On 11/29/06, Asthana, Rahul [EMAIL PROTECTED] wrote:

 Would you mind using jstl?
 c:url value=/showCreate.do var=url
 c:param name=firstName value=${ai.getFname()}/
 c:param name=lastName value=${ai.getLname()}/
 /c:url
 Caveat: I havent used it myself.But I remember having come across code
 like that.
 AFAIK, html:link doesnt support passing multiple params except by a Map.

 -Original Message-
 From: priya [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 29, 2006 3:25 PM
 To: Struts Users Mailing List
 Subject: Newbie question about using beans in html:link tags


 I am trying to use Struts for an account creation application


1. In my JSP page I am using a List (named results) to get account
information (name, id and more.. )
2. The list stores this information in an AccountInfo bean and I am
using a for loop to go through the List.
3. I am using a Map to pass values to the next Action and I was
wondering if I can use the AccountInfo Bean instead since it has all
 the
information?
4. I am not using a use:bean tag and just creating it as seen below
(AccountInfo ai = (AccountInfo) results.get(count);)



   %
 for (int count = 0; count  results.size; count++) {
 AccountInfo ai = (AccountInfo) results.get(count);
   %

  tr
 td%=ai.getLname()%, %=ai.getFname()% /td
 td%=ai.getUsername()%/td
 td%=ai.getId()%/td


   %java.util.HashMap map =new java.util.HashMap();
 map.put(firstName, String.valueOf(ai.getFname()));
 map.put(lastName, String.valueOf(ai.getLname()));
 map.put(userName, String.valueOf(ai.getUsername()));
 pageContext.setAttribute(map,map);%

 td width=3%
 html:link page=/showCreate.do name=mapimg
 src=images/acct.jpg width=16 height=20 border=0 title=Create
 Account/html:link
 /td
  /tr

   %}%

 Any suggestions?
 Priya

 -
 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]



validate question ...

2006-11-29 Thread Thomas Thomas

Hi,

My web-application allows a user to authenticate to the website.

I check for login and password with the Validator Framework (correct length,
correct carachters, ...)
Then display with html:errors property=login/ and html:errors
property=password/ in my jsp.
This work ok.

If he the fields are valid, I need to check in my DB if the user is really
subscribed.

1) Where should I do the DB validation ?
2) How do I return the errors to JSP, how do I display the errors in my jsp
?
can I have something similar like : html:errors property=dberror/ or
something like that ?
what's best ?


I have for this a DynaValidatorForm and an Action LoginAction if fields
are correct for the validator :

   form-beans
   form-bean name=loginForm type=
org.apache.struts.validator.DynaValidatorForm
form-property name=login type=java.lang.String /
form-property name=password type=java.lang.String /
   /form-bean
   [...]
   action
   path=/Login
   type=controllers.submits.LoginAction
   name=loginForm
   input=/Error.do
   validate=true
   scope=request
   forward name=index path=/index.jsp/
   forward name=chat path=/chat_form.jsp/
   /action

And my JSP :

   login :
   br/
   html:text property=login size=10/
   !--  span id=txtUsernameMsg
   Le login spécifié est invalide !
   /span--

   html:errors property=login/ --- DISPLAY error if
login is empty

!--
   I WANT TO DISPLAY A MESSAGE HERE IF USER DOESNT EXIST IN
DATABASE, how ?
--

   br/
   mot de passe :
   br/
   html:password property=password size=10/
   !-- span id=txtPasswordMsg
   Le mot de passe spécifié est invalide !
   /span
--
   html:errors property=password/ --- DISPLAY error if
password is empty

   br/


RE: validate question ...

2006-11-29 Thread Scott Purcell
Basically, the way I would envision this, is that the validation framework 
checks to make sure the 'username' and 'password' fields are not NULL, or meet 
some form of low level character count.

Anyway, that is good. What I would do, is continue with that, then after the 
validator says this is acceptable, it should go to your controller. Within the 
controller, you should call a business object with the two fields, username, 
and password. The business object should return a value of success or failure.

If success, set user into session (or whatever) and let them in.

If not, throw a global exception (set a global exception in struts-config.xml) 
and set a message into the request. This should send them back to the login 
screen and they will see a message that the login was NOT successful.

Make sense? I think that is how I used to do it.

Scott





-Original Message-
From: Thomas Thomas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 29, 2006 3:52 PM
To: Struts Users Mailing List
Subject: validate question ...

Hi,

My web-application allows a user to authenticate to the website.

I check for login and password with the Validator Framework (correct length,
correct carachters, ...)
Then display with html:errors property=login/ and html:errors
property=password/ in my jsp.
This work ok.

If he the fields are valid, I need to check in my DB if the user is really
subscribed.

1) Where should I do the DB validation ?
2) How do I return the errors to JSP, how do I display the errors in my jsp
?
can I have something similar like : html:errors property=dberror/ or
something like that ?
what's best ?


I have for this a DynaValidatorForm and an Action LoginAction if fields
are correct for the validator :

form-beans
form-bean name=loginForm type=
org.apache.struts.validator.DynaValidatorForm
 form-property name=login type=java.lang.String /
 form-property name=password type=java.lang.String /
/form-bean
[...]
action
path=/Login
type=controllers.submits.LoginAction
name=loginForm
input=/Error.do
validate=true
scope=request
forward name=index path=/index.jsp/
forward name=chat path=/chat_form.jsp/
/action

And my JSP :

login :
br/
html:text property=login size=10/
!--  span id=txtUsernameMsg
Le login spécifié est invalide !
/span--

html:errors property=login/ --- DISPLAY error if
login is empty

!--
I WANT TO DISPLAY A MESSAGE HERE IF USER DOESNT EXIST IN
DATABASE, how ?
--

br/
mot de passe :
br/
html:password property=password size=10/
!-- span id=txtPasswordMsg
Le mot de passe spécifié est invalide !
/span
 --
html:errors property=password/ --- DISPLAY error if
password is empty

br/

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



Re: validate question ...

2006-11-29 Thread paz . periasamy
Do the DB validation in:
controllers.submits.LoginAction (execute) method.

The error handling should be:

If DB validation fails, create Action Error or Message and then pass it 
back to the JSP as a failure.

The Error tags should be able to display it. If you use html:errors/ you 
dont have to manage individual html:error tags.

Thanks and regards,
Pazhanikanthan. P (Paz)

Consultant for AXA,
Senior Software Engineer,
HCL Australia Services Pty. Ltd.
Off   : +61-3-9618-4085
Mob : +61-0411-354-838




Thomas Thomas [EMAIL PROTECTED]
30/11/2006 08:52 AM
Please respond to Struts Users Mailing List
 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:validate question ...


Hi,

My web-application allows a user to authenticate to the website.

I check for login and password with the Validator Framework (correct 
length,
correct carachters, ...)
Then display with html:errors property=login/ and html:errors
property=password/ in my jsp.
This work ok.

If he the fields are valid, I need to check in my DB if the user is really
subscribed.

1) Where should I do the DB validation ?
2) How do I return the errors to JSP, how do I display the errors in my 
jsp
?
can I have something similar like : html:errors property=dberror/ or
something like that ?
what's best ?


I have for this a DynaValidatorForm and an Action LoginAction if 
fields
are correct for the validator :

form-beans
form-bean name=loginForm type=
org.apache.struts.validator.DynaValidatorForm
 form-property name=login type=java.lang.String /
 form-property name=password type=java.lang.String /
/form-bean
[...]
action
path=/Login
type=controllers.submits.LoginAction
name=loginForm
input=/Error.do
validate=true
scope=request
forward name=index path=/index.jsp/
forward name=chat path=/chat_form.jsp/
/action

And my JSP :

login :
br/
html:text property=login size=10/
!--  span id=txtUsernameMsg
Le login spécifié est invalide !
/span--

html:errors property=login/ --- DISPLAY error if
login is empty

!--
I WANT TO DISPLAY A MESSAGE HERE IF USER DOESNT EXIST IN
DATABASE, how ?
--

br/
mot de passe :
br/
html:password property=password size=10/
!-- span id=txtPasswordMsg
Le mot de passe spécifié est invalide !
/span
 --
html:errors property=password/ --- DISPLAY error 
if
password is empty

br/

_ 
This e-mail has been scanned for viruses by MCI's Internet Managed 
Scanning Services - powered by MessageLabs. For further information 
visit http://www.mci.com

*
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
**


Validator without Struts

2006-11-29 Thread Jim Reynolds

Hello,

I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?

Thanks

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



Re: Validator without Struts

2006-11-29 Thread Jon Wilmoth
You can try http://jakarta.apache.org/commons/validator/ which is commonly used 
w/Struts 1.


- Original Message 
From: Jim Reynolds [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Wednesday, November 29, 2006 2:21:49 PM
Subject: Validator without Struts


Hello,

I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?

Thanks

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

Re: validate question ...

2006-11-29 Thread Martin Gainty
+1
Here is One example complete with configuration for data-source
http://www.roseindia.net/struts/strutsdatasourcemanagerontomcat5.shtml

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 5:01 PM
Subject: Re: validate question ...


Do the DB validation in:
controllers.submits.LoginAction (execute) method.

The error handling should be:

If DB validation fails, create Action Error or Message and then pass it 
back to the JSP as a failure.

The Error tags should be able to display it. If you use html:errors/ you 
dont have to manage individual html:error tags.

Thanks and regards,
Pazhanikanthan. P (Paz)

Consultant for AXA,
Senior Software Engineer,
HCL Australia Services Pty. Ltd.
Off   : +61-3-9618-4085
Mob : +61-0411-354-838




Thomas Thomas [EMAIL PROTECTED]
30/11/2006 08:52 AM
Please respond to Struts Users Mailing List
 
To: Struts Users Mailing List user@struts.apache.org
cc: 
Subject:validate question ...


Hi,

My web-application allows a user to authenticate to the website.

I check for login and password with the Validator Framework (correct 
length,
correct carachters, ...)
Then display with html:errors property=login/ and html:errors
property=password/ in my jsp.
This work ok.

If he the fields are valid, I need to check in my DB if the user is really
subscribed.

1) Where should I do the DB validation ?
2) How do I return the errors to JSP, how do I display the errors in my 
jsp
?
can I have something similar like : html:errors property=dberror/ or
something like that ?
what's best ?


I have for this a DynaValidatorForm and an Action LoginAction if 
fields
are correct for the validator :

form-beans
form-bean name=loginForm type=
org.apache.struts.validator.DynaValidatorForm
 form-property name=login type=java.lang.String /
 form-property name=password type=java.lang.String /
/form-bean
[...]
action
path=/Login
type=controllers.submits.LoginAction
name=loginForm
input=/Error.do
validate=true
scope=request
forward name=index path=/index.jsp/
forward name=chat path=/chat_form.jsp/
/action

And my JSP :

login :
br/
html:text property=login size=10/
!--  span id=txtUsernameMsg
Le login spécifié est invalide !
/span--

html:errors property=login/ --- DISPLAY error if
login is empty

!--
I WANT TO DISPLAY A MESSAGE HERE IF USER DOESNT EXIST IN
DATABASE, how ?
--

br/
mot de passe :
br/
html:password property=password size=10/
!-- span id=txtPasswordMsg
Le mot de passe spécifié est invalide !
/span
 --
html:errors property=password/ --- DISPLAY error 
if
password is empty

br/

_ 
This e-mail has been scanned for viruses by MCI's Internet Managed 
Scanning Services - powered by MessageLabs. For further information 
visit http://www.mci.com

*
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
**


Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Chris Pratt

Well, if you look at my previous response, you can see why they can't do
that.  You're passing dynamic information into the tiles to control how they
are generated, a static include wouldn't work.
 (*Chris*)

On 11/29/06, Thomas Thomas [EMAIL PROTECTED] wrote:


Thank u Chris,
I will try that !
Do u have a solution for number 1) ?




Re: Validator without Struts

2006-11-29 Thread Niall Pemberton

On 11/29/06, Jim Reynolds [EMAIL PROTECTED] wrote:

Hello,

I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(

It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.

I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?


You can use Validator outside Struts, although I haven't actually used
the framework side of validator in that way. If it was just
validation routines you wanted, rather than the framework side then
Commons Validator has this:
   http://tinyurl.com/eahub

If you want to use the framework side then theres info here:
  http://tinyurl.com/ymrjy2
  http://wiki.apache.org/jakarta-commons/Validator

Theres also an example in the source distro, but you'll have to use
ant to build it yourself
  http://wiki.apache.org/jakarta-commons/ValidatorStandalone

Also its worth taking a look at the validator tests (in the source
distro) as they pretty much do standalone validator.

Niall


Thanks


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



Design approach for customized layout and dynamic rendering

2006-11-29 Thread Mel Walker

I need to implement a customized-page feature so the layout and the content of 
the page are defined by user.   I am not sure which approach will be the right 
choice -- easy to implement and extend for the future.  Will you recommend 
Tiles, Struts Layout, or something else?  

I am new to Struts and have not been successful finding the related info on web 
sites so far.  I'll appreciate your input!

Thank you.

 
-
Everyone is raving about the all-new Yahoo! Mail beta.

org.apache.commons.validator not exist

2006-11-29 Thread red phoenix

I compile my Java file,but it raise error:org.apache.commons.validator not
found,I guess I must lost a jar file,but I don't know which jar I
lost,anyone could tell me which jar I need?

Thanks.


RE: org.apache.commons.validator not exist

2006-11-29 Thread shibing.chen
Seems commons-validator.jar, but not sure.
Check out this: http://jakarta.apache.org/commons/validator/

陈仕兵
LifeSystem CS, IT Application Developer
Great Eastern Life Assurance (China) Co. Ltd.
Tel: 86-021-6140 Ext 2405
  86-021-28065394
Fax: 86-23-63885566

-Original Message-
From: red phoenix [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 30, 2006 9:09 AM
To: Struts Users Mailing List
Subject: org.apache.commons.validator not exist

I compile my Java file,but it raise error:org.apache.commons.validator not
found,I guess I must lost a jar file,but I don't know which jar I
lost,anyone could tell me which jar I need?

Thanks.


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



Re: org.apache.commons.validator not exist

2006-11-29 Thread Martin Gainty
Should be inside your struts distro for example Struts 2.0.1 inside the lib 
folder you *should* see common-validator-1.3.0.jar
let us know if ou dont see it
safest place is to place commons-validator*.jar is in 
$CATALINA_BASE/webapps/YourWebApp/WEB-INF/lib

There are also jars available from http://jakarta.apache.org/commons/validator/ 
(but you should take jar from the released distro)

HTH
This e-mail communication and any attachments may contain confidential and 
privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you 
are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, 
distribution or copying of it or its 
contents
- Original Message - 
From: red phoenix [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, November 29, 2006 8:08 PM
Subject: org.apache.commons.validator not exist


I compile my Java file,but it raise error:org.apache.commons.validator not
 found,I guess I must lost a jar file,but I don't know which jar I
 lost,anyone could tell me which jar I need?
 
 Thanks.


Re: Struts, AJAX, JSP, and JavaScript question

2006-11-29 Thread Chris Pratt

eval() evaluates JavaScript, not XML or HTML.
 (*Chris*)

On 11/29/06, Dave Newton [EMAIL PROTECTED] wrote:


From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 (interestingly, in IE I get a syntax error, because it's trying to
 interpret the markup as script, but in FF it just quietly doesn't
 work, not even a notice in Firebug).

Something else interesting in FF:

eval(foobar/foo/bar)

XML tag name mismatch

eval(foo)

unexpected end of XML source

Dave


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




problem in formbean

2006-11-29 Thread prkumar_1234
I got some problem in struts can you please help me.

1) in jsp iam displaying values from javabean in textboxes.(i can
change
these values)
2) when i submit with modified values , iam doing validation in
formbean.
3) When validatio fails i formbean returning to same jsp but it is
displaying old values not modified values

can you give me some hint how to do this.

thank you verymuch


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



Re: problem in formbean

2006-11-29 Thread James Mitchell

Hi, I help moderate messages on this list.  You are not subscribed.  I let
this message through because it is not spam, but you need to subscribe
before any more can come through.

Thanks.

On 11/29/06, prkumar_1234 [EMAIL PROTECTED] wrote:


I got some problem in struts can you please help me.

1) in jsp iam displaying values from javabean in textboxes.(i can
change
these values)
2) when i submit with modified values , iam doing validation in
formbean.
3) When validatio fails i formbean returning to same jsp but it is
displaying old values not modified values

can you give me some hint how to do this.

thank you verymuch


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





--
James Mitchell
678.910.8017


Re: Struts Tiles, Lose of Performance ? :-(

2006-11-29 Thread Antonio Petrelli

Thomas Thomas ha scritto:
What's the advantage of using tiles:insert attribute=header/ 
instead of

the jsp includes.


The reuse of the layout! You can have a simple layout page (e.g. the 
classic layout with header, body, menu (on the left) and footer) with no 
connection with its content.
And you can define a base definition (for example without putting the 
body attribute) and then extend it to create the real definitions.
And with Tiles you can create complex pages, by putting a definition as 
an attribute: so your body can be made of several reusable parts.


HTH
Antonio


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