Re: Organizing action classes

2006-06-08 Thread Frank W. Zammetti

Michael Jouravlev wrote:

Chamal, if you decide to use a dispatch action, I suggest
EventDispatchAction, or ActionEventDispatcher if your action class
must inherit from your custom class. See these links:


Definitely agreed there... this is, to me at least, clearly the best
alternative if you go the Dispatch route.


Michael.


Frank


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



Re: Re: Extending Struts with Spring

2006-06-08 Thread Julian Tillmann

Thank you for your replies!

When I understand this right:
- Giving Actions a state using Spring makes no sence
- It cannot be recommended to overwrite the request processor
  with Spring (we already have our own)
- But the spring Context offers some new possibilites
  like IOC but to be honest I'm not expert enough
  to understand this up to date!

Thanks I watched this example of IBM with the interceptor.
Which other business-cases (aspects) could you reasonable use this way?
Isn't this a performance problem, because interceptors always have
to use refelection? 
 
Thank you!
Julian
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Olivier Bex
According to my java file, the property loginRequired is in a java class
that extends ActionMapping. In addition, the setter and getter methods are
set. Thanks for the help.

Regards,
Olivier. 

-Message d'origine-
De : Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 7 juin 2006 18:50
À : Struts Users Mailing List
Cc : 'Struts Users Mailing List'
Objet : RE: struts-config xml file throws a java exception

I didn't even think set-property was available on action mappings in
1.1, but maybe I'm not remembering right.

Anyway, my understanding of set-property is that it is setting a
property on the *ActionMapping*, and *not* on the Action.  To use it, you
need to subclass ActionMapping and declare that subclass using the
className attribute of the action mapping.

Frank

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!



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



message resources

2006-06-08 Thread Marcus

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Olivier Bex
Hi, 

Here is my form bean declaration : 

form-beans
form-bean name=loginForm type=com.eyrolles.LoginForm /
form-bean name=employeForm type=com.eyrolles.EmployeForm /
  /form-beans

And here is the action form : 
(NB : the other declaration loginForm does not use the loginrequired
property.)

package com.eyrolles.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;

public class EmployeForm extends ActionForm {

  private static final long serialVersionUID = 1L;  
  protected String username;
  protected String password;
  protected String name;
  protected String phone;
  protected String email;
  protected String depid;
  protected String roleid;

  public void setUsername(String username) {

this.username = username;
  }

  public String getUsername() {

return username;
  }

  public void setPassword(String password) {

this.password = password;
  }

  public String getPassword() {

return password;
  }

  public void setName(String name) {

this.name = name;
  }

  public String getName() {

return name;
  }

  public void setPhone(String phone) {

this.phone = phone;
  }

  public String getPhone() {

return phone;
  }

  public void setEmail(String email) {

this.email = email;
  }

  public String getEmail() {

return email;
  }

  public void setDepid(String depid) {

this.depid = depid;
  }

  public String getDepid() {

return depid;
  }

  public void setRoleid(String roleid) {

this.roleid = roleid;
  }

  public String getRoleid() {

return roleid;
  }

  // Cette méthode est appelée par chaque requête. Elle réinitialise les
  // attributs du formulaire avant de copier les données de la nouvelle
requête.
  public void reset(ActionMapping mapping, HttpServletRequest request) {

this.username = ;
this.password = ;
this.name = ;
this.phone = ;
this.email = ;
this.depid = 1;
this.roleid = 1;
  }

  public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

EmployesActionMapping employesMapping =
  (EmployesActionMapping)mapping;

// Cette action nécessite-t-elle l'identification de l'utilisateur ?
if ( employesMapping.isLoginRequired() ) {

  HttpSession session = request.getSession();
  if ( session.getAttribute(USER) == null ) {

// retourner null force l'action à traiter l'erreur de login
return null;
  }
}

if ( (roleid == null ) || (roleid.length() == 0) ) {

  errors.add(roleid, new ActionMessage(errors.roleid.required));
}
if ( (depid == null ) || (depid.length() == 0) ) {

  errors.add(depid, new ActionMessage(errors.depid.required));
}
if ( (email == null ) || (email.length() == 0) ) {

  errors.add(email, new ActionMessage(errors.email.required));
}
if ( (phone == null ) || (phone.length() == 0) ) {

  errors.add(phone, new ActionMessage(errors.phone.required));
}
if ( (name == null ) || (name.length() == 0) ) {

  errors.add(name, new ActionMessage(errors.name.required));
}
if ( (password == null ) || (password.length() == 0) ) {

  errors.add(password, new ActionMessage(errors.password.required));
}
if ( (username == null ) || (username.length() == 0) ) {

  errors.add(username, new ActionMessage(errors.username.required));
}
return errors;
  }
}

-Message d'origine-
De : Samere, Adam J [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 7 juin 2006 19:04
À : Struts Users Mailing List
Objet : RE: struts-config xml file throws a java exception

Can you post the form bean declaration from struts config and the ActionForm
subclass? 


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



RE: message resources

2006-06-08 Thread Mukta
Pass the argument {0} as follows:

bean:message key= myValueAdded  arg0=value/


-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:32 PM
To: Struts Users Mailing List
Subject: message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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: message resources

2006-06-08 Thread Olivier Bex
Hi Marcus,

Where do you want to print this message ?
What type of data do you use ?

Regards,
Olivier

-Message d'origine-
De : Marcus [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 10:02
À : Struts Users Mailing List
Objet : message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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: message resources

2006-06-08 Thread Marcus

Pass the argument {0} as follows:



bean:message key= myValueAdded  arg0=value/



I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable myValue to be printed.
:-(

Marcus

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



Re: message resources

2006-06-08 Thread Marcus

Where do you want to print this message ?

I type in my value into a textbox.
Forward to action.
Action adds value, forwards to jsp.
Now jsp should say:

Value myValue has been added.
(With the value of myValue printed!)


What type of data do you use ?

Strings

Marcus


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



RE: message resources

2006-06-08 Thread Mukta
I'm assuming that there is a key-value pair defined in your
message-resources (.properties) file as follows:

myValueAdded=my value {0} has been added.

And that you want to print a value at location {0} to be passed from some
jsp or some other file.

bean:message key=myValueAdded arg0=value/

Moreover, you can pass upto 5 arguments using arg0, arg1, .., arg4 in the
same manner.

HTH,
Mukta.


-Original Message-
From: Mukta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:40 PM
To: 'Struts Users Mailing List'
Subject: RE: message resources

Pass the argument {0} as follows:

bean:message key= myValueAdded  arg0=value/


-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:32 PM
To: Struts Users Mailing List
Subject: message resources

Hi,

I want to print a message like this:

myValueAdded=my value{0} has been added.

How can I fill in the corresponding value?

Thx,

Marcus

-
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: message resources

2006-06-08 Thread David Delbecq

bean:message key= myValueAdded  arg0=${mybean.value}/
Marcus wrote:

Pass the argument {0} as follows:



bean:message key= myValueAdded  arg0=value/



I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable myValue to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread Mukta
Try using 

bean:message key=myValueAdded arg0=%=myValueAdded%/


-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:28 PM
To: Struts Users Mailing List
Subject: Re: message resources

Pass the argument {0} as follows:

bean:message key= myValueAdded  arg0=value/


I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable myValue to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread Mukta
What do you mean by  Action adds value??
Where does Action add this value?


-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:30 PM
To: Struts Users Mailing List
Subject: Re: message resources

Where do you want to print this message ?
I type in my value into a textbox.
Forward to action.
Action adds value, forwards to jsp.
Now jsp should say:

Value myValue has been added.
(With the value of myValue printed!)

What type of data do you use ?
Strings

Marcus


-
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: message resources

2006-06-08 Thread Olivier Bex
Hi,

What do you have in the java class for the value you want to put in your
message, is it a has table or something else ?

Olivier.

-Message d'origine-
De : Marcus [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 10:58
À : Struts Users Mailing List
Objet : Re: message resources

Pass the argument {0} as follows:

bean:message key= myValueAdded  arg0=value/


I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable myValue to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread Marcus

 bean:message key=myValueAdded arg0=${mybean.value}/

I wrote:
bean:message key=myValueAdded arg0=${myDynaForm.value}/

And it returns literally:
${myDynaForm.value}


What do you have in the java class for the value you want to put in your
message, is it a has table or something else ?


It's all just plain simple.
I store my value in a dynaForm, forward to an action,
compute stuff, forward to to a jsp,
and then I want to print
Value YOURVALUE has been added.


What do you mean by  Action adds value??
Where does Action add this value?


My Action stores the value in a database,
that's basically all it does.
On the jsp, I want to show the user that storing the value
worked, and as a proof I want to redisplay the value the user typed in.


Marcus


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



RE: message resources

2006-06-08 Thread Mukta
In your Action class, add following statements before return statement:

ActionMessages oMsgs = new ActionErrors();
oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage(myValueAdded, actual value));
saveErrors(oRequest.getSession(), oMsgs);

In your jsp, you must be having html:errors /
It will work.



-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 2:44 PM
To: Struts Users Mailing List
Subject: Re: message resources

  bean:message key=myValueAdded arg0=${mybean.value}/

I wrote:
bean:message key=myValueAdded arg0=${myDynaForm.value}/

And it returns literally:
${myDynaForm.value}

What do you have in the java class for the value you want to put in your
message, is it a has table or something else ?

It's all just plain simple.
I store my value in a dynaForm, forward to an action,
compute stuff, forward to to a jsp,
and then I want to print
Value YOURVALUE has been added.

What do you mean by  Action adds value??
Where does Action add this value?

My Action stores the value in a database,
that's basically all it does.
On the jsp, I want to show the user that storing the value
worked, and as a proof I want to redisplay the value the user typed in.


Marcus


-
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: message resources

2006-06-08 Thread Marcus

In your Action class, add following statements before return statement:
ActionMessages oMsgs = new ActionErrors();

oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 

new ActionMessage(myValueAdded, actual value));
saveErrors(oRequest.getSession(), oMsgs);
In your jsp, you must be having html:errors /
It will work.



It's not an error, it's just a message to the user.

Marcus

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



RE: message resources

2006-06-08 Thread Mukta
It will be displayed as a message only.
For code-cleaning purpose, since it gives an incorrect interpretation, you
can achieve the same result by slightly manipulating this code. Try
replacing ActionErrors with ActionMessages
In jsp also, replace html:errors / with html:messages /
It should work.

Actually I had that implementation for error messages in my project. So, I
just sent that code to you :)




-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 3:01 PM
To: Struts Users Mailing List
Subject: Re: message resources

In your Action class, add following statements before return statement:
ActionMessages oMsgs = new ActionErrors();

oMsgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage(myValueAdded, actual value));
saveErrors(oRequest.getSession(), oMsgs);
In your jsp, you must be having html:errors /
It will work.


It's not an error, it's just a message to the user.

Marcus

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



Validation not working for 'double' with Struts 1.2

2006-06-08 Thread antony.paul

Hi all,
  I am trying to validate a field against 'double', In
validation.xml i have specified the validation logic as. 
 field property=fieldName depends=double
  arg0 key=formName.fieldName/
  /field
This is not working, but it will work fine If I change it to' depends
=integer ' instead of double.
In my validatior-rules.xml file I have written the rule as
FOR 'integer'
 validator name=required
classname=org.apache.struts.validator.FieldChecks
   method=validateRequired
   methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
  msg=errors.required/
FOR 'double'
validator name=double
classname=org.apache.struts.validator.FieldChecks
   method=validateDouble
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
  depends=
  msg=errors.double
 jsFunctionName=DoubleValidations/

What I am really curious about is that when its working  fine for 'integer'
why not for 'double'

Thanks
Antony
--
View this message in context: 
http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4769223
Sent from the Struts - User forum at Nabble.com.


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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread The Jasper

What isn't working? Is it not validating properly? Are you getting
some type of exception? Does it accept everything?

You can alway check the source code of FieldChecks to find out what it is doing.

mvg,
Jasper

On 6/8/06, antony.paul [EMAIL PROTECTED] wrote:


Hi all,
  I am trying to validate a field against 'double', In
validation.xml i have specified the validation logic as.
 field property=fieldName depends=double
  arg0 key=formName.fieldName/
  /field
This is not working, but it will work fine If I change it to' depends
=integer ' instead of double.
In my validatior-rules.xml file I have written the rule as
FOR 'integer'
 validator name=required
classname=org.apache.struts.validator.FieldChecks
   method=validateRequired
   methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
  msg=errors.required/
FOR 'double'
validator name=double
classname=org.apache.struts.validator.FieldChecks
   method=validateDouble
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
  depends=
  msg=errors.double
 jsFunctionName=DoubleValidations/

What I am really curious about is that when its working  fine for 'integer'
why not for 'double'

Thanks
Antony
--
View this message in context: 
http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4769223
Sent from the Struts - User forum at Nabble.com.


-
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: message resources

2006-06-08 Thread David Delbecq

Marcus wrote:

 bean:message key=myValueAdded arg0=${mybean.value}/

I wrote:
bean:message key=myValueAdded arg0=${myDynaForm.value}/

And it returns literally:
${myDynaForm.value}


Sorry, thought bean:message was supporting el notation :)

try this

bean:message key=myValueAdded arg0=%=myDynaForm.getValue() %/

It's awfull, but assuming you have myDynaForm in some scope should work

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



Re: message resources

2006-06-08 Thread Marcus

It's awfull, but assuming you have myDynaForm in some scope should work
Yes, indeed! ;-)

Isn't there something more struts like (using tags..)

Marcus

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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread antony.paul

Hi
  Sorry for that incomplete mail. I am not getting any excetption and
that particular field is accepting everthing like characters and getting
saved in the database as '0', I guess thats the default value for that field
because I have defined that corresponding property in the Action Form as a
'Double'

Thanks
Antony
--
View this message in context: 
http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4769709
Sent from the Struts - User forum at Nabble.com.


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



Re: Re: Extending Struts with Spring

2006-06-08 Thread Joe Germuska

At 9:14 AM +0200 6/8/06, Julian Tillmann wrote:

Thank you for your replies!

When I understand this right:
- Giving Actions a state using Spring makes no sence


Not so much makes no sense as doesn't get you anything.  At 
least, once you are used to writing threadsafe actions, you don't see 
as much value.  The value of request-scoped, stateful actions comes 
with a design like that used in WebWork and Struts 2.0, where the 
request parameters are used to populate properties of the Action 
itself, instead of being wrapped in an ActionForm and passed in.



- It cannot be recommended to overwrite the request processor
  with Spring (we already have our own)


This isn't quite true either.  If you're using Struts 1.2.x and 
Spring, there's no reason not to use Spring's 
DelegatingRequestProcessor or DelegatingTilesRequestProcessor -- 
especially since they set you up to use the IOC (see below).  The 
issue is only if you are using Struts 1.3 (or Struts 1.2.x with the 
struts-chain library) -- in this case, since you can only have one 
RequestProcessor, using Spring's will interfere with using the one 
which uses the Chain-of-Responsibility for handling the request. 
However, if you look at what the DelegatingRequestProcessor does 
(remember, this is open source!), it's not hard to write your own 
replacement for the SelectAction command that provides equivalent 
functionality.



- But the spring Context offers some new possibilites
  like IOC but to be honest I'm not expert enough
  to understand this up to date!


This is the Spring feature that I appreciate the most.  Before we 
started using Spring, it was always awkward to make sure that your 
Action classes had references to business support and persistence 
manager classes.  While there are plenty of solutions, all of them 
looked clumsy after we saw how we could use Spring to inject those 
dependencies into the action classes directly.



Thanks I watched this example of IBM with the interceptor.
Which other business-cases (aspects) could you reasonable use this way?
Isn't this a performance problem, because interceptors always have
to use refelection?


Reflection performance has been markedly improved since earlier 
editions of the JVM.  Struts already uses it all over the place 
(specifically for ActionForm population on every request, plus a lot 
of stuff at initialization time.)  Do you have an application which 
needs extremely careful performance tuning?


Joe

--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com


You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new.
-- Robert Moog

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



Re: message resources

2006-06-08 Thread Dave Newton

 From: Marcus [mailto:[EMAIL PROTECTED] 
   
 Value myValue has been added.
 (With the value of myValue printed!)
   

Anyway, you've gotten a lot of... advice.

Mine is to either use a JSP 2.0 container so the original EL suggestion
${myBean.value} EL will work, or use the struts-el tags if you're using
a  JSP 2.0 container, which will do the same thing in a different way.

Dave



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



Re: Extending Struts with Spring

2006-06-08 Thread Phil Zoio
I've added a lot of support for integrating Spring with Struts in 
Strecks: http://strecks.sourceforge.net/ - a Java 5-based Struts 
extension framework


The main Spring-related things you'll find in there are:
- you can inject any Spring bean into your actions using the 
@InjectSpringBean annotation
- actions can *be* Spring beans, simply by annotating your action with 
@SpringBean

- you can tap into Spring's view rendering in a pretty seamless way

For more details, take a look at: 
http://strecks.sourceforge.net/doc-spring-int.php


Regards,
Phil Z

Julian Tillmann wrote:

Hello, 

I've read that you can use Spring to make your Struts Actions thread safe. Is someone using this or has experience with it? 


Are there other arguments for using Spring with Struts like, for example
an easy implemented Interceptor that might improve the application and is not 
as easily achieved with a filter?

I'm thinking about using this extension but I don't have any kind of practical experience with it. Could someone help me with this? 


ciao  thx
Julian

 




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



[Solved] Issue while migrating from 1.0 to 1.1

2006-06-08 Thread Olivier Citeau
Tim, thank you for your support and your patience, I found the solution.
   
  This page helped me too :
http://www.systemmobile.com/articles/strutsMessageResources.html
   
  Instead of parameter=struts, I needed to specify 
parameter=ressources.struts
Whereas Struts 1.0 could find it in ressources directory.

  message-resources parameter=ressources.struts null=false
  /message-resources
  

Slattery, Tim - BLS [EMAIL PROTECTED] a écrit :
  

 Which outputs 
 ae.size()=1
 error.mandatory.login.password
 
 So, the issue is with the tag itself

So the errors collection is getting stored in the right place. I think
we have to look at your properties file. Apparently the 
tag is finding *some* properties file, since it doesn't compain about
not being able to find it. Could there be more than one in your WAR
file? Could be finding one that doesn't define
error.mandatory.login.password? Could you have misspelled that string
in the properties file?

I'm shooting in the dark here, I don't have a good idea what could be
wrong.


--
Tim Slattery
[EMAIL PROTECTED]

 __
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible 
contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 

[Solved] Issue while migrating from 1.0 to 1.1

2006-06-08 Thread Olivier Citeau
Tim, thank you for your support and your patience, I found the solution
   
  This page helped me too :
http://www.systemmobile.com/articles/strutsMessageResources.html
   
  Instead of parameter=struts, I needed to specify 
parameter=ressources.struts
Whereas Struts 1.0 could find it in ressources directory.

  message-resources parameter=ressources.struts null=false
  /message-resources
  

Slattery, Tim - BLS [EMAIL PROTECTED] a écrit :
  

 Which outputs 
 ae.size()=1
 error.mandatory.login.password
 
 So, the issue is with the tag itself

So the errors collection is getting stored in the right place. I think
we have to look at your properties file. Apparently the 
tag is finding *some* properties file, since it doesn't compain about
not being able to find it. Could there be more than one in your WAR
file? Could be finding one that doesn't define
error.mandatory.login.password? Could you have misspelled that string
in the properties file?

I'm shooting in the dark here, I don't have a good idea what could be
wrong.


--
Tim Slattery
[EMAIL PROTECTED]

 __
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible 
contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 

Re: message resources

2006-06-08 Thread Marcus

Mine is to either use a JSP 2.0 container so the original EL suggestion
${myBean.value} EL will work, or use the struts-el tags if you're using
a  JSP 2.0 container, which will do the same thing in a different way.


I am using Apache Tomcat 5.5, and AFAIK, it does support JSP 2.0.

For myBean I used my dynaActionForm - but it didn't work.

My struts-config:
 form-beans
   form-bean
 name=MyDynaActionForm
 type=org.apache.struts.validator.DynaValidatorForm
 dynamic=true
form-property name=valueAdded type=java.lang.String /
form-property name=description type=java.lang.String /
   /form-bean
 /form-beans

My properties file:
valueAdded=Value {0} added.

My JSP:
   logic:equal name=MyDynaActionForm property=valueAdded 
value=true
   pbean:message key=valueAdded 
arg0=${MyDynaActionForm.description}//p

   /logic:equal

Any ideas?

Thx,

Marcus



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



Re: [Solved] Issue while migrating from 1.0 to 1.1

2006-06-08 Thread Niall Pemberton

On 6/8/06, Olivier Citeau [EMAIL PROTECTED] wrote:

Tim, thank you for your support and your patience, I found the solution

 This page helped me too :
http://www.systemmobile.com/articles/strutsMessageResources.html

 Instead of parameter=struts, I needed to specify 
parameter=ressources.struts
Whereas Struts 1.0 could find it in ressources directory.

 message-resources parameter=ressources.struts null=false
 /message-resources


For upgrading from 1.1 to 1.2 and from 1.2 to 1.3 we have reasonably
good notes on the Wiki - but we're sadly missing a page for 1.0 to 1.1

If you have the time and inclination, documenting your experiences on
a new page for 1.0 to 1.1 would be great:

http://wiki.apache.org/struts/StrutsUpgrade

Niall


Slattery, Tim - BLS [EMAIL PROTECTED] a écrit :


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



Re: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
 Any ideas?

What does your web.xml DOCTYPE look like? Irritatingly enough, you have
to tell Tomcat to go ahead and be 2.0-ish.

Dave



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



Re: message resources

2006-06-08 Thread Marcus

!DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
 http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;


2.2 means 2.0-ish, I assume?

Marcus

Dave Newton schrieb:

Marcus wrote:
  

Any ideas?



What does your web.xml DOCTYPE look like? Irritatingly enough, you have
to tell Tomcat to go ahead and be 2.0-ish.

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]



wanna know abt threads and springs

2006-06-08 Thread Patil, Sheetal
Hi 
Actually I work on struts and tomcat 5.0 and I am not aware of
treads and springs, which are more popular on mailing list now days, so
can u please tell me about these or give me some links for threads and
springs

Thanks in advance
Sp


RE: wanna know abt threads and springs

2006-06-08 Thread animesh.saxena

Hi ,
  If you are talking about thread basicsthe best resource is
www.javaranch.com. For springs...well I am still referring O'Reilly
books for that!

Regards,
Animesh Saxena
RR Donnelley
Wipro Technologies
Bangalore.
99860-76686

When Life tears you down, it builds you up.

-Original Message-
From: Patil, Sheetal [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 5:35 PM
To: Struts Users Mailing List
Subject: wanna know abt threads and springs

Hi
Actually I work on struts and tomcat 5.0 and I am not aware of
treads and springs, which are more popular on mailing list now days, so
can u please tell me about these or give me some links for threads and
springs

Thanks in advance
Sp


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-config xml file throws a java exception

2006-06-08 Thread Samere, Adam J
Where is loginRequired referenced in your struts-config document? Perhaps I 
misunderstood your problem.

-Original Message-
From: Olivier Bex [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 4:04 AM
To: 'Struts Users Mailing List'
Subject: RE: struts-config xml file throws a java exception

Hi, 

Here is my form bean declaration : 

form-beans
form-bean name=loginForm type=com.eyrolles.LoginForm /
form-bean name=employeForm type=com.eyrolles.EmployeForm /
  /form-beans

And here is the action form : 
(NB : the other declaration loginForm does not use the loginrequired
property.)

package com.eyrolles.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;

public class EmployeForm extends ActionForm {

  private static final long serialVersionUID = 1L;  
  protected String username;
  protected String password;
  protected String name;
  protected String phone;
  protected String email;
  protected String depid;
  protected String roleid;

  public void setUsername(String username) {

this.username = username;
  }

  public String getUsername() {

return username;
  }

  public void setPassword(String password) {

this.password = password;
  }

  public String getPassword() {

return password;
  }

  public void setName(String name) {

this.name = name;
  }

  public String getName() {

return name;
  }

  public void setPhone(String phone) {

this.phone = phone;
  }

  public String getPhone() {

return phone;
  }

  public void setEmail(String email) {

this.email = email;
  }

  public String getEmail() {

return email;
  }

  public void setDepid(String depid) {

this.depid = depid;
  }

  public String getDepid() {

return depid;
  }

  public void setRoleid(String roleid) {

this.roleid = roleid;
  }

  public String getRoleid() {

return roleid;
  }

  // Cette méthode est appelée par chaque requête. Elle réinitialise les
  // attributs du formulaire avant de copier les données de la nouvelle requête.
  public void reset(ActionMapping mapping, HttpServletRequest request) {

this.username = ;
this.password = ;
this.name = ;
this.phone = ;
this.email = ;
this.depid = 1;
this.roleid = 1;
  }

  public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

EmployesActionMapping employesMapping =
  (EmployesActionMapping)mapping;

// Cette action nécessite-t-elle l'identification de l'utilisateur ?
if ( employesMapping.isLoginRequired() ) {

  HttpSession session = request.getSession();
  if ( session.getAttribute(USER) == null ) {

// retourner null force l'action à traiter l'erreur de login
return null;
  }
}

if ( (roleid == null ) || (roleid.length() == 0) ) {

  errors.add(roleid, new ActionMessage(errors.roleid.required));
}
if ( (depid == null ) || (depid.length() == 0) ) {

  errors.add(depid, new ActionMessage(errors.depid.required));
}
if ( (email == null ) || (email.length() == 0) ) {

  errors.add(email, new ActionMessage(errors.email.required));
}
if ( (phone == null ) || (phone.length() == 0) ) {

  errors.add(phone, new ActionMessage(errors.phone.required));
}
if ( (name == null ) || (name.length() == 0) ) {

  errors.add(name, new ActionMessage(errors.name.required));
}
if ( (password == null ) || (password.length() == 0) ) {

  errors.add(password, new ActionMessage(errors.password.required));
}
if ( (username == null ) || (username.length() == 0) ) {

  errors.add(username, new ActionMessage(errors.username.required));
}
return errors;
  }
}

-Message d'origine-
De : Samere, Adam J [mailto:[EMAIL PROTECTED] Envoyé : mercredi 7 juin 2006 
19:04 À : Struts Users Mailing List Objet : RE: struts-config xml file throws a 
java exception

Can you post the form bean declaration from struts config and the ActionForm 
subclass? 


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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. 

Re: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
 !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;


 2.2 means 2.0-ish, I assume?

Nope... That means Servlet spec 2.2, which is less than you need ;)

Pre-advice caveat: I've never figured out XML, DOCTYPEs, and people make
fun of me for it.

web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

Try that and see what happens... You can always do a sanity check JSP
page by displaying something you know to be a scoped value.

Dave



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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread Niall Pemberton

On 6/8/06, antony.paul [EMAIL PROTECTED] wrote:


Hi
 Sorry for that incomplete mail. I am not getting any excetption and
that particular field is accepting everthing like characters and getting
saved in the database as '0', I guess thats the default value for that field
because I have defined that corresponding property in the Action Form as a
'Double'


If you've defined your property as a Double then BeanUtils population
will have tried to convert the invalid String value from the request
into a Double in your ActionForm and failed - leaving it set to zero.
Validator kicks in after population and validates whats in the
ActionForm and it expects a String and will convert your ActionForm's
Double property back to a String which would be 0.0 - that will
always pass the double validation (but fail integer validation :-) For
this to work you need to define the property in your ActionForm as a
String, not a Double.

Niall


Thanks
Antony


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



Re: Validation not working for 'double' with Struts 1.2

2006-06-08 Thread The Jasper

always pass the double validation (but fail integer validation :-) For
this to work you need to define the property in your ActionForm as a
String, not a Double.


oops, missed that :}

mvg,
Jasper

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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Olivier Bex
LoginRequired is referenced in the action tags of each action.

Here is a sample : 

action-mappings

action path=/Login
  type=com.eyrolles.LoginAction
  validate=true
  input=/login.jsp
  name=loginForm
  scope=request 
  forward name=success path=/EmployeListe.do/
/action

action path=/EmployeListe
  type=com.eyrolles.EmployeListeAction
  scope=request 
  set-property property=loginRequired value=true/
  forward name=success path=/employeliste.jsp/
/action
[...]
/action-mapping

Olivier.

-Message d'origine-
De : Samere, Adam J [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 14:10
À : Struts Users Mailing List
Objet : RE: struts-config xml file throws a java exception

Where is loginRequired referenced in your struts-config document? Perhaps I
misunderstood your problem.

-Original Message-
From: Olivier Bex [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 4:04 AM
To: 'Struts Users Mailing List'
Subject: RE: struts-config xml file throws a java exception

Hi, 

Here is my form bean declaration : 

form-beans
form-bean name=loginForm type=com.eyrolles.LoginForm /
form-bean name=employeForm type=com.eyrolles.EmployeForm /
  /form-beans

And here is the action form : 
(NB : the other declaration loginForm does not use the loginrequired
property.)

package com.eyrolles.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;

public class EmployeForm extends ActionForm {

  private static final long serialVersionUID = 1L;  
  protected String username;
  protected String password;
  protected String name;
  protected String phone;
  protected String email;
  protected String depid;
  protected String roleid;

  public void setUsername(String username) {

this.username = username;
  }

  public String getUsername() {

return username;
  }

  public void setPassword(String password) {

this.password = password;
  }

  public String getPassword() {

return password;
  }

  public void setName(String name) {

this.name = name;
  }

  public String getName() {

return name;
  }

  public void setPhone(String phone) {

this.phone = phone;
  }

  public String getPhone() {

return phone;
  }

  public void setEmail(String email) {

this.email = email;
  }

  public String getEmail() {

return email;
  }

  public void setDepid(String depid) {

this.depid = depid;
  }

  public String getDepid() {

return depid;
  }

  public void setRoleid(String roleid) {

this.roleid = roleid;
  }

  public String getRoleid() {

return roleid;
  }

  // Cette méthode est appelée par chaque requête. Elle réinitialise les
  // attributs du formulaire avant de copier les données de la nouvelle
requête.
  public void reset(ActionMapping mapping, HttpServletRequest request) {

this.username = ;
this.password = ;
this.name = ;
this.phone = ;
this.email = ;
this.depid = 1;
this.roleid = 1;
  }

  public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

EmployesActionMapping employesMapping =
  (EmployesActionMapping)mapping;

// Cette action nécessite-t-elle l'identification de l'utilisateur ?
if ( employesMapping.isLoginRequired() ) {

  HttpSession session = request.getSession();
  if ( session.getAttribute(USER) == null ) {

// retourner null force l'action à traiter l'erreur de login
return null;
  }
}

if ( (roleid == null ) || (roleid.length() == 0) ) {

  errors.add(roleid, new ActionMessage(errors.roleid.required));
}
if ( (depid == null ) || (depid.length() == 0) ) {

  errors.add(depid, new ActionMessage(errors.depid.required));
}
if ( (email == null ) || (email.length() == 0) ) {

  errors.add(email, new ActionMessage(errors.email.required));
}
if ( (phone == null ) || (phone.length() == 0) ) {

  errors.add(phone, new ActionMessage(errors.phone.required));
}
if ( (name == null ) || (name.length() == 0) ) {

  errors.add(name, new ActionMessage(errors.name.required));
}
if ( (password == null ) || (password.length() == 0) ) {

  errors.add(password, new ActionMessage(errors.password.required));
}
if ( (username == null ) || (username.length() == 0) ) {

  errors.add(username, new ActionMessage(errors.username.required));
}
return errors;
  }
}

-Message d'origine-
De : Samere, Adam J [mailto:[EMAIL PROTECTED] Envoyé : mercredi 7 juin
2006 19:04 À : Struts Users Mailing List Objet : RE: struts-config xml file
throws a java exception

Can you post the form bean declaration from struts config and the ActionForm

Re: selectedItems of checkbox

2006-06-08 Thread fea jabi

need help with this please. Thanks.

Thankyou for your response.

yes, it is displaying in correct form in the browser.

I want to delete the selected values from the original list.

In the Dispatch Action I am checking the selectedList which are
String values with the originallist and doing string comparision to
check if they match and trying to delete them from original list.

but when trying to compare the values as they are different it's not
deleting/removing them from the original list according to the logic
I wrote in delete method.


How would you advice me to proceed on this? Thanks.


below is the code in the jsp.

display:table name=${Form.map.runs} id=mgrRuns 
requestURI=PrepareAction.do  defaultsort=7 defaultorder=descending 
pagesize=6
display:column titleKey=lbl.runname sortable=true 
href=PrepareAction.do headerClass=sortable

 c:set var=runBean value=${mgrRuns.runName} /

 html:multibox property=selectedRunsbean:write name=runBean 
property=value//html:multibox

  bean:write name=runBean property=label/
  /display:column



/display:table


not sure how to fix this? thanks.












From: Scott Van Wart [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List user@struts.apache.org
To: Struts Users Mailing List user@struts.apache.org
Subject: Re: selectedItems of checkbox
Date: Wed, 07 Jun 2006 15:30:34 -0300

fea jabi wrote:

I have added a column with html:multibox in a table.

The values in the column are
Fea's Car
Joe's Car

In the DispathAction when tried to see the values of the selected items.

it's
Fea's -- why is the value different?

I tried to use LabelValueBean in the multibox. Still it's the same. How 
to fix this?
As long as the values are fine in the Action.execute method's ActionForm 
parameter, you should be fine.  When you use special characters like the 
single-quote in values, struts escapes them before sending them to the web 
browser (try viewing the HTML source in your browser), and the browser 
decodes them when rendering the form.  Then when the browser sends them 
back, it encodes the values the same way.  Struts gets these values and 
translates them back into the original form before putting them in your 
form bean.  I would suggest a couple of things to check:


- Has Struts populated your form bean before you tried viewing the values, 
or are you looking at the unencoded values in the DispatchAction class?
- Make sure you're using struts to output the values, and not scriptlets, 
which don't encode the values properly.


- Scott

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



_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



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



_
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



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



Re: struts-config xml file throws a java exception

2006-06-08 Thread Dave Newton
Olivier Bex wrote:
 LoginRequired is referenced in the action tags of each action.
   

I may have missed it, but did you provide the source for your custom
ActionMapping class that you are expecting the set-property... element
to act upon? (If you didn't, or haven't sub-classed ActionMapping or
aren't using somebody else's custom ActionMapping, consider this a hint ;)

Dave



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



Re: struts-config xml file throws a java exception

2006-06-08 Thread Wendy Smoak

On 6/8/06, Olivier Bex [EMAIL PROTECTED] wrote:

LoginRequired is referenced in the action tags of each action.

...

action path=/EmployeListe
  type=com.eyrolles.EmployeListeAction
  scope=request 
  set-property property=loginRequired value=true/
  forward name=success path=/employeliste.jsp/
/action


(earlier)

   EmployesActionMapping employesMapping =
(EmployesActionMapping)mapping;

  // Cette action nécessite-t-elle l'identification de l'utilisateur ?
  if ( employesMapping.isLoginRequired() ) {


I don't see where you've told the framework to use your custom
ActionMapping class.

I haven't done this, but from the DTD [1] it looks like you can either set
  action-mappings type=...
or
  action className=... 
depending on whether it applies to just one action or all of them.

[1] http://struts.apache.org/dtds/struts-config/1_2/
(pick an element, then scroll up to see the docs.)

--
Wendy

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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Samere, Adam J
You don't have a custom action-mappings type... The set-property set's property 
on the ActionMapping instance.
action-mappings type=foo.bar.MyActionMapping
...
/action-mappings
-Original Message-
From: Olivier Bex [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 9:06 AM
To: 'Struts Users Mailing List'
Subject: RE: struts-config xml file throws a java exception

LoginRequired is referenced in the action tags of each action.

Here is a sample : 

action-mappings

action path=/Login
  type=com.eyrolles.LoginAction
  validate=true
  input=/login.jsp
  name=loginForm
  scope=request 
  forward name=success path=/EmployeListe.do/
/action

action path=/EmployeListe
  type=com.eyrolles.EmployeListeAction
  scope=request 
  set-property property=loginRequired value=true/
  forward name=success path=/employeliste.jsp/
/action
[...]
/action-mapping

Olivier.

-Message d'origine-
De : Samere, Adam J [mailto:[EMAIL PROTECTED] Envoyé : jeudi 8 juin 2006 14:10 
À : Struts Users Mailing List Objet : RE: struts-config xml file throws a java 
exception

Where is loginRequired referenced in your struts-config document? Perhaps I 
misunderstood your problem.

-Original Message-
From: Olivier Bex [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 4:04 AM
To: 'Struts Users Mailing List'
Subject: RE: struts-config xml file throws a java exception

Hi, 

Here is my form bean declaration : 

form-beans
form-bean name=loginForm type=com.eyrolles.LoginForm /
form-bean name=employeForm type=com.eyrolles.EmployeForm /
  /form-beans

And here is the action form : 
(NB : the other declaration loginForm does not use the loginrequired
property.)

package com.eyrolles.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;

public class EmployeForm extends ActionForm {

  private static final long serialVersionUID = 1L;  
  protected String username;
  protected String password;
  protected String name;
  protected String phone;
  protected String email;
  protected String depid;
  protected String roleid;

  public void setUsername(String username) {

this.username = username;
  }

  public String getUsername() {

return username;
  }

  public void setPassword(String password) {

this.password = password;
  }

  public String getPassword() {

return password;
  }

  public void setName(String name) {

this.name = name;
  }

  public String getName() {

return name;
  }

  public void setPhone(String phone) {

this.phone = phone;
  }

  public String getPhone() {

return phone;
  }

  public void setEmail(String email) {

this.email = email;
  }

  public String getEmail() {

return email;
  }

  public void setDepid(String depid) {

this.depid = depid;
  }

  public String getDepid() {

return depid;
  }

  public void setRoleid(String roleid) {

this.roleid = roleid;
  }

  public String getRoleid() {

return roleid;
  }

  // Cette méthode est appelée par chaque requête. Elle réinitialise les
  // attributs du formulaire avant de copier les données de la nouvelle requête.
  public void reset(ActionMapping mapping, HttpServletRequest request) {

this.username = ;
this.password = ;
this.name = ;
this.phone = ;
this.email = ;
this.depid = 1;
this.roleid = 1;
  }

  public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

EmployesActionMapping employesMapping =
  (EmployesActionMapping)mapping;

// Cette action nécessite-t-elle l'identification de l'utilisateur ?
if ( employesMapping.isLoginRequired() ) {

  HttpSession session = request.getSession();
  if ( session.getAttribute(USER) == null ) {

// retourner null force l'action à traiter l'erreur de login
return null;
  }
}

if ( (roleid == null ) || (roleid.length() == 0) ) {

  errors.add(roleid, new ActionMessage(errors.roleid.required));
}
if ( (depid == null ) || (depid.length() == 0) ) {

  errors.add(depid, new ActionMessage(errors.depid.required));
}
if ( (email == null ) || (email.length() == 0) ) {

  errors.add(email, new ActionMessage(errors.email.required));
}
if ( (phone == null ) || (phone.length() == 0) ) {

  errors.add(phone, new ActionMessage(errors.phone.required));
}
if ( (name == null ) || (name.length() == 0) ) {

  errors.add(name, new ActionMessage(errors.name.required));
}
if ( (password == null ) || (password.length() == 0) ) {

  errors.add(password, new ActionMessage(errors.password.required));
}
if ( (username == null ) || (username.length() == 0) 

Re: Format USDollars

2006-06-08 Thread Vinit Sharma

fmt tag can solve ur problem:

fmt:formatNumber type=currency currencyCode=USD value=1234578.74901
pattern=#,###.##/

Display would look as: $1,234,578.75

HTH,

On 6/7/06, Antonio Petrelli [EMAIL PROTECTED] wrote:


Raghuveer ha scritto:
 How to format Money Data type(SQL server )by below format for USD.



 $x,xxx,xxx,xxx.xx


If you mean formatting in JSP see:

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatNumber.html
Ciao
Antonio

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





--
Vinit Sharma
IBM


Re: message resources

2006-06-08 Thread Marcus



Nope... That means Servlet spec 2.2, which is less than you need ;)

Pre-advice caveat: I've never figured out XML, DOCTYPEs, and people make
fun of me for it.

web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

Try that and see what happens... You can always do a sanity check JSP
page by displaying something you know to be a scoped value.


Now I get thrown an error that it can't find  the value! yaho! ;-)

javax.servlet.ServletException: Unable to find a value for description in object of class 
org.apache.struts.validator.DynaValidatorForm using operator .


bean:message key=valueAdded arg0=${MyDynaValidatorForm.description}/

However, this does work!!!
 bean:write property=description name=MyDynaValidatorForm/

???

Marcus

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



Re: message resources

2006-06-08 Thread Marcus


When using EL with dyna beans you need to reference the map property
then your property. The struts tags (i.e. bean:write) handle this for
you.

 bean:message key=valueAdded


Sorry,

call me dumb,
but I didn't really get what you tried to explain.

EL ?
- map property  - you mean my dynaForm?
Or do you really mean a map? I am not using one..

Marcus

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



Re: message resources

2006-06-08 Thread Dave Newton
Marcus wrote:
 When using EL with dyna beans you need to reference the map property
 then your property. The struts tags (i.e. bean:write) handle this for
 you.

  bean:message key=valueAdded

 Or do you really mean a map? I am not using one..

...but you're using a DynaForm, so you are, so just do what he said ;)

Dave



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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Olivier Bex
Here is my Actionmapping class using the property loginRequired : 

package com.ex.struts;

import org.apache.struts.action.ActionMapping;

public class EmployesActionMapping extends ActionMapping {

  private static final long serialVersionUID = 1L;
  protected boolean loginRequired = false;

  public void setLoginRequired(boolean loginRequired) {

this.loginRequired = loginRequired;
  }

  public boolean getLoginRequired() {

return loginRequired;
  }
}

-Message d'origine-
De : Dave Newton [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 8 juin 2006 15:19
À : Struts Users Mailing List
Objet : Re: struts-config xml file throws a java exception

Olivier Bex wrote:
 LoginRequired is referenced in the action tags of each action.
   

I may have missed it, but did you provide the source for your custom
ActionMapping class that you are expecting the set-property... element
to act upon? (If you didn't, or haven't sub-classed ActionMapping or
aren't using somebody else's custom ActionMapping, consider this a hint ;)

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: message resources

2006-06-08 Thread Samere, Adam J
Internally the DynaForm (i.e. DynaBean) uses a Map to store the
properties. This is what allows it to provide dynamic properties and
save you from writing ActionForm subclasses.

When you reference myDynaForm with a JSP Expression Language (EL)
expression like ${myDynaForm.description} reflection is used to call a
getter method (in this case getDescription() on the instance
(myDynaForm). 

So... ${myDynaForm.description} is equivalent to
myDynaForm.getDescription()

The DynaForm class does not have this method. It does however have a
method public Map getMap() which returns the Map used to store your
properties. So, by putting ${myDynaForm.map.description} the equivalent
is myDynaForm.getMap().get(description) which will return your
property.

When using the struts bean tags such as bean write the tags are aware of
the DynaBean, and therefore know that they need to get the underlying
Map, then call get(String) using the supplied property.

Make sense?

-Adam

-Original Message-
From: Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 9:47 AM
To: Struts Users Mailing List
Subject: Re: message resources


 When using EL with dyna beans you need to reference the map property 
 then your property. The struts tags (i.e. bean:write) handle this for 
 you.

  bean:message key=valueAdded

Sorry,

call me dumb,
but I didn't really get what you tried to explain.

EL ?
- map property  - you mean my dynaForm?
Or do you really mean a map? I am not using one..

Marcus

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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



RE: struts-config xml file throws a java exception

2006-06-08 Thread Samere, Adam J
Does your struts-config have:

action-mappings type=com.ex.struts.EmployesActionMapping
...
/action-mappings 

It didn't in the example you provided earlier.

-Original Message-
From: Olivier Bex [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 9:58 AM
To: 'Struts Users Mailing List'
Subject: RE: struts-config xml file throws a java exception

Here is my Actionmapping class using the property loginRequired : 

package com.ex.struts;

import org.apache.struts.action.ActionMapping;

public class EmployesActionMapping extends ActionMapping {

  private static final long serialVersionUID = 1L;
  protected boolean loginRequired = false;

  public void setLoginRequired(boolean loginRequired) {

this.loginRequired = loginRequired;
  }

  public boolean getLoginRequired() {

return loginRequired;
  }
}

-Message d'origine-
De : Dave Newton [mailto:[EMAIL PROTECTED] Envoyé : jeudi 8 juin 2006 15:19 À : 
Struts Users Mailing List Objet : Re: struts-config xml file throws a java 
exception

Olivier Bex wrote:
 LoginRequired is referenced in the action tags of each action.
   

I may have missed it, but did you provide the source for your custom 
ActionMapping class that you are expecting the set-property... element to act 
upon? (If you didn't, or haven't sub-classed ActionMapping or aren't using 
somebody else's custom ActionMapping, consider this a hint ;)

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]


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



[Tiles] Embedding tiles inside of tiles

2006-06-08 Thread Susan G. Conger
I am new to using tiles and I have a couple of questions.  I have written a
page layout and I have it coming up but there are a couple of questions that
I have.  First, my header.jsp has a section where the graphic changes depend
on what page is begin displayed.  I can't seem to figure out the correct way
to implement this.  Also do I need an html/jsp page to display this image
change or can I just point to the gif file?

TIA,
Susan

==
Susan G. Conger Custom Windows  Macintosh Development
PresidentWeb Site Design  Development
YOERIC Corporation   Database Design  Development
256 Windy Ridge Road
Chapel Hill, NC  27517
Phone/Fax: (919)542-0071
[EMAIL PROTECTED]
www.yoeric.com
 



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



Re: [Tiles] Embedding tiles inside of tiles

2006-06-08 Thread Antonio Petrelli

Susan G. Conger ha scritto:

First, my header.jsp has a section where the graphic changes depend
on what page is begin displayed.  I can't seem to figure out the correct way
to implement this.


What do you mean with graphic? A picture?
Ant how do you want to change this graphic, I mean, what are the 
conditions that will cause the graphic to change?



  Also do I need an html/jsp page to display this image
change or can I just point to the gif file?
  


I think that you could simply use html:img tag for a single gif file 
instead of a tile.


Antonio

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



Re: [Tiles] Embedding tiles inside of tiles

2006-06-08 Thread Greg Reddin

On Jun 8, 2006, at 9:05 AM, Susan G. Conger wrote:


First, my header.jsp has a section where the graphic changes depend
on what page is begin displayed.  I can't seem to figure out the  
correct way

to implement this.


The short answer is to use Tile attributes.  The longer answer is  
that attributes don't always work the way you might think.  One of  
the weaknesses of Tiles is that there's no good way to pass data from  
one tile to another.  Attributes are better suited for static  
parameter substitution.


For example suppose you have Tile A that defines some attributes and  
Tile B that extends Tile A and overrides some attributes as follows:


definition name=tileA path=/layout.jsp
  put name=headerGraphic value=image1.gif/
  put name=someOtherThing value=.../
/definitioin

definition name=tileB extends=tileA
  put name=headerGraphic value=image2.gif/
/definition

As long as your layout is completely defined in one JSP page this  
will all work.  It breaks down if your layout has separate pages for  
header, footer, etc.  See below:


definition name=tileA path=/layout.jsp
  put name=header value=/header1.jsp/
  put name=headerGraphic value=image1.gif/
  put name=someOtherThing value=.../
/definitioin

definition name=tileB extends=tileA
  put name=header value=header2.jsp/
  put name=headerGraphic value=image2.gif/
/definition

Above you want to define your header differently for two layouts and  
you want to pass different images in.  This won't work because the  
headerGraphic attribute will not be passed along to the header page  
unless you do it manually from the page where it is inserted.   
There's a couple ways to hack this.  One is described in another thread:


http://mail-archives.apache.org/mod_mbox/struts-user/200605.mbox/% 
[EMAIL PROTECTED]


The other would be, as you indicated in the subject, to embed a tile  
within a tile:


definition name=tileA path=/layout.jsp
  put name=header value=headerTile1/
  put name=someOtherThing value=.../
/definitioin

definition name=tileB extends=tileA
  put name=header value=headerTile2/
/definitioin

definitiion name=headerTile1 path=/header.jsp
  put name=headerGraphic value=image1.jpg/
/definition

definitiion name=headerTile2 path=/header.jsp
  put name=headerGraphic value=image2.jpg/
/definition

I haven't tried this, but I don't think it works out of the box.  In  
layout.jsp when you insert the header tile, you'll have to do some  
magic I think to resolve the name to a tile definition.  This should  
be better supported and hopefully will eventually.



Also do I need an html/jsp page to display this image
change or can I just point to the gif file?


If I understand you correctly I think you should be able to just  
point to the image file.


HTH,
Greg



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



Re: [Tiles] Embedding tiles inside of tiles

2006-06-08 Thread Antonio Petrelli

Susan G. Conger ha scritto:

The image changes depending on the page that is being displayed.  Ideally I
would like to just be able to point to the .gif file in the tiles-def.xml
file.  Here is what I have so far:

tiles-definitions

  !-- Student Layout --
  definition name=student.header path=/secure/header.jsp
 put name=description
value=/images/student_pg_header/course_details.html/
  /definition

  definition name=student.layout path=/secure/layout.jsp
 put name=title  value=Struts Test/
 put name=menu   value=/secure/student_menu.jsp/
 put name=body   value=/secure/student_menu.jsp/
 put name=footer   value=/secure/footer.jsp/
  /definition

/tiles-definitions

I want the student.header to be displayed in the student.layout.


You can do something like:

 definition name=student.layout path=/secure/layout.jsp
put name=title  value=Struts Test/
put name=header value=student.header type=definition /
put name=menu   value=/secure/student_menu.jsp/
put name=body   value=/secure/student_menu.jsp/
put name=footer   value=/secure/footer.jsp/
 /definition



  Inside the
student.header the description changes depending on the page that is being
displayed.


Do you mean that there are definitions similar to student.layout but 
that changes only, say, the body section?
If this is your case you have to extend both student.header and 
student.layout



 definition name=student.header.abc extends=student.header
put name=description
value=/images/student_pg_header/course_details_abc.html/
 /definition

 definition name=student.layout.abc extends=student.layout
put name=header value=student.header.abc type=definition /
 /definition

Speaking of simple pictures you can do it with some JSP code.

 definition name=student.layout.abc extends=student.layout
put name=picture value=/picture/mypicture.gif /
 /definition

In your layout page (I think it is /secure/layout.jsp) put:

tiles:importAttribute name=picture scope=page /
html:img page=${picture} /

(If you are using an older Tomcat probably you have to use html-el:img tag)


I hope I got the point.
Ciao
Antonio



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



Digester Error while reading struts config file

2006-06-08 Thread RickD

Has anyone seen this.  I'm migrating to struts 1.2.9 from 1.1.  I've tried
using the 1.2 version of the DTD, and I've tried it without a DOCTYPE
declaration to stop validation.  

I also read that there may be a problem with the xerces parser.  I read that
the Digester has problems if the xerces is in the parent class path.  I'm
moved xerces 2.8 inside my war; this had no effect.

thx


Jun 8, 2006 8:33:53 AM org.apache.commons.digester.Digester getParser
SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation is
not supported
at
com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.java:105)
at
org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:139)
at
org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
at org.apache.commons.digester.Digester.getParser(Digester.java:682)
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:3
--
View this message in context: 
http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1755486.html#a4773732
Sent from the Struts - User forum at Nabble.com.


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



[solved] message resources

2006-06-08 Thread Marcus

Samere, Adam J schrieb:

Internally the DynaForm (i.e. DynaBean) uses a Map to store the
properties. This is what allows it to provide dynamic properties and
save you from writing ActionForm subclasses.

When you reference myDynaForm with a JSP Expression Language (EL)
expression like ${myDynaForm.description} reflection is used to call a
getter method (in this case getDescription() on the instance
(myDynaForm). 


So... ${myDynaForm.description} is equivalent to
myDynaForm.getDescription()

The DynaForm class does not have this method. It does however have a
method public Map getMap() which returns the Map used to store your
properties. So, by putting ${myDynaForm.map.description} the equivalent
is myDynaForm.getMap().get(description) which will return your
property.

When using the struts bean tags such as bean write the tags are aware of
the DynaBean, and therefore know that they need to get the underlying
Map, then call get(String) using the supplied property.

Make sense?

-Adam
  
Make sense? YES! 


And it works, works, works... ;-)


Marcus


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



multibox not works when all checkboxes are unselected!

2006-06-08 Thread starki78
Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was
selected before! The state of the form is session in struts-config.
Can you help me with this problem??
I really don't have an idea how to solve it!

Thanks a lot!










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



RE: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Samere, Adam J
Browsers are only required to submit values for checkboxes when they are
selected. So when a box is not checked, no value is sent, so the state
on the server is not changed. When using session scoped objects to store
the value of checkboxes your processing needs to be aware of the fact
that values for checkbox=off are not sent.

-Adam 

-Original Message-
From: starki78 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 11:40 AM
To: user
Subject: multibox not works when all checkboxes are unselected!

Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was selected before! The
state of the form is session in struts-config.
Can you help me with this problem??
I really don't have an idea how to solve it!

Thanks a lot!










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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



RE: multibox not works when all checkboxes are unselected!

2006-06-08 Thread starki78
Hi Adam I just tried:
public void reset(ActionMapping mapping, HttpServletRequest request) {

multiboxvalues = new String[3];
multiboxvalues[0] = ;
multiboxvalues[1] = ;
multiboxvalues[2] = ;

  }

And now the problem seems to be solved but to be honest I
don't have the knowledge to understand it!

Thanks for you advice!




 Browsers are only required to submit values for checkboxes when they are
 selected. So when a box is not checked, no value is sent, so the state
 on the server is not changed. When using session scoped objects to store
 the value of checkboxes your processing needs to be aware of the fact
 that values for checkbox=off are not sent.

 -Adam

 -Original Message-
 From: starki78 [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 08, 2006 11:40 AM
 To: user
 Subject: multibox not works when all checkboxes are unselected!

 Hi!

 I've a large problem with html:multibox.
 I've tree checkboxes. When I choose
 one or two or three it arrives correct
 at the next action!
 Only then all checkboxes are deselected
 it remembers the state of the checkboxes that was selected before! The
 state of the form is session in struts-config.
 Can you help me with this problem??
 I really don't have an idea how to solve it!

 Thanks a lot!










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


 -
 The information contained in this message may be privileged,
 confidential, and protected from disclosure. If the reader of this
 message is not the intended recipient, or any employee or agent
 responsible for delivering this message to the intended recipient,
 you are hereby notified that any dissemination, distribution, or
 copying of this communication is strictly prohibited. If you have
 received this communication in error, please notify us immediately
 by replying to the message and deleting it from your computer.

 Thank you. Paychex, Inc.


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



response.sendRedirect() doesn't work!

2006-06-08 Thread Truong Xuan Tinh
 Hi every body,
I've have a problem with the response.sendRedirect called in a jsp file,
I've used Tile in my project. I've set the autoFlush=false and set the
bufferSize to a big number (bufferSize=2048kB) in the master page (of
Tile) and in the *child* jsp file where the response.sendRedirect() was
called, I've also set page directive the same as the master page. But it
didn't work. Some told me that  the following snippet work for them:
%
response.sendRedirect(abc.do);
return;
%
I've also tried this, but it didn't work either. I've used Struts 1.2.9
and Tomcat 5.0.30.
Please help, thank you very much.

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



ActionForm and EJB

2006-06-08 Thread chamal desilva
Hi,

I read few articles on struts. They recommend not to
send action form class to EJBs as data holders. They
recommend we should use general classes for holding
data to decople web tier with EJBs.

What they say must be correct but I still have few
doubts (Maybe b'cause I am not experienced).

Don't we have to modify two classes, if we use both
ActionForms and normal java classes to store data.For
example we will have modify two classes to add a new
attribute, remove attribute etc.

Please help me to understand this more clearly.

Thanking You,
Chamal.


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

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



Re: ActionForm and EJB

2006-06-08 Thread Frank W. Zammetti
Hi Chamal,

The recommendation of not passing ActionForms to your business classes
stems from two thoughts...

First, by passing an ActionForm, you tie your business clases to Struts. 
Should you want to change to another framework later, your business
classes should be unaffected, therefore, passing POJOs to them is a better
idea.  This also makes unit testing them a little easier since you don't
have to manually construct an ActionForm during the test (this isn't such
a big deal with ActionForm, but imagine if it for some reason had a
reference to an HttpRequest object, then it would be more of a hassle).

Second, an ActionForm is, usually, used to repopulate an HTML form on a
page when an error occurs, or when a page is initially shown.  Since HTML
forms only deal in Strings, another recommendation you frequently hear is
to only have Strings in your ActionForms.  For example, if you have a
textbox in your HTML form for a user to enter a date, having a real Date
field in the ActionForm can lead to problems because of the conversions
that have to take place back and forth (and if I remember correctly, no
conversion is done when redisplaying the HTML form anyway, so you'll get
the default toString() of the Date object, which is almost certainly not
what you want).  If you instead make it a String field, the only
conversion is when you ultimately need to pass it to the business layer,
in which case you have more full control over it.  So, since you probably
want to be dealing with real Java data types in your business classes, but
an ActionForm was designed to deal with HTML forms and therefore only
Strings, trying to make an ActionForm serve both purposes can lead to
problems, so its easier to just avoid the situation altogether.

HTH,
Frank

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Thu, June 8, 2006 12:29 pm, chamal desilva wrote:
 Hi,

 I read few articles on struts. They recommend not to
 send action form class to EJBs as data holders. They
 recommend we should use general classes for holding
 data to decople web tier with EJBs.

 What they say must be correct but I still have few
 doubts (Maybe b'cause I am not experienced).

 Don't we have to modify two classes, if we use both
 ActionForms and normal java classes to store data.For
 example we will have modify two classes to add a new
 attribute, remove attribute etc.

 Please help me to understand this more clearly.

 Thanking You,
 Chamal.


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

 -
 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: response.sendRedirect() doesn't work!

2006-06-08 Thread David Friedman
Why not avoid this problem since you are using a tile and simply add a meta
refresh at the top?  That way you know the page should change and you will
have no problem with how Tiles handles output.  Personally, I think putting
a response.sendRedirect() in a jsp is the wrong place.  I try to keep
redirect to a blank page or a new Forward(...) with redirect=true in the
action an its outcome.

Regards,
David

-Original Message-
From: Truong Xuan Tinh [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 12:20 PM
To: Struts Users Mailing List
Subject: response.sendRedirect() doesn't work!


 Hi every body,
I've have a problem with the response.sendRedirect called in a jsp file,
I've used Tile in my project. I've set the autoFlush=false and set the
bufferSize to a big number (bufferSize=2048kB) in the master page (of
Tile) and in the *child* jsp file where the response.sendRedirect() was
called, I've also set page directive the same as the master page. But it
didn't work. Some told me that  the following snippet work for them:
%
response.sendRedirect(abc.do);
return;
%
I've also tried this, but it didn't work either. I've used Struts 1.2.9
and Tomcat 5.0.30.
Please help, thank you very much.

-
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: ActionForm and EJB

2006-06-08 Thread Truong Xuan Tinh
chamal desilva wrote:
 Hi,

 I read few articles on struts. They recommend not to
 send action form class to EJBs as data holders. They
 recommend we should use general classes for holding
 data to decople web tier with EJBs.
   
That's right.
 What they say must be correct but I still have few
 doubts (Maybe b'cause I am not experienced).

 Don't we have to modify two classes, if we use both
 ActionForms and normal java classes to store data.For
 example we will have modify two classes to add a new
 attribute, remove attribute etc.

   
You will use a Data Transfer Object (or Value Object as some called) to
wrap the data from your form bean, and send to the EJB and vice versa.
Then the EJB layer wont depend on the form bean (view layer). That's
best practices.
 Please help me to understand this more clearly.

 Thanking You,
 Chamal.


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

 -
 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: Digester Error while reading struts config file

2006-06-08 Thread Samere, Adam J
What container are you using? By moving xerces 2.8 inside my war do
you mean the xercesImpl.jar? Which JVM you are using may also be of
interest.

What is bluecast? I bet your Sax Parser factory is picking the wrong
one...

-Original Message-
From: RickD [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 10:48 AM
To: user@struts.apache.org
Subject: Digester Error while reading struts config file


Has anyone seen this.  I'm migrating to struts 1.2.9 from 1.1.  I've
tried using the 1.2 version of the DTD, and I've tried it without a
DOCTYPE declaration to stop validation.  

I also read that there may be a problem with the xerces parser.  I read
that the Digester has problems if the xerces is in the parent class
path.  I'm moved xerces 2.8 inside my war; this had no effect.

thx


Jun 8, 2006 8:33:53 AM org.apache.commons.digester.Digester getParser
SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation
is not supported
at
com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.
java:105)
at
org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParse
r.java:139)
at
org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(Pars
erFeatureSetterFactory.java:73)
at
org.apache.commons.digester.Digester.getParser(Digester.java:682)
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at
org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
et.java:738)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
va:687)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:3
--
View this message in context:
http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1
755486.html#a4773732
Sent from the Struts - User forum at Nabble.com.


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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



Re: ActionForm and EJB

2006-06-08 Thread Michael Jouravlev

On 6/8/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:

Second, an ActionForm is, usually, used to repopulate an HTML form on a
page when an error occurs, or when a page is initially shown.  Since HTML
forms only deal in Strings, another recommendation you frequently hear is
to only have Strings in your ActionForms.  For example, if you have a
textbox in your HTML form for a user to enter a date, having a real Date
field in the ActionForm can lead to problems because of the conversions
that have to take place back and forth (and if I remember correctly, no
conversion is done when redisplaying the HTML form anyway, so you'll get
the default toString() of the Date object, which is almost certainly not
what you want).  If you instead make it a String field, the only
conversion is when you ultimately need to pass it to the business layer,
in which case you have more full control over it.  So, since you probably
want to be dealing with real Java data types in your business classes, but
an ActionForm was designed to deal with HTML forms and therefore only
Strings, trying to make an ActionForm serve both purposes can lead to
problems, so its easier to just avoid the situation altogether.


Plugins like FormDef help with that. FormDef allows to nest a BO/DTO
inside a dynamic form bean, and to define conversion rules. FormDef
also integrates with validator.

On the other hand, the whole idea of Struts/Commons Validator sucks
big time, because database already has all necessary validations,
domains, triggers, etc. Since most apps use database anyway, input
data should either be validated directly by a database or by DAO; DAO
should pull metadata from database to build validation/conversion
rules. Seems that Ruby on Rails is closer to this approach, while most
other frameworks do the same job twice or even three times.

Michael.

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



RE: Digester Error while reading struts config file

2006-06-08 Thread RickD

Sorry, I'm kinda new to this type of forum.  Thanks for your help.  I'm using
Tomcat 5.5.15, struts 1.2.9, and java 1.5.0_06.

thanks
--
View this message in context: 
http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1755486.html#a4776841
Sent from the Struts - User forum at Nabble.com.


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



Re: ActionForm and EJB

2006-06-08 Thread Frank W. Zammetti
On Thu, June 8, 2006 1:09 pm, Michael Jouravlev wrote:
 On the other hand, the whole idea of Struts/Commons Validator sucks
 big time, because database already has all necessary validations,
 domains, triggers, etc. Since most apps use database anyway, input
 data should either be validated directly by a database or by DAO; DAO
 should pull metadata from database to build validation/conversion
 rules. Seems that Ruby on Rails is closer to this approach, while most
 other frameworks do the same job twice or even three times.

I *totally* disagree with this :)

If a user is supposed to enter a first name, and they don't, there is NO
WAY I want to be going through all the overhead of hitting my database to
find that out.  That's just a recipe for disaster in terms of scalability.
 Even if you ask the DAO to do it, and even if all the rules are in the
DAO and the databse doesn't have to get involved, it's still going down
too far into the application.  I grant you that some level of validation
still generally should happen there, as well as at the database, but in
general you want to catch any sort of validation error as soon as you can,
whether that means Javascript on the client for simple things or in the
database for more complex things (i.e., referential integrity).

No, you want as much validation to occur as close to the source of the
problem as possible.  I agree with you that doing it 2 or 3 times isn't
good, and there is probably room for improvement in this regard, but I
definitely would not let it fall to the database as a rule.

Also, to assume that everyone has all sorts of triggers and domains and
such on their databases is, in my experience, a fallacy.  I've seen
numerous databases that have nothing more than required fields and
referential intergrity defined, and that's it.  Any data coming in is
assumed to otherwise have already been validated.  Some people are
downright averse to doing more in the database for various reasons.

 Michael.

Frank

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



RE: Digester Error while reading struts config file

2006-06-08 Thread RickD

I didn't remove any xerces related jars from tomcat cat.  I looked in
common/lib and server/lib but didn't see xerces.

in the web.xml  I only specify a single module config file.
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
load-on-startup2/load-on-startup

There error returned after adding the resolver.jar, xercesImpl.jar, and
xml-api.jar is as follows...
I must have doesn something wrong because it still contains the bluecast
call.



SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation is
not supported
at
com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.java:105)
at
org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:139)
at
org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
at org.apache.commons.digester.Digester.getParser(Digester.java:682)
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3915)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4176)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1085)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1178)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1304)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
at java.lang.Thread.run(Thread.java:595)
Jun 8, 2006 11:25:45 AM org.apache.struts.action.ActionServlet init
SEVERE: Unable to initialize Struts ActionServlet due to an unexpected
exception or error thrown, so marking the servlet as unavailable.  Most
likely, this is due to an incorrect or missing library dependency.
java.lang.NullPointerException
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.



--
View this message in context: 
http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1755486.html#a4777120
Sent from the Struts - User forum at Nabble.com.


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



Re: ActionForm and EJB

2006-06-08 Thread Dave Newton
Frank W. Zammetti wrote:
 On Thu, June 8, 2006 1:09 pm, Michael Jouravlev wrote:
   
 On the other hand, the whole idea of Struts/Commons Validator sucks
 big time, because database already has all necessary validations,
 domains, triggers, etc. Since most apps use database anyway, input
 data should either be validated directly by a database or by DAO; DAO
 should pull metadata from database to build validation/conversion
 rules. Seems that Ruby on Rails is closer to this approach, while most
 other frameworks do the same job twice or even three times.
 

 I *totally* disagree with this :)
   

+1, and Frank didn't even mention that complex business-model-aware
validations most likely _can't_ be done in the database without a pretty
robust payer of triggers and stored procs, which are generally
DB-specific: I don't want to validate zipcodes for addresses anwhere but
at the outer-most levels of the app.

I want form validation to be done as close to the form as possible. I
want business-logic style validation to be done immediately following
generic form processing. DB-level validation (references, etc.) handled
last, and preferably the most generic.

Dave



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



RE: Digester Error while reading struts config file

2006-06-08 Thread Samere, Adam J
The concrete SAXParserFactory implementation to use is determined as
follows:

1. Use the javax.xml.parsers.SAXParserFactory system property if it is
set. (with -Djavax.xml.parsers.SAXParserFactory=my.factory.impl for
example)
2. If JRE/lib/jaxp.properties exists and has a
javax.xml.parsers.SAXParserFactory use that
3. Use a JAR file service provider to look for a file called
META-INF/services/javax.xml.parsers.SAXParserFactory in any jar file on
the CLASSPATH

I'm thinking whatever jar file has com.bluecast.xml.JAXPSAXParserFactory
also has a javax.xml.parsers.SAXParserFactory in the META-INF.

Try removing this jar file if you can, or override it by setting the
javax.xml.parsers.SAXParserFactory as a system property or in
JRE/lib/jaxp.properties

-Original Message-
From: RickD [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 1:33 PM
To: user@struts.apache.org
Subject: RE: Digester Error while reading struts config file


I didn't remove any xerces related jars from tomcat cat.  I looked in
common/lib and server/lib but didn't see xerces.

in the web.xml  I only specify a single module config file.
 
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
load-on-startup2/load-on-startup

There error returned after adding the resolver.jar, xercesImpl.jar, and
xml-api.jar is as follows...
I must have doesn something wrong because it still contains the bluecast
call.



SEVERE: Digester.getParser:
javax.xml.parsers.ParserConfigurationException: XML document validation
is not supported
at
com.bluecast.xml.JAXPSAXParserFactory.newSAXParser(JAXPSAXParserFactory.
java:105)
at
org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParse
r.java:139)
at
org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(Pars
erFeatureSetterFactory.java:73)
at
org.apache.commons.digester.Digester.getParser(Digester.java:682)
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at
org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
et.java:738)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja
va:687)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:1105)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:3915)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4176
)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:10
85)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1178)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:29
2)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j
ava:1304)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1568)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1577)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1557)
at java.lang.Thread.run(Thread.java:595)
Jun 8, 2006 11:25:45 AM org.apache.struts.action.ActionServlet init
SEVERE: Unable to initialize Struts ActionServlet due to an unexpected
exception or error thrown, so marking the servlet as unavailable.  Most
likely, this is due to an incorrect or missing library dependency.
java.lang.NullPointerException
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at
org.apache.commons.digester.Digester.parse(Digester.java:1572)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl
et.java:738)
at org.apache.struts.



--
View this message in context:
http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1
755486.html#a4777120
Sent from the Struts - User forum at Nabble.com.


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


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified 

Re: response.sendRedirect() doesn't work!

2006-06-08 Thread Truong Xuan Tinh
 Thank David for your reply.
Actually, I've known that's not right to do it, in the jsp file, but
I've have no choice in this situation. Because this is the final page in
a wizard-like web application. Normally, the user stop at the final
page, but in some case, the user want to redo the wizard again, and they
don't want to stop at the final page, just finish the current wizard and
start a new one.
Any suggestion would be appreciated.
Thank you.
David Friedman wrote:
 Why not avoid this problem since you are using a tile and simply add a meta
 refresh at the top?  That way you know the page should change and you will
 have no problem with how Tiles handles output.  Personally, I think putting
 a response.sendRedirect() in a jsp is the wrong place.  I try to keep
 redirect to a blank page or a new Forward(...) with redirect=true in the
 action an its outcome.

 Regards,
 David

 -Original Message-
 From: Truong Xuan Tinh [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 08, 2006 12:20 PM
 To: Struts Users Mailing List
 Subject: response.sendRedirect() doesn't work!


  Hi every body,
 I've have a problem with the response.sendRedirect called in a jsp file,
 I've used Tile in my project. I've set the autoFlush=false and set the
 bufferSize to a big number (bufferSize=2048kB) in the master page (of
 Tile) and in the *child* jsp file where the response.sendRedirect() was
 called, I've also set page directive the same as the master page. But it
 didn't work. Some told me that  the following snippet work for them:
 %
 response.sendRedirect(abc.do);
 return;
 %
 I've also tried this, but it didn't work either. I've used Struts 1.2.9
 and Tomcat 5.0.30.
 Please help, thank you very much.

 -
 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: ActionForm and EJB

2006-06-08 Thread Craig McClanahan

On 6/8/06, Dave Newton [EMAIL PROTECTED] wrote:


Frank W. Zammetti wrote:
 On Thu, June 8, 2006 1:09 pm, Michael Jouravlev wrote:

 On the other hand, the whole idea of Struts/Commons Validator sucks
 big time, because database already has all necessary validations,
 domains, triggers, etc. Since most apps use database anyway, input
 data should either be validated directly by a database or by DAO; DAO
 should pull metadata from database to build validation/conversion
 rules. Seems that Ruby on Rails is closer to this approach, while most
 other frameworks do the same job twice or even three times.


 I *totally* disagree with this :)


+1, and Frank didn't even mention that complex business-model-aware
validations most likely _can't_ be done in the database without a pretty
robust payer of triggers and stored procs, which are generally
DB-specific: I don't want to validate zipcodes for addresses anwhere but
at the outer-most levels of the app.

I want form validation to be done as close to the form as possible. I
want business-logic style validation to be done immediately following
generic form processing. DB-level validation (references, etc.) handled
last, and preferably the most generic.



IMHO, where and how to do what kinds of validations is going to be the next
great debate in application framework design :-)  I'll sketch below what I
believe might be an ideal scenario, starting with a couple of motivating
goals:

* Enhance the user experience by catching errors as quickly
 as possible (ideally client side in a webapp), with error messages that
 are relevant to the user's context in that particular application.

* Minimize the number of times I need to specify the same
 validation in source code, metadata, or whatever.  Ideally, every
 such requirement should be stated exactly once.

It's also important to recognize that there's more than one kind of
validation here ... the most important distinction being presentation (is
the date entered by the user syntactically correct for the locale that the
user is interacting with or is this a correctly formatted credit card
number) versus business rules (is the invoice date after the customer's
account-open date or is this credit card number and expiration date
actually valid).  Because the database will have date-oriented data already
converted to a DATE data type, it doesn't really seem appropriate to specify
the presentation style restrictions there (most likely it'd be the same
stuff for every single DATE in the entire schema).  You've also got to deal
with interesting complexities such as fields that are required in some
contexts and not others, so you probably want some mechanism to deal with
exceptions or overrides of the embedded rules.

As to where/how to specify validation rules, using annotations for this (at
a couple of different levels) looks like an interesting possibility --
indeed, it was one of the topics that several of the Struts committers who
got together at JavaOne this year talked about briefly.  One could envision
a situation where business logic validations were encoded as annotations on
the POJOs representing your persistence tier (JPA entity classes, Hibernate
based persistent classes, whatever), while presentation tier validations
were encoded on whatever things your presentation framework uses to store
the intermediate values (properties on an SAF1 ActionForm, or an SAF2/WW
action, or on JSF backing bean, for example).  Ideally, your presentation
framework would also be able to reach through to the business rule
validations of the persistent objects your input forms are bound to, so it
could perform whatever business rule validations it was able to on the
client side (again, in a webapp world, perhaps by having your input field
widgets to AJAX callbacks to the server where necessary).

Indeed, this whole concept is relevant beyond just web frameworks ... it
would make sense in the long term to have a JSR that standardized a set of
validation annotations everyone could share, while giving various frameworks
the freedom to implement the semantics of doing the validation in whatever
fashion best fits the particular technologies that framework uses.


Dave


Craig


Re: multibox not works when all checkboxes are unselected!

2006-06-08 Thread Scott Van Wart

starki78 wrote:

Hi!

I've a large problem with html:multibox.
I've tree checkboxes. When I choose
one or two or three it arrives correct
at the next action!
Only then all checkboxes are deselected
it remembers the state of the checkboxes that was 
selected before! The state of the form is session in struts-config.

Can you help me with this problem??
I really don't have an idea how to solve it!
  
As Adam J. mentioned, it sounds like you're using a session-scoped 
bean.  Try overriding (if you haven't already) the reset() method of 
your form bean and resetting the property:


public void reset( ActionMapping mapping, HttpServletRequest request )
{
   this.values = new String[0];
}

If you're _not_ using a session bean (and are using a request-scoped one 
instead), you'll _still_ want to do the above.  Using this way in both 
cases, values from the previous request are discarded.  If the web 
browser doesn't send any checkbox values over (because none are 
checked), then this.values will be an empty array, which corresponds to 
the very state of the submitted form's checkboxes (ie: none are checked).


The array of values in your formbean for an html:multibox are a list of 
values of checked checkboxes. So...


1. Form bean looks like this:
this.values = { value1, value3, value5 };

2. Displayed form looks like this:
html:multibox property=valuesvalue1/html:multibox 1
html:multibox property=valuesvalue2/html:multibox 2
html:multibox property=valuesvalue3/html:multibox 3
html:multibox property=valuesvalue4/html:multibox 4
html:multibox property=valuesvalue5/html:multibox 5

3. HTML sent to browser looks like this:
input type=checkbox name=values value=value1 checked 1
input type=checkbox name=values value=value1 2
input type=checkbox name=values value=value1 checked 3
input type=checkbox name=values value=value1 4
input type=checkbox name=values value=value1 checked 5

4. User unchecks ALL checkboxes, and submits the form.

5. Struts calls reset() on your form
   - Your reset() method sets this.values = new String[0]

6. Struts populates your form, and _doesn't touch values_, because 
nothing is checked, so values remains an empty array.


Sound good?

- Scott


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



Re: ActionForm and EJB

2006-06-08 Thread Frank W. Zammetti
On Thu, June 8, 2006 2:12 pm, Craig McClanahan wrote:
 IMHO, where and how to do what kinds of validations is going to be the
 next
 great debate in application framework design :-)

Hehe, it's a debate that's been around for a while, not sure it can be the
next great debate :) LOL

 * Enhance the user experience by catching errors as quickly
   as possible (ideally client side in a webapp), with error messages that
   are relevant to the user's context in that particular application.

Absolutely agree.

 * Minimize the number of times I need to specify the same
   validation in source code, metadata, or whatever.  Ideally, every
   such requirement should be stated exactly once.

Absolutely agree.

 It's also important to recognize that there's more than one kind of
 validation here ... the most important distinction being presentation (is
 the date entered by the user syntactically correct for the locale that the
 user is interacting with or is this a correctly formatted credit card
 number) versus business rules (is the invoice date after the customer's
 account-open date or is this credit card number and expiration date
 actually valid).

This is of course true... interestingly, I recently did a sample app for
some folks at work to demonstrate using Commons Validator via AJAX calls. 
In the demo, there was a textbox for an account number entry.  The example
verifies that the account exists on a mainframe system, so I had a custom
rule that did the call to the mainframe and all that.  This was done via
an AJAX call in response to the onBlur of the field.  It's interesting
because I also demonstrated how the regular Struts app still worked with
exactly the same validation rules, and it also showed that you can indeed
code business rules in Commons Validator, and of course it showed how
you can essentially do an event-based validation from the client, all
using the same set of rules and code.

 Because the database will have date-oriented data
 already
 converted to a DATE data type, it doesn't really seem appropriate to
 specify
 the presentation style restrictions there (most likely it'd be the same
 stuff for every single DATE in the entire schema).  You've also got to
 deal
 with interesting complexities such as fields that are required in some
 contexts and not others, so you probably want some mechanism to deal with
 exceptions or overrides of the embedded rules.

Agreed.

 Indeed, this whole concept is relevant beyond just web frameworks ... it
 would make sense in the long term to have a JSR that standardized a set of
 validation annotations everyone could share, while giving various
 frameworks
 the freedom to implement the semantics of doing the validation in whatever
 fashion best fits the particular technologies that framework uses.

I'm still not sold on the whole concept of annotations myself... it seems
to encourage scattering things throughout the code base that otherwise
would be centralized.  I do think it matters what is being annotated
though... I'm pretty strongly against annotating configuration information
for instance, but validation rules... that doesn't quute bother me as
much, not at first blush anyway.

A true validation JSR though, whatever the ultimate implementation
details, I could definitely get behind.


 Dave


 Craig

Frank


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



Re: ActionForm and EJB

2006-06-08 Thread Michael Jouravlev

On 6/8/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:

On Thu, June 8, 2006 2:12 pm, Craig McClanahan wrote:
 * Enhance the user experience by catching errors as quickly
   as possible (ideally client side in a webapp), with error messages that
   are relevant to the user's context in that particular application.

Absolutely agree.

 * Minimize the number of times I need to specify the same
   validation in source code, metadata, or whatever.  Ideally, every
   such requirement should be stated exactly once.

Absolutely agree.


So your argument is basically that database roundtrips will degrade
performance. This should not (ideally) bother an application
developer. A framework should care about that. Metadata retrieval, its
caching, converting metadata to validation rules, combining these
rules with custom rules, this should be performed by a framework. If
database has already defined the rules, they should be used. Whether
it is database itself, or in DAO, or on business layer, or by
validator - does not matter for me as an application developer. But I
don't want to repeat the same rules again and again.On the other hand
I want to be able to add/modify/hide rules or object relationships.
These tasks have been implemented and reimplemented so many times by
many framework/tool developers (not only for Java) that I wonder why
it took 8 years or so for JSR 299 to appear. Still, EJBs as they are
defined now, do not automatically pull and use database metadata (or
do they? I should check out EJB 3.0 spec). So I will be able to use
EJBs as backing beans. BFD. Unless I use several databases or design a
clustered system, I am not tempted to use EJBs at all. If EJB
penetrated deeper in database metadata, then I would have a better
incentive to use them (again, have to check the spec. Maybe it already
does what I want).


I'm still not sold on the whole concept of annotations myself... it seems
to encourage scattering things throughout the code base that otherwise
would be centralized.


Check out Stripes, great stuff.

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



Re: ActionForm and EJB

2006-06-08 Thread Frank W. Zammetti
On Thu, June 8, 2006 2:46 pm, Craig McClanahan wrote:
 Always slow to get on the latest bandwagon, eh Frank :-)

Who, what, me?!?   Nhh!

(hey, you were the last Ant vs. Maven holdout, I was happy I wasn't the
only one... you left me man!! LOL)

 That being said, XML configuration files are going out of fashion, at
 least
 among the developers who speak out a lot :-).

Yeah, I noticed that. :)  I'll be there in 5 years or so :)

I personally think this is the case because there are some *bad* XML
config files around.  I think when done right they are still preferable in
most cases.  However...

 Here's my two cents on when
 I
 like to use annotations, and when I don't.

 * Annotations are a good idea when the configuration concept is directly
   related to how you code your source.  Examples include beans used
   in a webapp (it really matters whether you're going to store it in
 request
   scope or session scope or application scope), transactional settings
   on an EJB, and so on.  Storing the actual annotation in the source code
   reduces the chances that some sysadmin installing your application might
   accidentally or inadvertently change the scope setting, without
 understanding
   that they just broke your code.

Definitely fair poins... and I have to admit, looking at EJB3 as an
example, I in fact *love* annotations!  EJB's (pre-EJB3) are probably the
best example IMO of where config files can go wrong.

 * Annotations are not a good idea when the configuration concept should
   not be a concern of the person actually writing the code.  In webapps,
 for
   example, I don't believe in configuring page navigation rules (Struts
 forwards,
   JSF navigation rules and cases, etc) directly into the action methods.
 The
   actions should describe what happened, not where to go next -- and this
 is
   something I personally don't care for, even at the code level, the way
 that
   WW2 does Results (or Spring MVC does ModelAndView) that combine
   the two concerns together.  But that's a separate issue from whether
   the encoding should be with annotations or not :-).

I agree with you here too.  I remember 5 years or so ago before I started
using Struts, we built our own framework here, and one of the really nice
things about it is that all the navigations rules were in a database... we
could literally change the flow of the application on the fly (a few
exceptions, as you might expect, but generally true).  Separating
navigation rules and such from the code I agree is probably not the right
use for annotations.

Good thoughts... I think we agree here almost entirely :)  I like your
differentiation too... I think when I said I wasn't sold on annotations
yet I may have been subconsciously thinking of the things we both think
may not be the best use for them.  Especially given EJB3, where I do
really see where they make life better, maybe I'm a little more on the
bandwagon than I thought already! :-)

 Craig

Frank


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



Re: ActionForm and EJB

2006-06-08 Thread Dave Newton
Michael Jouravlev wrote:
 Check out Stripes, great stuff.

It is indeed pretty cool.

I really dislike putting my URL mappings in code, though, if for no
other reason than if I'm testing or need to stub out a URL handler
temporarily for some reason I have to touch things in two different
places (maybe I don't; I haven't looked in to it).

I think that's more or less what Craig was saying as well; there are
some things that simply don't belong in annotations; for me that's
really high on the list.

I'd also rather tweak a config file to define a service implementation
than dink in the source code, although that one is less problematic for me.

If it doesn't change the way I'd write the code then for me it's better
somewhere else than the code. Like Frank I've also done a lot with
putting things into a DB that can alter (sometimes radically!) the way
an application works without having to restart anything (DI configured
from a DB can be WONDERFUL, especially if you don't have access to the
config files... and can store implementations in the DB... dangerous,
but very handy).

Dave



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



Re: ActionForm and EJB

2006-06-08 Thread Frank W. Zammetti
On Thu, June 8, 2006 3:07 pm, Michael Jouravlev wrote:
 So your argument is basically that database roundtrips will degrade
 performance.

Yes, but that's only one aspect of it... scalability is also a factor, as
is number of breakage point, as is cost, because to overcome the first two
you have to spend more.  Not to mention complexity, and the need to hire
people with more database expertise.

 This should not (ideally) bother an application
 developer. A framework should care about that.

As far as who provides the actual code, I agree.  But certainly the
application developer has to worry about how the architecture affects
performance, scalability, stability, etc, whether they write the code
themselves or not.

 If
 database has already defined the rules, they should be used.

But can you even code all the complex business logic in the database that
you might require?  I suppose you could write stored procs in Java... I
wonder how much more difficult that would prove than business classes on
the app server? (I've never done it, so I don't know)

 But I
 don't want to repeat the same rules again and again.

This part we definitely agree on.  But a Craig pointed out, there are
different kinds of validation rules, and the repetition is limited
somewhat by the domains being different.  What I mean is, you want to
create a new Student record in the database... you may want to validate
that the first name, last name and teacher's name are entered.  You do
that in the presentation (whether on the client or server, doesn't matter)
because they aren't business rules per se.  You can do this and not
duplicate the code (use Commons Validator, can be called via AJAX if you
want, I've done it).  Now, when you save the record, the record is to be
tied to the teacher's record.  So, now you have a referential integrity
check: does the entered teacher's name exist?  This isn't a check you
would generally do in the presentation layer anyway, they are really two
separate concerns, and appropriate in different places, so there's no real
duplication there.

To summarize my thinking, I think there's really three different types of
validation: presentation, business and data model.

The presentation-type validations are where you many times see
duplication... i.e., Javascript to see if a first name is filled in, then
that same check done on the server, since that double-checking is of
course a best practice.  I think there are ways to avoid that though:
doing those validations with Commons Validator and calling it via AJAX,
and still letting those SAME RULES fire when the final form is submitted,
does the trick (or letting Struts generate the client-side validation
code, if you want to avoid the AJAX call).

For business rules, these are the is the entered dollar amount greater
than the max value for this client? sort of validations.  I find these to
be more appropriate on the app server, NOT in the database, for a variety
of reasons (all the reasons I mentioned earlier, plus the fact that many
times you find that you want a chain of such validations, which I think is
easier to build outside the database using a real CoR implementation).

Then you have the database validations, things like referential integrity.
 In other words, only do validations here that couldn't be done previously
without hitting the database.  This also simplifies the data tier because
it tends to reduce the number of stored procs (read: code in the database)
that has to be written... most of this can be done with triggers and such,
which aren't really code, not as much as stored procs anyway.  In other
words, I view the database as a database and not an app server,
generally-speaking.

 Unless I use several databases or design a
 clustered system, I am not tempted to use EJBs at all.

I've historically HATED EJBs for various reasons... I think EJB3 finally
begins to get them right, and I think you may be surprised how and where
you want to use them all of a sudden.  Another discussion for another day
though :)

 Check out Stripes, great stuff.

Yes, it's on my take a look at that list already :)

Frank

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



Re: Re: Extending Struts with Spring

2006-06-08 Thread Dakota Jack

Don't forget about the AOP aspect (no pun intended) of Spring.  While
the IoC is handy, it is nothing, in my opinion, in comparison to the
solution regarding logging, security, metrics, etc. in Spring with
AOP.

On 6/8/06, Julian Tillmann [EMAIL PROTECTED] wrote:


Thanks very much for all your answers, I'd be very keen to learn more about 
this soon.

--


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl

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





--
You can lead a horse to water but you cannot make it float on its back.
~Dakota Jack~

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



Reload the same page

2006-06-08 Thread Maya menon
All,
   
  I have a page, results.jsp with a link 
   ahref=deleteAction.do?/
   
  In deleteAction,  the record will be deleted by calling the helper classes 
and on succesful delete the request should be forwarded again to the 
results.jsp.
   
  How can I achieve this ?
   
  In strts-config, i have it properly pointed. But the page doesnot refresh. Am 
I missing anything ?
   
  Thanks
   

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

Re: Reload the same page

2006-06-08 Thread Albert L. Sapp

Maya menon wrote:


All,
  
 I have a page, results.jsp with a link 
  ahref=deleteAction.do?/
  
 In deleteAction,  the record will be deleted by calling the helper classes and on succesful delete the request should be forwarded again to the results.jsp.
  
 How can I achieve this ?
  
 In strts-config, i have it properly pointed. But the page doesnot refresh. Am I missing anything ?
  
 Thanks
  


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

In our application, we place the parameters that created the results in 
session scope bean.  Then, you can rebuild your results for the result 
page in the delete action or redirect on a successful delete back to the 
action that normally does the query and builds the results.


HTH,

Al


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



Variable 'input' attribute in struts-config.xml

2006-06-08 Thread Scott Van Wart
I have two different pages that call the same action.  I'm using 
validate=true in the action mapping.  Can I specify the 'input' 
attribute dynamically (or set it somewhere while the action is being 
called, before validation?).


Thanks,
 Scott

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



RE: Variable 'input' attribute in struts-config.xml

2006-06-08 Thread Ralf Stoltze
hi.

 I have two different pages that call the same action.  I'm 
 using validate=true in the action mapping.  Can I specify 
 the 'input' 
 attribute dynamically (or set it somewhere while the action 
 is being called, before validation?).

never tried, but ...

your action's execute method gives you an ActionMapping object which can
call setInput(String input).

you have to set validate=false in order to give control to the action
before validation starts. you can then manually call
form.validate(mapping, request) (+ save errors into request, + return
inputForward ). 


hth, ralf


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



Re: Variable 'input' attribute in struts-config.xml

2006-06-08 Thread Michael Jouravlev

On 6/8/06, Scott Van Wart [EMAIL PROTECTED] wrote:

I have two different pages that call the same action.  I'm using
validate=true in the action mapping.  Can I specify the 'input'
attribute dynamically (or set it somewhere while the action is being
called, before validation?).


You cannot change config information that has been defined in
struts-config.xml file. If you try, you will likely get The
configuration is frozen exception.

You may want to try using wildcards [1], but it looks that wildcards
are not the answer to your question.

I suggest to look at your issue from another perspective. Do you
really need the functionality you are asking for? First, a small
clarification. There is no input page for an action, input attribute
is poorly named, it should be called error or errorTarget, because
Struts forwards to that location if input data does not validate. Your
request is always sent to action/actionform.

It appears to me that you have two different HTML forms that are
submitted to one action. After many years of using Struts this
page-oriented approach seems convoluted and inflexible to me. If these
forms are different views of one web resource, they should be rendered
by one action, and a proper page is chosen depending on resource
state. If these forms are views of different resources, then they
should be served by different action classes belonging to different
web resources, that is, you simply should not submit to one action
class from views that represent different web resources.

So, to display the first form you call FirstAction and tell it to
render itself. It shows the form, you fill it out, submit, in case of
error it redisplays the form. Do display the second form you call
SecondAction and tell it to render itself. It shows the form, you fill
it out, submit, in case of error it redisplays the form. :-) This is
it, all you need is two actions, not two input attributes.

If you have time, the DataEntryForm page [2] explains my opinion on that matter.

[1] 
http://struts.apache.org/struts-action/userGuide/building_controller.html#action_mapping_wildcards
[2] http://wiki.apache.org/struts/DataEntryForm

Michael.

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



Re: hotkeys

2006-06-08 Thread Miguel Galves

What exactly do you want to do ?

On 6/8/06, Marcus [EMAIL PROTECTED] wrote:


Is there a way of adding hotkeys to a form field in struts?
I would like to add the keys F1-F4 to my form fields 1-4.

Thx,

Marcus

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





--
Miguel Galves - Engenheiro de Computação
Já leu meus blogs hoje?
Para geeks http://log4dev.blogspot.com
Pra pessoas normais
http://miguelgalves.blogspot.com

Não sabendo que era impossível, ele foi lá e fez...


Re: [shale] Problems after updating to MyFaces 1.1.3

2006-06-08 Thread Gary VanMatre
From: Richard Wallace [EMAIL PROTECTED] 

 Hey all, 
 
 I'm having a problem with clay after updating to MyFaces 1.1.3 and 
 Tomahawk 1.1.3. I'm getting a couple of these when the webapp is deployed: 
 
 2006-06-08 10:02:55,174 2621 ERROR [http-8080-Processor24] 
 org.apache.shale.clay.config.beans.ComponentConfigBean 
 (ComponentConfigBean.java:235) - java.net.MalformedURLException: Path 
 does not start with a / character 


This one kind of looks like it might be an issue with tokenizing the 
COMMON_CONFIG_FILES
value list.  I think that it might not be ignoring all the whitespace between 
config files.  That
might explain the exception if it's on a path of  .  Try putting the list of 
files on the same line.
If that works, please create a JIRA ticket on it.

 
 The configuration in the web.xml is 
  !-- Clay Common Configuration Resources --
  context-param
param nameorg.apache.shale.clay.COMMON_CONFIG_FILES/param-name
param-value
  /WEB-INF/clay-common-config.xml, /WEB-INF/clay-institution-config.xml,
  /WEB-INF/clay-common-symbols.xml,
/WEB-INF/clay-institution-symbols.xml,
  /WEB-INF/clay-tomahawk-config.xml
/param-value
  /context-param
 
 I'm using the shale-1.0.3-SNAPSHOT from the maven repo at 
 http://svn.apache.org/maven-snapshot-repository. The strange thing is 
 that the app seems to start up normally otherwise. Any ideas what 
 could be going on here? 
 
 I'm also having a problem whenever I submit a form that 
 for some reason it doesn't seem to be doing navigation properly, and 
 strangest of all, the page that is rendered gets rendered three times, 
 one right after the other. Has anyone else seen this odd behaviour? 
 

I'm not sure about the weird rendering problem but it might be a result
of not loading all the clay resources.  Since this happens in a context
listener, exceptions can only be logged.  It doesn't top the loading 
of the app.

 


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

Re: hotkeys

2006-06-08 Thread Frank W. Zammetti

Hi Marcus,

Take a look at the accessKey attribute, I think that's what you want... 
however, I don't believe it is possible to assign function keys, I think 
you only have letters and numbers, and maybe punctuation marks.


You could do what you want via scripting though, where I believe you can 
capture function keys.  Try setting up a key handler for the document 
itself, and just call focus() on the element you want to receive focus 
when the appropriate key is pressed.


Frank

Miguel Galves wrote:

What exactly do you want to do ?

On 6/8/06, Marcus [EMAIL PROTECTED] wrote:


Is there a way of adding hotkeys to a form field in struts?
I would like to add the keys F1-F4 to my form fields 1-4.

Thx,

Marcus

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







--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



RE: wanna know abt threads and springs

2006-06-08 Thread Rakesh.Bhat
Hi,

To know about spring; try it from:
http://www.springframework.org/docs/reference/

It is always a best to know from founders. 

 
Cheers 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 08, 2006 5:38 PM
To: user@struts.apache.org
Subject: RE: wanna know abt threads and springs
Importance: Low


Hi ,
  If you are talking about thread basicsthe best resource is
www.javaranch.com. For springs...well I am still referring O'Reilly
books for that!

Regards,
Animesh Saxena
RR Donnelley
Wipro Technologies
Bangalore.
99860-76686


When Life tears you down, it builds you up.

-Original Message-
From: Patil, Sheetal [mailto:[EMAIL PROTECTED]

Sent: Thursday, June 08, 2006 5:35 PM
To: Struts Users Mailing List
Subject: wanna know abt threads and springs

Hi

Actually I work on struts and tomcat 5.0 and I am not aware of
treads and springs, which are more popular on mailing list now days, so
can u please tell me about these or give me some links for threads and
springs

Thanks in advance
Sp


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]





DISCLAIMER:
This message contains privileged and confidential information and is intended 
only for the individual named.If you are not the intended recipient you should 
not disseminate,distribute,store,print, copy or deliver this message.Please 
notify the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system.E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be 
intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain 
viruses.The sender therefore does not accept liability for any errors or 
omissions in the contents of this message which arise as a result of e-mail 
transmission. If verification is required please request a hard-copy version.

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



Re: [Struts + Tiles] JSTL problem on WebSphere Application Server 6

2006-06-08 Thread Rafael

Hi David,

After a couple of days I finally solved this question, you're correct... I 
finally found a fix pack that fix this problem (WAS6 Fix pack 9 at 
http://www-1.ibm.com/support/docview.wss?rs=180uid=swg27007534#steps).
So, for all people that uses WebSphere Application Server:  Keep your WAS up 
to date!


more about WAS updates at 
http://www-1.ibm.com/support/docview.wss?rs=180uid=swg27004980


your suggestion pointed me to the right direction, thanks a lot!!!

-Rafael T Icibaci


- Original Message - 
From: Karr, David [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Monday, June 05, 2006 12:27 PM
Subject: RE: [Struts + Tiles] JSTL problem on WebSphere Application Server 6


Curiously, I thought to do a Google to verify whether Websphere 6 was a
Servlet 2.4 container, which is relevant to your situation, and in
addition to verifying that, I also found someone who had the exact same
problem as you, at http://www.jroller.com/page/agrebnev/20050831.  As
this blog entry is almost a year old, perhaps there are revisions to WS6
that fixes this.

However, note the following:

1. You need to use the JSTL 1.1 version, as you have a Servlet 2.4
container.
2. You need to make sure your web.xml is using the servlet 2.4 format,
and not 2.3.  If you use the latter, EL expressions in your JSP will not
be evaluated.  The servlet 2.4 format uses a schema, and not a dtd.


-Original Message-
From: Rafael [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 04, 2006 12:16 PM
To: Struts Users Mailing List
Subject: Re: [Struts + Tiles] JSTL problem on WebSphere
Application Server 6

I'm using JSTL version 1.0, but 1.1 doesn't work too. No, I haven't.

Can you explain JSTL stopped working a little more extensively?
sure, will try to give examples... I've a JSP page called
index.jsp in this index page I included another jsp page
called taglib.jsp in this taglib.jsp I've only the taglib URI
imports(see below). So, in the index.jsp page I use %@
include file=taglibs.jsp % and so...I can make use of JSTL
tags. If I do so, in the index.jsp tags like c:out
value=Hi/ doesn't work, actually all JSTL tags doesn't
work. But if I include the URI tag (%@ taglib
uri=http://java.sun.com/jstl/core; prefix=c %) in the
index.jsp page, all JSTL tags work perfectly...


**Taglibs.jsp
**
%--
 This file includes all necessary tag libraries for the JSPs
in this application.  Pages can  include this file like this
%@ include file=/taglibs.jsp % so that they don't  have
to explicitly include all of these taglibs on each page.
--%
%@ taglib uri=struts-tiles.tld prefix=tiles % %@
taglib uri=struts-html.tld prefix=html %

%@ taglib uri=http://java.sun.com/jstl/core; prefix=c %
**
**

-Rafael T Icibaci


- Original Message -
From: Samere, Adam J [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 02, 2006 12:36 PM
Subject: RE: [Struts + Tiles] JSTL problem on WebSphere
Application Server 6


I doubt that the include is not working. What version of JSTL are you
using? Do you have taglib entries in web.xml?

Can you explain JSTL stopped working a little more extensively?

-Original Message-
From: Rafael [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 11:01 AM
To: Struts Users Mailing List
Subject: [Struts + Tiles] JSTL problem on WebSphere
Application Server 6

Hi Guys,

I've an application that uses Struts and Tiles, this application was
running on WebSphere 5.1 for almost 3 years but now when we moved to
WAS6 JSTL stopped working. Let me give an example:

we've a jsp page called taglibs.jsp, in this jsp page we've all the
struts, jstl taglibrary imports. So, when we need struts or JSTL in
another JSP page we just include this taglibs.jsp. Using -
%@ include
file=/jsp/taglibs.jsp % , seems that WAS6 container support JSP 2.0
and somehow this caused the include directive to stop
working. I found a
lot of messages in Forums and after I read the JSP 2.0 spec, I decided
to set encoding to each page. Isn't worked because actually include
directive includes content like- p Content /p but don't include
taglib directives like the one below.
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %


Any ideias ?

Thanks !!

-Rafael T Icibaci


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, 

Error with dynaactionform integer property

2006-06-08 Thread Medicherla Lakshmi
Hi, 
   
  I have an action in which am trying to get two values from database, one is 
of type Integer and the other String. I have put them in an ArrayList and have 
set to an attribute like request.setAttribute(Employee, Employee).  Form for 
this action is of type dynaactionform.  
   
  When am trying to retrieve these values in the jsp using bean:write,  it is 
throwing exception for the Integer value, whereas working fine with the String 
value.  The error says:
   
  javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE\par
   
  Please tel me why i get this error and if i can use integer value in 
bean:write after defining that property using logic:iterate.
   
  Thanks and Regards,
  MSV Lakshmi.

 Send instant messages to your online friends http://in.messenger.yahoo.com 

 Stay connected with your friends even when away from PC.  Link: 
http://in.mobile.yahoo.com/new/messenger/  

kindly help please

2006-06-08 Thread xavier prad

Can I use swings instead of jsp as view in struts
Regards
Pradhap


Re: kindly help please

2006-06-08 Thread Frank W. Zammetti

Hi Pradhap,

Yes, you can.  However, your JSPs will in all probability NOT be 
rendering markup for display to the user... they will probably generate 
some sort of data structure that your Swing client will use to update 
the view.  Maybe XML for example.


Your Swing app just makes HTTP requests to the app on the server as 
usual.  I know this because about 3 years ago I was asked to do this... 
the project didn't go beyond proof-of-concept, but it was working just 
fine before it was aborted.


Now, keep in mind that when you use JSPs, assuming you use Struts tags, 
you'll be giving that stuff up, or more precisely, you'll have to code 
it all yourself... if input validation fails for instance, you'll have 
to deal with redisplaying the entered values (if they were ever not 
visible that is).


Frank

xavier prad wrote:

Can I use swings instead of jsp as view in struts
Regards
Pradhap



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



Re: kindly help please

2006-06-08 Thread xavier prad

hai *Zammetti,*
*Thanks for the help you have extended me .Kindly let me know some websites
to find the details .*
*Regards ,*
*Pradhap.*


On 6/9/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:


Hi Pradhap,

Yes, you can.  However, your JSPs will in all probability NOT be
rendering markup for display to the user... they will probably generate
some sort of data structure that your Swing client will use to update
the view.  Maybe XML for example.

Your Swing app just makes HTTP requests to the app on the server as
usual.  I know this because about 3 years ago I was asked to do this...
the project didn't go beyond proof-of-concept, but it was working just
fine before it was aborted.

Now, keep in mind that when you use JSPs, assuming you use Struts tags,
you'll be giving that stuff up, or more precisely, you'll have to code
it all yourself... if input validation fails for instance, you'll have
to deal with redisplaying the entered values (if they were ever not
visible that is).

Frank

xavier prad wrote:
 Can I use swings instead of jsp as view in struts
 Regards
 Pradhap


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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




Re: kindly help please

2006-06-08 Thread Frank W. Zammetti
Sorry, I don't have any applicable links to give.  Some time with Google 
might find you some details.


Frank

xavier prad wrote:

hai *Zammetti,*
*Thanks for the help you have extended me .Kindly let me know some websites
to find the details .*
*Regards ,*
*Pradhap.*


On 6/9/06, Frank W. Zammetti [EMAIL PROTECTED] wrote:


Hi Pradhap,

Yes, you can.  However, your JSPs will in all probability NOT be
rendering markup for display to the user... they will probably generate
some sort of data structure that your Swing client will use to update
the view.  Maybe XML for example.

Your Swing app just makes HTTP requests to the app on the server as
usual.  I know this because about 3 years ago I was asked to do this...
the project didn't go beyond proof-of-concept, but it was working just
fine before it was aborted.

Now, keep in mind that when you use JSPs, assuming you use Struts tags,
you'll be giving that stuff up, or more precisely, you'll have to code
it all yourself... if input validation fails for instance, you'll have
to deal with redisplaying the entered values (if they were ever not
visible that is).

Frank

xavier prad wrote:
 Can I use swings instead of jsp as view in struts
 Regards
 Pradhap


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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