Re: How to get posted data into a nested object ?

2005-06-08 Thread gdeschen
Thanks for the warning !
Not all of the properties are shown to the user.
The date gets formatted based on a locale.

I will certainly look into the FormDef.

- Glenn




Hubert Rabago [EMAIL PROTECTED] 
07/06/2005 05:43 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: How to get posted data into a nested object ?






By the way, I should warn you that using Date and int fields on a form
bean (which is what you're essentially doing) can lead to problems
when the user types in invalid data.

Maybe you'd be interested in something like FormDef? 
http://formdef.dev.java.net

Hubert

On 6/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello,
 
 Short description:
 -
 How do I get posted data into a bean within the form bean ?
 
 The JSP has this code.
 html-el:text property=dependent.firstName maxlength=15 value=
 ${dependentForm.dependent.firstName}/
 
 The page is posted and I get this error:
 [07/06/05 15:15:22:743 EDT] 6aa06aa0 WebGroup  E SRVE0026E: [Servlet
 Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean
 specified
 
 Really I'm getting exasperated trying to get this working.
 All of the examples I've found deal with collections or simply getting 
the
 data onto the page.
 I need to pick it up from the page.
 
 
 Long Description:
 -
 My form bean contains a value object.
 public class DependentForm extends ActionForm {
private ImageButtonBean addButton = new ImageButtonBean();
private ImageButtonBean cancelButton = new ImageButtonBean();
private DependentVO dependent;
 ...
 
 public class DependentVO extends Dependent {
 ...
 
 public class Dependent extends People {
 ...
 
 public class People {
private Date dateOfBirth;
private int employeeNumber;
private String firstName;
private String lastName;
private String relationshipCode;
private String sexTypeCode;
private String smokerIndicator;
 
 The JSP has this code.
 html-el:text property=dependent.firstName maxlength=15 value=
 ${dependentForm.dependent.firstName}/
 
 TIA,
 Glenn


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





Re: How to get posted data into a nested object ?

2005-06-08 Thread gdeschen
Is this the only way to do it ?
I have always never coded anything additional in the getter/setter 
methods.

- Glenn




Hubert Rabago [EMAIL PROTECTED] 
07/06/2005 05:42 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: How to get posted data into a nested object ?






It's not clear within your error at which point the error is
occurring.  The problem could be that when BeanUtils tries to populate
the firstName field of the dependent bean, dependent is null.  Maybe
you need to modify your form so that getDependent() always returns a
valid DependentVO object, instantiating one as needed.

Hubert

On 6/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hello,
 
 Short description:
 -
 How do I get posted data into a bean within the form bean ?
 
 The JSP has this code.
 html-el:text property=dependent.firstName maxlength=15 value=
 ${dependentForm.dependent.firstName}/
 
 The page is posted and I get this error:
 [07/06/05 15:15:22:743 EDT] 6aa06aa0 WebGroup  E SRVE0026E: [Servlet
 Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean
 specified
 
 Really I'm getting exasperated trying to get this working.
 All of the examples I've found deal with collections or simply getting 
the
 data onto the page.
 I need to pick it up from the page.
 
 
 Long Description:
 -
 My form bean contains a value object.
 public class DependentForm extends ActionForm {
private ImageButtonBean addButton = new ImageButtonBean();
private ImageButtonBean cancelButton = new ImageButtonBean();
private DependentVO dependent;
 ...
 
 public class DependentVO extends Dependent {
 ...
 
 public class Dependent extends People {
 ...
 
 public class People {
private Date dateOfBirth;
private int employeeNumber;
private String firstName;
private String lastName;
private String relationshipCode;
private String sexTypeCode;
private String smokerIndicator;
 
 The JSP has this code.
 html-el:text property=dependent.firstName maxlength=15 value=
 ${dependentForm.dependent.firstName}/
 
 TIA,
 Glenn


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





Re: Pb with html:link

2005-06-08 Thread gdeschen
Just as a double check Jean Marie.
You need to have the taglibs in both the resultat.jsp and the 
headerRecherche.jsp.

This is how I do my include:
jsp:include page=/includes/header.jsp flush=true/
Do try with the attribute flush to true.

- Glenn




JM Tinghir [EMAIL PROTECTED] 
08/06/2005 08:02 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Pb with html:link






Yes I did.
I have a html:rewrite/ in it that works correctly.

Jean-Marie Tinghir


2005/6/8, Chris Loschen [EMAIL PROTECTED]:
 Did you include a taglib reference in headerRecherche.jsp? Something
 like this:
 
 %@ page language=java%
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean%
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic%
 
 In this case, you need the html taglib for your html:link to work.
 
 Hope that helps!
 
 Chris Loschen
 
 -Original Message-
 From: JM Tinghir [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 08, 2005 3:39 AM
 To: Struts Users Mailing List
 Subject: Pb with html:link
 
 Hello,
 I have a JSP (resultat.jsp) in which there's :
 html:link page=/suppression.doSuppression/html:link
 This is working perfectly.
 
 This JSP includes another one :
 jsp:include page=template/headerRecherche.jsp/
 This is still working perfectly.
 
 But when I put the html:link in the headerRecherche.jsp , I get a
 NullPointerException...
 And this is not working perfectly anymore! ;-)
 
 In my struts-config.xml, I have :
 action
 path=/suppression
 forward=/jsp/suppression.jsp/
 
 Thanks for your help.
 
 Jean-Marie Tinghir
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 ___
 Siebel
 IT'S ALL ABOUT THE CUSTOMER
 Visit www.siebel.com
 
 This e-mail message is for the sole use of the intended recipient(s) and 
contains confidential and/or privileged information belonging to Siebel 
Systems, Inc. or its customers or partners. Any unauthorized review, use, 
copying, disclosure or distribution of this message is strictly 
prohibited. If you are not an intended recipient of this message, please 
contact the sender by reply e-mail and destroy all soft and hard copies of 
the message and any attachments. Thank you for your cooperation.
 
 -
 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: Highly dynamic forms

2005-06-08 Thread gdeschen
The section I was refering you to is the Hand Cranking the lazy List in 
the Action Form.
This is a small section squeezed in between lazy list information.
This does not require any other class but the ActionForm.
All that is needed is to add code to grow the list and to get the proper 
objects back.

- Glenn




Stéphane Zuckerman [EMAIL PROTECTED] 
08/06/2005 12:09 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Highly dynamic forms






[EMAIL PROTECTED] a écrit :
 http://wiki.apache.org/struts/StrutsCatalogLazyList
 Look at the section: Hand Cranking lazy List in the ActionForm.
 This is possible with the version you are currently using.

Actually, the LazyValidatorForm class only exists since struts 1.2.6, 
that is why I was asking for a solution under Struts 1.2.4.

Moreover, the use I have of LazyList is so small that I don't think that 
upgrading my version of commons-collection just for this one piece of 
code is relevant... I have my own LazyList implementation, which is 
doing what I am expecting of it. When we need a more complete/complex 
use of lazy objects, I'll upgrade. :-)

That doesn't solve my problem, though. I do have radio buttons working 
from a lazy list, something like
[ [value, [radio1,radio2,radio3]], [value, [radio1,radio2]] ]
In the end then, I manage to get the attribute value from a radio input, 
but when I try with checkboxes, I fail to retrieve the String[] 
object... Well, I'll manage, eventually.

-- 
Stéphane Zuckerman

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





Re: How to get posted data into a nested object ?

2005-06-08 Thread gdeschen
Hubert Rabago [EMAIL PROTECTED] wrote on 08/06/2005 02:15:20 PM:

 I would think so.  I'm not as familiar with the internals of BeanUtils
 as I'd like to be, but since your form is in request scope, that means
 it'll create a new instance upon submission.  From that, it'll call
 getDependent().  If that returns null, I'm not sure what BeanUtils
 would do.  I'd bet it'd just throw an error, and if I had time I'd
 like to see if I can win that bet.

This is exactly what I have coded...
public DependentVO getDependent() {
   if (dependent == null) {
  dependent = new DependentVO();
   }
   return dependent;
}

It works like a charm... gotta run a demo in 8 minutes...
Damn I hate those close deadlines !

- Glenn


Re: html-el:checkbox quandary

2005-06-07 Thread gdeschen
As Hubert suggested here are some of the details.

form-beans
   form-bean name=dependentForm type=
hronline.secure.personal.dependents.DependentForm
   /form-bean
/form-beans

action path=/personal/Dependent type=
hronline.secure.personal.dependents.DependentAction name=dependentForm 
scope=request validate=false
   forward name=dependent path=
/WEB-INF/personal/dependents/dependent.jsp
   /forward
   forward name=cancel path=/personal/Dependents
   /forward
/action 

...
public class DependentForm extends ActionForm {
   private DependentVO dependent;

   public DependentVO getDependent() {
  return dependent;
   }

   public void setDependent(DependentVO dependentVO) {
  dependent = dependentVO;
   }
...
}

public class DependentVO extends Dependent implements Serializable {
   private String disabledIndicator;
   private String dentalEligibilityIndicator;
   private String dependentId;
   private String fulltimeStudentIndicator;
   private String healthEligibilityIndicator;
   private String pensionEligibilityIndicator;

   public String getHealthEligibilityIndicator() {
  return healthEligibilityIndicator;
   }

   public void setHealthEligibilityIndicator(String string) {
  healthEligibilityIndicator = string;
   }

Once again... I really appreciate your time and patience with this !
- Glenn






Hubert Rabago [EMAIL PROTECTED] 
06/06/2005 05:50 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: html-el:checkbox quandary






Yes.  Maybe if you include the actual mappings, JSP text, form
declaration, etc, someone will find something.  From what you've said,
it should work.

Hubert


On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Yes the form bean is associated with the HTML form.
 
 If I simply do this:
 c:out value=${dependentForm.dependent.healthEligibilityIndicator}/
 It writes out the contents. This takes care of the value attribute.
 
 My question is for the property.
 Can a nested bean property be used in the html-el:checkbox as the
 property?
 
 - Glenn
 
 
 Hubert Rabago [EMAIL PROTECTED]
 06/06/2005 04:24 PM
 
 
 
 Is dependentForm is form bean associated with the HTML form that
 your checkbox is a part of?  There could be a typo in your
 struts-config, or your html:form, or your form declaration.
 
 Hubert
 
 On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  I gave it a go and I get this error now... more precise but an error
 none
  the less...
  [06/06/05 15:40:53:846 EDT] 5dc35dc3 WebGroup  E SRVE0026E: 
[Servlet
  Error]-[No getter method for property
 dependent.healthEligibilityIndicator
  of bean org.apache.struts.taglib.html.BEAN]:
  javax.servlet.jsp.JspException: No getter method for property
  dependent.healthEligibilityIndicator of bean
  org.apache.struts.taglib.html.BEAN
 
 

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





Re: html-el:checkbox quandary

2005-06-07 Thread gdeschen
Oh sh* !
Hubert you had your finger on the problem all along...
Now that I have had my first coffee of the day things are falling in 
place.

The problem is that the JSP is posting to an action which did not have the 
correct form bean.
So it wasn't able to find the property method.

This raises a question.
Say I have a Dependent and DependentSubmit actions.
The Dependent action gets data from the DB and displays it using the 
DependentForm.
The DependentSubmit action is also using the DependentForm.

In the JSP that is executed for the Dependent action this gets executed:
html-el:checkbox property=dependent.healthEligibilityIndicator
value=${dependentForm.dependent.healthEligibilityIndicator}/

Based on my problems, is it safe to say that the property is resolved 
on the action being submitted to and the the value on the action currently 
handling the request?

- Glenn




[EMAIL PROTECTED] 
07/06/2005 07:29 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: html-el:checkbox quandary






As Hubert suggested here are some of the details.

form-beans
   form-bean name=dependentForm type=
hronline.secure.personal.dependents.DependentForm
   /form-bean
/form-beans

action path=/personal/Dependent type=
hronline.secure.personal.dependents.DependentAction name=dependentForm 

scope=request validate=false
   forward name=dependent path=
/WEB-INF/personal/dependents/dependent.jsp
   /forward
   forward name=cancel path=/personal/Dependents
   /forward
/action 

...
public class DependentForm extends ActionForm {
   private DependentVO dependent;

   public DependentVO getDependent() {
  return dependent;
   }

   public void setDependent(DependentVO dependentVO) {
  dependent = dependentVO;
   }
...
}

public class DependentVO extends Dependent implements Serializable {
   private String disabledIndicator;
   private String dentalEligibilityIndicator;
   private String dependentId;
   private String fulltimeStudentIndicator;
   private String healthEligibilityIndicator;
   private String pensionEligibilityIndicator;

   public String getHealthEligibilityIndicator() {
  return healthEligibilityIndicator;
   }

   public void setHealthEligibilityIndicator(String string) {
  healthEligibilityIndicator = string;
   }

Once again... I really appreciate your time and patience with this !
- Glenn






Hubert Rabago [EMAIL PROTECTED] 
06/06/2005 05:50 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: html-el:checkbox quandary






Yes.  Maybe if you include the actual mappings, JSP text, form
declaration, etc, someone will find something.  From what you've said,
it should work.

Hubert


On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Yes the form bean is associated with the HTML form.
 
 If I simply do this:
 c:out value=${dependentForm.dependent.healthEligibilityIndicator}/
 It writes out the contents. This takes care of the value attribute.
 
 My question is for the property.
 Can a nested bean property be used in the html-el:checkbox as the
 property?
 
 - Glenn
 
 
 Hubert Rabago [EMAIL PROTECTED]
 06/06/2005 04:24 PM
 
 
 
 Is dependentForm is form bean associated with the HTML form that
 your checkbox is a part of?  There could be a typo in your
 struts-config, or your html:form, or your form declaration.
 
 Hubert
 
 On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  I gave it a go and I get this error now... more precise but an error
 none
  the less...
  [06/06/05 15:40:53:846 EDT] 5dc35dc3 WebGroup  E SRVE0026E: 
[Servlet
  Error]-[No getter method for property
 dependent.healthEligibilityIndicator
  of bean org.apache.struts.taglib.html.BEAN]:
  javax.servlet.jsp.JspException: No getter method for property
  dependent.healthEligibilityIndicator of bean
  org.apache.struts.taglib.html.BEAN
 
 

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






Re: Validation Help On Large Dynamic List

2005-06-07 Thread gdeschen
This may help you:
http://wiki.apache.org/struts/StrutsCatalogLazyList
http://www.developer.com/java/ejb/article.php/3321521
http://www.developer.com/java/ejb/article.php/2233591

- Glenn




Scott Purcell [EMAIL PROTECTED] 
07/06/2005 09:19 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Validation Help On Large Dynamic List






Hello,

I am using the struts framework for a project, and I am seeking advice on 
the following situation. To preface where I am, we have used server side 
validation (validation.xml) throughout the full project and all is good. I 
understand simple field validation and the attributes of the 
validation.xml file.

But as with any project, here is my problem: I have a database query that 
returns hundreds of records. The way this works, is we display the user 
list of keys, and defualt values, and they can change the values to their 
liking. 

eg:
Field1 (then in a textfield they get something like [field 1 default 
value]
Field2 [field2 default value]
and so on and so on.

Here is how the actual code looks on the page.
Now what my original page builder did, was take the value and also placed 
it in a hidden field for some type of database update later on. Hope this 
makes sense .

Agricultural Implements  input type=text name=gprID751464 
value=Agricultural Implements
input type=hidden name=origGprID751464 value=Agricultural 
Implements

Agricultural Tractors input type=text name=gprID751499 
value=Agricultural Tractors
input type=hidden name=origGprID751499 value=Agricultural Tractors


But what is occuring is sometimes they remove the value and then there is 
no value. And I would like to validate this.
So my question is as follows:
If I have a database query with a lot of records that have rows like so:
key1 val1
key2 val2
key3 val3

How can I validate this for required on each value?

I have been reading about indexed validation but do not seem to have a 
handle on it.

Can anyone give some assistance, or ideas? I did not want to do this in 
simple javascript, as the rest of the site is all server side with 
Messages.


Thanks
Scott

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





Re: Highly dynamic forms

2005-06-07 Thread gdeschen
http://wiki.apache.org/struts/StrutsCatalogLazyList
Look at the section: Hand Cranking lazy List in the ActionForm.
This is possible with the version you are currently using.

HTH,
- Glenn




Stéphane Zuckerman [EMAIL PROTECTED] 
07/06/2005 12:28 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Highly dynamic forms






Martin Gainty a écrit :
 Stephane
 Did you look at LazyList?
 http://wiki.apache.org/struts/StrutsCatalogLazyList


I did, and that's why I asked if there was a solution without using a 
version of struts  1.2.4 . :-) I don't think my colleagues would like 
it if I were to change the version of the libraries we have been using
for months now. Of course, if there is no other easy way, I'll update 
the libs, and that'll be it.

 Here's the question for the short version (below you'll find some 
 lengthier explanations ...) :

 I'd like to render a list of groups of radio buttons. Said list has a 
 variable length. So my data structure looks like :

 [ [radio1,radio2,radio3], [radio1,radio2,radio3,radio4], ...]

 I am currently using Struts 1.2.4. Is there a way of rendering these 
 groups of radio buttons without upgrading my version of Struts ?


-- 
Stéphane Zuckerman

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





Re: i18n url link problem

2005-06-07 Thread gdeschen
The problem is that you have a tag nested within a tag.
In order to do this you need to use the html-el:link tag. The el is 
Expression Language.
However, I am having difficulties with applying the el tags... so I cannot 
yet help you.

One quick way around this is to do it this way:
a class=topNavLink href=bean:message key='link.url'/
   bean:message key=link.title/ 
/a

HTH,
Glenn




Braun, James F [EMAIL PROTECTED] 
07/06/2005 02:59 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
i18n url link problem






I have a struts app that needs to change a link's url as well as the
title. That is, the url for the product catalogs are different for
Germany and US as well as the titles.

en_US
link.title=Products
link.url=http://www.myUScompany.com/products
de_DE
link.title=Produkte
link.url=http://www.myDEcompany.com/catalog

I have no problem with the title but getting the url into the href=~
part of the tag on the .jsp page is driving me nuts!

Here is the history of my logic for a top bar menu link: (referring to
the property file above)

I started with: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
 Products 
/html:link

I converted the title phrase to i18n which worked fine: 
html:link styleClass=topNavLink
href=http://www.myUScompany.com/products;
 bean:message key=link.title/ 
/html:link

I tried to convert the link to i18n like this: 
html:link styleClass=topNavLink href=bean:message
key=link.url/ 
 bean:message key=link.title/ 
/html:link

This failed as well as everything else I tried to get the localized url
into the html:link. I tried html:write but since I'm new to struts I
don't have any confidence that I did it correctly. I'm sure that there
must be a way to do this since I can't be the only one with this
problem.

TIA, J.

-- 
This transmission is intended only for use by the addressee(s) named 
herein and may contain information that is proprietary, confidential 
and/or legally privileged. If you are not the intended recipient, you are 
hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY 
PROHIBITED. If you received this transmission in error, please immediately 
contact the sender and destroy the material in its entirety, whether in 
electronic or hard copy format. Thank you.



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





How to get posted data into a nested object ?

2005-06-07 Thread gdeschen
Hello,

Short description:
-
How do I get posted data into a bean within the form bean ?

The JSP has this code.
html-el:text property=dependent.firstName maxlength=15 value=
${dependentForm.dependent.firstName}/

The page is posted and I get this error:
[07/06/05 15:15:22:743 EDT] 6aa06aa0 WebGroup  E SRVE0026E: [Servlet 
Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean 
specified

Really I'm getting exasperated trying to get this working.
All of the examples I've found deal with collections or simply getting the 
data onto the page.
I need to pick it up from the page.


Long Description:
-
My form bean contains a value object.
public class DependentForm extends ActionForm {
   private ImageButtonBean addButton = new ImageButtonBean();
   private ImageButtonBean cancelButton = new ImageButtonBean();
   private DependentVO dependent;
...

public class DependentVO extends Dependent {
...

public class Dependent extends People {
...

public class People {
   private Date dateOfBirth;
   private int employeeNumber;
   private String firstName;
   private String lastName;
   private String relationshipCode;
   private String sexTypeCode;
   private String smokerIndicator;

The JSP has this code.
html-el:text property=dependent.firstName maxlength=15 value=
${dependentForm.dependent.firstName}/

TIA,
Glenn

Re: How to get posted data into a nested object ?

2005-06-07 Thread gdeschen
Thanks Dave.
This is what is defined.
action path=/personal/Dependent type=
hronline.secure.personal.dependents.DependentAction name=dependentForm 
scope=request validate=false
   forward name=dependent path=
/WEB-INF/personal/dependents/dependent.jsp
   /forward
   forward name=cancel path=/personal/Dependents.do
   /forward
/action 
action path=/personal/DependentSubmit type=
hronline.secure.personal.dependents.DependentSubmitAction name=
dependentForm scope=request input=/personal/Dependent.do validate=
true
   forward name=dependents path=/personal/Dependents.do redirect=
true
   /forward
   forward name=error path=/personal/Dependent.do
   /forward
/action

The JSP posts here:
html-el:form action=/personal/DependentSubmit method=post


But the DependentForm bean has a bean defined within it.
It is this bean that I need to put data into it.





Dave Newton [EMAIL PROTECTED] 
07/06/2005 03:57 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: How to get posted data into a nested object ?






[EMAIL PROTECTED] wrote:

Hello,

Short description:
-
How do I get posted data into a bean within the form bean ?
 

Do you have the bean defined in the struts-config for that particular 
action? The name attribute of the action mapping should contain the 
name of the bean.

http://struts.apache.org/userGuide/building_view.html#form_beans
http://struts.apache.org/userGuide/building_controller.html#action_mapping_example


Dave



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





Re: html-el:checkbox quandary

2005-06-06 Thread gdeschen
I gave it a go and I get this error now... more precise but an error none 
the less...
[06/06/05 15:40:53:846 EDT] 5dc35dc3 WebGroup  E SRVE0026E: [Servlet 
Error]-[No getter method for property dependent.healthEligibilityIndicator 
of bean org.apache.struts.taglib.html.BEAN]: 
javax.servlet.jsp.JspException: No getter method for property 
dependent.healthEligibilityIndicator of bean 
org.apache.struts.taglib.html.BEAN




Hubert Rabago [EMAIL PROTECTED] 
06/06/2005 03:25 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: html-el:checkbox quandary






On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Okay okay it is one of those mondays where your physically at work but
 mentally still Saturday afternoon !
 

I'm feeling the same way.

 I have a form bean:
 DependentForm
 which also contains  a value object bean:
 dependent
 which has a property called: healthEligibilityIndicator
 
 Now I'd liket to reference the property in the JSP.
 
 Currently this is what I have:
 html-el:checkbox property=
 ${dependentForm.dependent.healthEligibilityIndicator}
 property=${dependentForm.dependent.healthEligibilityIndicator}/
 
 This is the error I'm getting:
 [06/06/05 15:17:59:889 EDT] 5dc35dc3 WebGroup  E SRVE0026E: [Servlet
 Error]-[No getter method for property  of bean
 org.apache.struts.taglib.html.BEAN]: javax.servlet.jsp.JspException: No
 getter method for property  of bean org.apache.struts.taglib.html.BEAN
 
 Why is this happening?
 I'm more upset that I can't figure it out myself !
 
 Any input is appreciated !
 - Glenn
 

If dependentForm is the form bean associated with the HTML form that
your checkbox is a part of, try it with just
property=dependent.healthEligibilityIndicator.

Hubert

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





Re: html-el:checkbox quandary

2005-06-06 Thread gdeschen
Apolgies it is my typo... I have property twice... one should be value.

- Glenn



Martin Gainty [EMAIL PROTECTED] 
06/06/2005 03:46 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org, Hubert Rabago 
[EMAIL PROTECTED]
cc

Subject
Re: html-el:checkbox quandary






Good catch Hubert..Thats what I noticed ..2 property references and no 
value=

In the future you may want to debug with display statement like
c:out value= ${dependentForm.dependent.healthEligibilityIndicator}/

Martin-
- Original Message - 
From: Hubert Rabago [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Monday, June 06, 2005 3:25 PM
Subject: Re: html-el:checkbox quandary


On 6/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Okay okay it is one of those mondays where your physically at work but
 mentally still Saturday afternoon !


I'm feeling the same way.

 I have a form bean:
 DependentForm
 which also contains  a value object bean:
 dependent
 which has a property called: healthEligibilityIndicator

 Now I'd liket to reference the property in the JSP.

 Currently this is what I have:
 html-el:checkbox property=
 ${dependentForm.dependent.healthEligibilityIndicator}
 property=${dependentForm.dependent.healthEligibilityIndicator}/

 This is the error I'm getting:
 [06/06/05 15:17:59:889 EDT] 5dc35dc3 WebGroup  E SRVE0026E: [Servlet
 Error]-[No getter method for property  of bean
 org.apache.struts.taglib.html.BEAN]: javax.servlet.jsp.JspException: No
 getter method for property  of bean org.apache.struts.taglib.html.BEAN

 Why is this happening?
 I'm more upset that I can't figure it out myself !

 Any input is appreciated !
 - Glenn


If dependentForm is the form bean associated with the HTML form that
your checkbox is a part of, try it with just
property=dependent.healthEligibilityIndicator.

Hubert

-
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: Best Place for config values

2005-06-06 Thread gdeschen
Currently we have an XML.
This file is loaded in a filter using apache digester.

HTH,
Glenn




Brian McGovern [EMAIL PROTECTED] 
06/06/2005 03:51 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Best Place for config values






Whats the best place / access method to storing and retriving config 
attributes like administrator email addresses and directories to store 
uploaded files in a multi-tiered webapp, web.xml?  Resources file?  Both 
servlets and non servlets need to access these values.  Opinions greatly 
appreciated.

thanks
-



Re: Seeking Advice Error Handling

2005-06-01 Thread gdeschen
In what application server is your application running?
Do you have any connection pooling?

- Glenn




Scott Purcell [EMAIL PROTECTED] 
01/06/2005 10:05 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Seeking Advice Error Handling






Hello,

I have created a site with a mysql database back-end, and full struts 
front end. I have a filter to ensure the creation of some session app 
objects, and the site is pretty clean.

But over the weekend, I found a problem that I am seeking advice from. For 
some reason, the mysql database went down, causing the site to be all 
screwed up. I have extended the RequestProcessor but can not figure out 
how to handle errors from the database.

I would like to in the requestProcessor extended class, possibly do a 
simple query against a known table, and if the result is null, switch them 
to a site down action class.

Can this be done in the requestProcessor area?

Any advice would be appreciated.

Scott

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





RE: Seeking Advice Error Handling

2005-06-01 Thread gdeschen
Umh... I have seen in the past that at times the connection pool believes 
that the DB is still there even when it is not.
I'm not a Tomcat user... at least not yet !

In my case... the infrastructure has a gateway between the application 
server and the database server.
The web application is session based... so the DB errors occur at the log 
in only and for the first user of the day.
So in the case that the DB is not there... the application loops n times 
until the DB connections that are cached are flushed and new ones are 
obtained.

HTH,
Glenn




Scott Purcell [EMAIL PROTECTED] 
01/06/2005 10:21 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
RE: Seeking Advice Error Handling






I am running Tomcat 5.5, and I am using a roll-your-own database pooling 
solution.

Scott



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 01, 2005 9:18 AM
To: Struts Users Mailing List
Subject: Re: Seeking Advice Error Handling


In what application server is your application running?
Do you have any connection pooling?

- Glenn




Scott Purcell [EMAIL PROTECTED] 
01/06/2005 10:05 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Seeking Advice Error Handling






Hello,

I have created a site with a mysql database back-end, and full struts 
front end. I have a filter to ensure the creation of some session app 
objects, and the site is pretty clean.

But over the weekend, I found a problem that I am seeking advice from. For 

some reason, the mysql database went down, causing the site to be all 
screwed up. I have extended the RequestProcessor but can not figure out 
how to handle errors from the database.

I would like to in the requestProcessor extended class, possibly do a 
simple query against a known table, and if the result is null, switch them 

to a site down action class.

Can this be done in the requestProcessor area?

Any advice would be appreciated.

Scott

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




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





Re: [OT] Business Layer Ideas

2005-06-01 Thread gdeschen
I have these 2 phrases posted in my office as a reminder...

 Simplicity is the ultimate sophistication  - Leonardo da Vinci
 The ability to simplify means to eliminate the unnecessary so that the 
necessary may speak - Hans Hofmann

- Glenn





Leon Rosenberg [EMAIL PROTECTED] 
01/06/2005 11:42 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: [OT] Business Layer Ideas






On Wed, 2005-06-01 at 10:31 -0400, Frank W. Zammetti wrote:

 ...
 Simplicity is a beautiful thing.  That is always my underlying design 
goal
 for two reasons...

Now this is really a perfect statement on architectures! 

Thanx Frank

Leon.



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





Re: [OT] Business Layer Ideas

2005-06-01 Thread gdeschen
Come on guys... it is much tougher today than back when you and I were 
young!
Programming is programming: things haven't changed that much. ;)

I started out doing Assembler. Then moved on to Cobol and CICS.
I remember the excitement when Cobol II came out wow 4 new 
instructions... learnt it in 15 seconds flat.
Followed the fashion to Client/Server applications in VB  C++
Moved on to Internet/Intranet/Extranet fashions... with Microsoft 
Technologies.
All of the tiers, architectures  infrastructures.
Now I'm on the Java side of things.
Think of all of the stuff happening today... APIs, Frameworks, Patterns, 
etc.
And the responsibility of being competent today is a never ending task.

I am smiling... knowing that I could probably go back to CICS/Cobol and be 
productive in half a day.
Walk out of the office and forget about my job... which is something I 
cannot do anymore.
But I am having a blast... and wouldn't change anything ah perhaps 
somethings that this is for another time!

My little trip down memory lane. :)
- Glenn




Frank W. Zammetti [EMAIL PROTECTED] 
01/06/2005 12:39 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Simon Chappell [EMAIL PROTECTED]
cc
Struts Users Mailing List user@struts.apache.org
Subject
Re: [OT] Business Layer Ideas






On Wed, June 1, 2005 12:15 pm, Simon Chappell said:
 Back when I was a young programmer we used to have to think. THINK!

Hey, I'm the resident bemoaner of how rough we used to have it!  How dare
you take my job?!? :) LOL

 Oh
 the humanity. No patterns for us. Just endless cups of tea, a pad of
 paper (or the back of long listings on greenbar) and your flowchart
 stencil.

Stencils?!?  I laugh at your stencils!  It was only freehand drawings for
us, and that was when we took the time to actually PLAN anything!

 We had it rough I tell you, but I think that we wrote better
 code back in those days. And those of us that came through them, still
 have a tendency to do so.

I have said on numerous occassions that programmers that have never
touched Assembly are, with few exceptions, not as good.  And although the
overall tone of my reply here is a joking one, this is a point I am
serious about.

I have actually rejected resumes because they had no Assembly experience. 
I'm not saying you have to be able to hand-code a 3D game engine, but at
least have had some exposure.

I spent a number of years doing absolutely nothing BUT Assembly, and while
I honestly haven't done anything beyond some very simple subfunctions in
the past 5-7 years or so, I wouldn't trade that experience for all the
algorithm classes and patterns knowledge in the world.  There is NOTHING
like understanding, at least at a conceptual level, what's going on down
there in the lower layers of your machine.  Assembly gives you this.

Like I said, there are exceptions to this rule, but I haven't met too 
many.

 My first computer had 1K, yes, that's 1024 bytes.

Timex Sinclair 1000 by any chance?  I loved that little thing!  So much so
that I spend $200 on one off eBay last year (three of them actually, with
a lot of extras).  The best thing about it was that if you could manage
anything decent on it you were learning... I crammed the entire catalog of
movie times for a week for Long Island in it... invented my own
rudimentary compression scheme (although I had no clue what compression
or algorithms were back then... never even heard the words... I was like
9 or so!).  And I didn't have the 16K expansion module because my dad
tried to solder it on because we could never get a good contact, but he
fried it in the process, so I was stuck with the 1K (actually, now that I
think about it, it might have been 2K.  I'm not sure).

 We can only hope. Perhaps the prophesied return of Lisp will finally
 happen and people will discover REAL programming, not this Teach
 Yourself The Latest Junk in 24 Hours stuff. Real, worthwhile,
 programming is hard, so if your going to do it, study for it, and
 learn (LEARN I say) to do it well.

I}hate}}}LISP.

LISP... ugh.  I can't stand any language that contains more parenthesis
per 1,000 lines of code than ACTUAL CODE! :)

 Well done, Craig, with restrospect. A simpler designed framework
 like Struts is exactly the example, the proof, which Simon espouses
 above.

 Yes. Yes. Yes. Thank you Craig.

I agree... There are probably architecural decisions in Struts I could
complain about, but I think it would quickly become nothing but
nitpicking.  Craig did a rather good job IMHO of straddling the line
between a good architecure that is flexible and extensible without making
it too complex.  Good job indeed, thank you!

Frank

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





Struts-1.2.7

2005-05-30 Thread gdeschen
Hi,

I'm upgrading my project to the latest version of struts 1.2.7.
In the Wiki under the Dependency section 
(http://wiki.apache.org/struts/StrutsRelease127) it mentions that the 
Common BeanUtils version 1.7.0 is required.
When I look at the Manifest.mf file found in the struts-1.2.7\lib 
directory this is what I get.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.5.3 
Created-By: 1.4.1_01-b01 (Sun Microsystems Inc.)
Extension-Name: org.apache.commons.beanutils
Specification-Title: Jakarta Commons Beanutils
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.6
Implementation-Title: org.apache.commons.beanutils
Implementation-Vendor: Apache Software Foundation
Implementation-Version: 1.6

I have also noted a discrepency between the manifest for antlr.jar and the 
Wiki. 


Am I missing something here or is there just a typo in the Wiki?
- Glenn

Re: migration from Struts 1.0 to Struts 1.2

2005-05-27 Thread gdeschen
http://wiki.apache.org/struts/StrutsUpgrade

HTH,
Glenn




Thibaut Lassalle [EMAIL PROTECTED] 
27/05/2005 11:28 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
migration from Struts 1.0 to Struts 1.2





Does anyone have documentation on how to migrate from Struts 1.0 to 
Struts 1.2
Thanks.


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





Re: Global scope

2005-05-10 Thread gdeschen
True for the Action and Action Form, but the original code snippet is a 
ServletContextListener and that the methods get called once when the 
application is deployed and undeployed.
At this point (since I'm no expert in the specification) I believe that 
the Request object is not yet available.

public class ApplicationContextListener implements ServletContextListener 
{

private ServletContext servletContext = null;

public void contextInitialized(ServletContextEvent arg0) {
servletContext = arg0.getServletContext();
ApplicationBean applicationBean = new ApplicationBean();
servletContext.setAttribute(applicationBean, 
applicationBean);
}

public void contextDestroyed(ServletContextEvent arg0) {
servletContext = arg0.getServletContext();
servletContext.removeAttribute(applicationBean);
}
}


Yeah, I think that it can be static.
Does it make a significant difference if it is or is not static ?

- Glenn





Niall Pemberton [EMAIL PROTECTED] 
10/05/2005 12:56 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Global scope
Classification








The Action and ActionForm both should have the servlet variable 
initialized.
Thats a better way of getting the ServletContext:

   servlet.getServletContext();

Niall

- Original Message - 
From: Michael Jouravlev [EMAIL PROTECTED]
Sent: Tuesday, May 10, 2005 5:09 PM


request.getSession().getServletContext();

I guess, servlet context makes sense even without session, but this
seems to be the easiest way to obtain it through the request, which is
passed to your reset(), validate() and execute() methods.

On 5/10/05, Nils Liebelt [EMAIL PROTECTED] wrote:
 Can the servletcontext declared as static:

 private static ServletContext servletContext;

 Not sure about it? Makes sense to me.

 GreetZ

 Nils



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





Re: upgradation details of 1.1 to 1.2

2005-05-09 Thread gdeschen
http://wiki.apache.org/struts/StrutsUpgradeNotes11to124

HTH,
Glenn



asai thambi [EMAIL PROTECTED] 
09/05/2005 02:44 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
upgradation details of 1.1 to 1.2
Classification








hi.

 can any one provide the upgradation details of 1.1 to 1.2 ?

thanks
 Asaithambi.B

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





Re: Switch Tags

2005-05-09 Thread gdeschen
JSTL...

c:choose
   c:when
   /c:when
   c:when
   /c:when
   c:otherwise
   /c:otherwise
/c:choose

HTH,
Glenn



Marsh-Bourdon, Christopher [EMAIL PROTECTED] 
09/05/2005 09:14 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
'Struts Users Mailing List' user@struts.apache.org
cc

Subject
Switch Tags
Classification








I will of course be going off to Google in a moment, but I would like
anyone's recommendation for a Tag(s) that enable the coder to perform a
Switch/Case like function within the JSP.  I could of course write one, 
but
I'm lazy!

Cheers

Christopher Marsh-Bourdon
www.marsh-bourdon.com
 --



The information contained herein is confidential and is intended solely 
for the
addressee. Access by any other party is unauthorised without the express 
written permission of the sender. If you are not the intended recipient, 
please 
contact the sender either via the company switchboard on +44 (0)20 7623 
8000, or
via e-mail return. If you have received this e-mail in error or wish to 
read our
e-mail disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender. 3166



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





Re: [OT] DOM JavaScript

2005-04-28 Thread gdeschen
Okay Frank I gave it a shot and still nothing.
I believe that the setAttribute is the proper way according to the DOM 
API.
The other way may be supported depending on the browser.

But in the end it is still not working.
I'm thinking of an alternate solution, since the page is complete except 
for the damn mouse handlers.
It would be a drag if I have to drop this feature since the web 
application has it in all of the pages... but this is the first dynamic 
page.
I'm wondering if creating a global handler for mouse events would help.

- Glenn




Frank W. Zammetti [EMAIL PROTECTED] 
27/04/2005 05:13 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: [OT] DOM  JavaScript
Classification








Interesting indeed... How about trying this... change the two lines that 
dynamically add the mouse handlers to:

row.onMouseOver = this.className = 'hilite';;
row.onMouseOut = this.className = 'rowNormal';;

I'm not 100% sure what the capitalization should be of the property your 
setting (i.e., row.onMouseOver vs. row.onmouseover vs. something else), 
but give that a shot... any time I've done dynamic table creation I 
don't remember ever using setAttribute() at all, I think I've written 
code like the above.

Frank

[EMAIL PROTECTED] wrote:
 Curiously... the mouse events are all in lowercase when they are shown 
in 
 the dump.
 TBODY
 TR
 TD class=tableHeader colSpan=2Effective Date/TD
 TD class=tableHeader width=200CWW Schedule Type/TD
 TD class=tableHeader id=calendarAnchor align=middle 
width=74Delete/TD
 TD width=136/TD/TR
 
 - - - - - This is from the JSP - - - - - - -
 TR class=rowNormal onmouseover=this.className = 'hilite' 
 onmouseout=this.className = 'rowNormal' valign=top
 TD id=c00 width=15403 January 2004 /TD
 TD id=c01 width=16A onclick=lineId='c00'; 
 calendar.showCalendar('calendarAnchor', '2005-04-27'); return false; 
 href=#IMG height=16 src=/hronline/images/calendar.jpg width=16 
 border=0 /A/TD
 TD id=c02SELECT class=dropdowns2 id=s0 
 onchange=addTableRow('historyTable','s0') 
 name=historyItems[0].scheduleTypeIdOPTION value=00/OPTION OPTION 
 value=01 selected1 Week Cycle/OPTION OPTION value=022 Week 
 Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION value=044 

 Week Cycle/OPTION OPTION value=05Regular Week 
 Schedule/OPTION/SELECT /TD
 TD id=c03 align=middleINPUT type=checkbox value=on 
 name=historyItems[0].delete /TD
 TD class=rowNormal id=c04INPUT class=dropdowns2 id=d00 
 style=VISIBILITY: hidden size=1 value=2004-01-03 
 name=historyItems[0].startDate /TD/TR
 
 - - - - - - - This is the row added dynamically - - - - - - -
 TR class=rowNormal onmouseover=this.className = 'hilite' 
 onmouseout=this.className = 'rowNormal' valign=top
 TD id=c40/TD
 TD id=c41A onclick=lineId='c40'; 
 calendar.showCalendar('calendarAnchor', '2005-04-27'); return false; 
 href=
http://nati02:5001/hronline/secure/WEB-INF/personal/timeAndAttendance/cWWHistory.jsp#
IMG 
 height=16 src=http://nati02:5001/hronline/images/calendar.jpg; width=16 

 border=0 /A/TD
 TD id=c42SELECT class=dropdowns2 id=s4 
 onchange=addTableRow('historyTable','s4') 
 name=historyItems[4].scheduleTypeIdOPTION value=00 selected/OPTION 
 OPTION value=011 Week Cycle/OPTION OPTION value=022 Week 
 Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION value=044 

 Week Cycle/OPTION OPTION value=05Regular Week 
 Schedule/OPTION/SELECT /TD
 TD align=middleINPUT type=checkbox value=on 
 name=historyItems[4].delete /TD
 TD class=rowNormal id=c44INPUT class=dropdowns2 id=d40 
 style=VISIBILITY: hidden size=1 value=2004-01-03 
 name=historyItems[4].startDate /TD/TR/TBODY
 
 - Glenn
 
 
 
 
 Frank W. Zammetti [EMAIL PROTECTED] 
 27/04/2005 04:27 PM
 Please respond to
 Struts Users Mailing List user@struts.apache.org
 
 
 To
 Struts Users Mailing List user@struts.apache.org
 cc
 
 Subject
 Re: [OT] DOM  JavaScript
 Classification
 
 
 
 
 
 
 
 
 Hmm... I notice that the JSP code is referencing onMouseOver, while your 

 Javascript is trying to set the attribute onmouseover... I wonder if the 

 capitalization difference is an issue?  Certainly, if setAttribute() 
 takes case into consideration that would do it.  You said the lines were 

 identical when you looked, but could it be you glossed over the 
 difference in capitalization? (I may have too).
 
 Frank
 
 [EMAIL PROTECTED] wrote:
 
Greetings,

Once again I call on my trusted community for insight !
I'm adding a row to a table dynamically. All is working well except for 
one thing the Mouse events.

Here is the code for adding a row to the table.
There is more code that adds the cells to the table (not shown).
...
// Only add a row when changing the last row of the table
if (s+(rowWithData) == selectId) {
var row = table.insertRow(lastRowInTable);
var className = rowNormal;

if (lastRowInTable % 2 == 0) {
className = rowAlternate;
}

Re: [OT] DOM JavaScript

2005-04-28 Thread gdeschen
I also gave this a try without any succcess.
Thanks for your time and patience Frank !
(see my reply to Laurent).

- Glenn
 



Frank W. Zammetti [EMAIL PROTECTED] 
28/04/2005 09:10 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc
Struts Users Mailing List user@struts.apache.org
Subject
Re: [OT] DOM  JavaScript
Classification








How about trying one last thing... how about instead of using the row
reference you get back from insertRow(), instead do a getElementById() to
get a new reference and try setting the handlers on that.

I'm grabbing at straws here admittedly, but it might be worth a try.  I've
seenstranger things :)

Incidentally, I found some code I wrote doing the same thing and although
I'm not using setAttribute (I think your right by the way about that being
the more standard-compliant way to do this) it does work.  That doesn't
much help of course :)  My code is virtually identical to yours too, in
fact it IS identical in the part that actually creates the table.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, April 28, 2005 8:12 am, [EMAIL PROTECTED] said:
 Okay Frank I gave it a shot and still nothing.
 I believe that the setAttribute is the proper way according to the DOM
 API.
 The other way may be supported depending on the browser.

 But in the end it is still not working.
 I'm thinking of an alternate solution, since the page is complete except
 for the damn mouse handlers.
 It would be a drag if I have to drop this feature since the web
 application has it in all of the pages... but this is the first dynamic
 page.
 I'm wondering if creating a global handler for mouse events would help.

 - Glenn




 Frank W. Zammetti [EMAIL PROTECTED]
 27/04/2005 05:13 PM
 Please respond to
 Struts Users Mailing List user@struts.apache.org


 To
 Struts Users Mailing List user@struts.apache.org
 cc

 Subject
 Re: [OT] DOM  JavaScript
 Classification








 Interesting indeed... How about trying this... change the two lines that
 dynamically add the mouse handlers to:

 row.onMouseOver = this.className = 'hilite';;
 row.onMouseOut = this.className = 'rowNormal';;

 I'm not 100% sure what the capitalization should be of the property your
 setting (i.e., row.onMouseOver vs. row.onmouseover vs. something else),
 but give that a shot... any time I've done dynamic table creation I
 don't remember ever using setAttribute() at all, I think I've written
 code like the above.

 Frank

 [EMAIL PROTECTED] wrote:
 Curiously... the mouse events are all in lowercase when they are shown
 in
 the dump.
 TBODY
 TR
 TD class=tableHeader colSpan=2Effective Date/TD
 TD class=tableHeader width=200CWW Schedule Type/TD
 TD class=tableHeader id=calendarAnchor align=middle
 width=74Delete/TD
 TD width=136/TD/TR

 - - - - - This is from the JSP - - - - - - -
 TR class=rowNormal onmouseover=this.className = 'hilite'
 onmouseout=this.className = 'rowNormal' valign=top
 TD id=c00 width=15403 January 2004 /TD
 TD id=c01 width=16A onclick=lineId='c00';
 calendar.showCalendar('calendarAnchor', '2005-04-27'); return false;
 href=#IMG height=16 src=/hronline/images/calendar.jpg width=16
 border=0 /A/TD
 TD id=c02SELECT class=dropdowns2 id=s0
 onchange=addTableRow('historyTable','s0')
 name=historyItems[0].scheduleTypeIdOPTION value=00/OPTION OPTION
 value=01 selected1 Week Cycle/OPTION OPTION value=022 Week
 Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION 
value=044

 Week Cycle/OPTION OPTION value=05Regular Week
 Schedule/OPTION/SELECT /TD
 TD id=c03 align=middleINPUT type=checkbox value=on
 name=historyItems[0].delete /TD
 TD class=rowNormal id=c04INPUT class=dropdowns2 id=d00
 style=VISIBILITY: hidden size=1 value=2004-01-03
 name=historyItems[0].startDate /TD/TR

 - - - - - - - This is the row added dynamically - - - - - - -
 TR class=rowNormal onmouseover=this.className = 'hilite'
 onmouseout=this.className = 'rowNormal' valign=top
 TD id=c40/TD
 TD id=c41A onclick=lineId='c40';
 calendar.showCalendar('calendarAnchor', '2005-04-27'); return false;
 href=
 
http://nati02:5001/hronline/secure/WEB-INF/personal/timeAndAttendance/cWWHistory.jsp#

 IMG
 height=16 src=http://nati02:5001/hronline/images/calendar.jpg; 
width=16

 border=0 /A/TD
 TD id=c42SELECT class=dropdowns2 id=s4
 onchange=addTableRow('historyTable','s4')
 name=historyItems[4].scheduleTypeIdOPTION value=00 selected/OPTION
 OPTION value=011 Week Cycle/OPTION OPTION value=022 Week
 Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION 
value=044

 Week Cycle/OPTION OPTION value=05Regular Week
 Schedule/OPTION/SELECT /TD
 TD align=middleINPUT type=checkbox value=on
 name=historyItems[4].delete /TD
 TD class=rowNormal id=c44INPUT class=dropdowns2 id=d40
 style=VISIBILITY: hidden size=1 value=2004-01-03
 name=historyItems[4].startDate /TD/TR/TBODY

 - Glenn




 Frank W. Zammetti [EMAIL PROTECTED]
 27/04/2005 04:27 

Re: [OT] DOM JavaScript

2005-04-28 Thread gdeschen
Merci Laurent !

Okay so then when you say that it must be functions..
I presume that the HTML with coded attributes such as onMouseOver and 
onMouseOut... in IE the browser parses the data and internally creates 
functions to handle the mouse events.
So when I try to dynamically modify the DOM for IE... I must recreate the 
mouse handlers.
Would this be a valid way of describing the situation?

I must now understand the element hierarchy along with the event firing 
sequence...
Since I'd like to hilite the row... now it is hiliting the cell of a 
row... :(

- Glenn



Laurent [EMAIL PROTECTED] 
28/04/2005 09:11 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: [OT] DOM  JavaScript
Classification








[EMAIL PROTECTED] wrote:
 // Only add a row when changing the last row of the table
 if (s+(rowWithData) == selectId) {
 var row = table.insertRow(lastRowInTable);
 var className = rowNormal;
 
 if (lastRowInTable % 2 == 0) {
 className = rowAlternate;
 }
 row.className = className;
 row.setAttribute(onmouseover, this.className = 'hilite';);
 row.setAttribute(onmouseout, this.className = ' + className 
+ 
 ');


That's not how it works (not in IE at least). The event attributes'
values should be event listeners (i.e. functions), not strings of
javascript code.

Try this:

function changeClassName(e) {
  if (!e) e=window.event;
  getEventTarget(e).setAttribute(class, hilite); // DOM-compliant
  getEventTarget(e).setAttribute(className, hilite); // MSIE
}

row.onmouseover = changeClassName; // without quotes nor parentheses

function getEventTarget(e) {
if (e.srcElement) return e.srcElement;
else return e.currentTarget;
}

Note: the code above aims to be cross-browser, as IE behaves completely
differently from any other browser.

BTW, all event attributes are *lower case*: onmouseover, onmouseout (not
onMouseOver...)

Hope this helps.


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





Re: [OT] DOM JavaScript

2005-04-28 Thread gdeschen
Excellent Frank, thanks a million !!!
What was your inspiration for this ?

- Glenn




Frank W. Zammetti [EMAIL PROTECTED] 
28/04/2005 10:47 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc
Struts Users Mailing List user@struts.apache.org
Subject
Re: [OT] DOM  JavaScript
Classification








Ah, got it!  You can use an anonymous function... The suggestion of
setting a common handler is fine except that you will have to use
getElementById to get a reference to the element to change... using an
anonymous function you have access to the this keyword, so it's cleaner. 
Here's a complete working page (at least in IE)...

html
head
titleTest/title
style
  .hilite { background-color:#ff; }
  .normal { background-color:#ff; }
/style
script
function createTable(table) {
  row = table.insertRow();
  row.setAttribute(className, normal);
  row.onmouseover = function() { this.className='hilite'; }
  row.onmouseout = function() { this.className='normal'; }
  cell = row.insertCell();
  cell.innerHTML = new1;
  cell = row.insertCell();
  cell.innerHTML = new2;
}
/script
head
body
table id=theTable border=1
  tr onMouseOver=this.className='hilite';
onMouseOut=this.className='normal';
tddummy1/tdtddummy2/td
  /tr
/table
input type=button onClick=createTable(theTable); value=Add Row
/body/html

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, April 28, 2005 9:58 am, [EMAIL PROTECTED] said:
 Merci Laurent !

 Okay so then when you say that it must be functions..
 I presume that the HTML with coded attributes such as onMouseOver and
 onMouseOut... in IE the browser parses the data and internally creates
 functions to handle the mouse events.
 So when I try to dynamically modify the DOM for IE... I must recreate 
the
 mouse handlers.
 Would this be a valid way of describing the situation?

 I must now understand the element hierarchy along with the event firing
 sequence...
 Since I'd like to hilite the row... now it is hiliting the cell of a
 row... :(

 - Glenn



 Laurent [EMAIL PROTECTED]
 28/04/2005 09:11 AM
 Please respond to
 Struts Users Mailing List user@struts.apache.org


 To
 Struts Users Mailing List user@struts.apache.org
 cc

 Subject
 Re: [OT] DOM  JavaScript
 Classification








 [EMAIL PROTECTED] wrote:
 // Only add a row when changing the last row of the table
 if (s+(rowWithData) == selectId) {
 var row = table.insertRow(lastRowInTable);
 var className = rowNormal;

 if (lastRowInTable % 2 == 0) {
 className = rowAlternate;
 }
 row.className = className;
 row.setAttribute(onmouseover, this.className = 'hilite';);
 row.setAttribute(onmouseout, this.className = ' + className
 +
 ');


 That's not how it works (not in IE at least). The event attributes'
 values should be event listeners (i.e. functions), not strings of
 javascript code.

 Try this:

 function changeClassName(e) {
   if (!e) e=window.event;
   getEventTarget(e).setAttribute(class, hilite); // DOM-compliant
   getEventTarget(e).setAttribute(className, hilite); // MSIE
 }

 row.onmouseover = changeClassName; // without quotes nor parentheses

 function getEventTarget(e) {
 if (e.srcElement) return e.srcElement;
 else return e.currentTarget;
 }

 Note: the code above aims to be cross-browser, as IE behaves completely
 differently from any other browser.

 BTW, all event attributes are *lower case*: onmouseover, onmouseout (not
 onMouseOver...)

 Hope this helps.


 -
 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: Filter Being Called Repeatedly

2005-04-27 Thread gdeschen
Umh... I believe that you don't need the  return after the chain.doFilter

if (req.getServletPath().equals(onFailure)) {
  log.info( equals );
  chain.doFilter(request, response);
remove --   return;
}

HTH,
Glenn




Scott Purcell [EMAIL PROTECTED] 
27/04/2005 10:19 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
Filter Being Called Repeatedly
Classification








Hello,
I decided to try and implement a filter for my struts application. A 
filter that would check for a session object, and if it does not exist, 
send the user to a certain link.

Anyway, I found an example in the Struts Cookbook and I am implementing 
it. But for whatever reason, when I hit a page that should redirect me, I 
can see (by debug statements) that the filter is hit 10 or more times, and 
then I get an error stating: Redirect limit for this URL exceeeded. 
Unable to load the requested page) in an alert Box?

I would really like to get this going:
Here is the code, and the web.xml I am using. Any help would be 
appreciated.

CODE
public class AppFilter implements Filter {

  private String onFailure = index.jsp;
  private FilterConfig filterConfig;

  public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
onFailure = filterConfig.getInitParameter(onFailure);
  }

  public void doFilter(ServletRequest request,
   ServletResponse response,
   FilterChain chain)
throws IOException, ServletException {


Logger log = Logger.getLogger(this.getClass().getName());
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
log.info(X);
log.info(AppFilter called for a request.);
log.info(param onFailure= + onFailure);

// if the page is onFailure page continue down the chain
if (req.getServletPath().equals(onFailure)) {
  log.info( equals );
  chain.doFilter(request, response);
  return;
}


HttpSession session = req.getSession();
AppObject appObject = (AppObject)session.getAttribute(APP_OBJECT);
if (appObject == null) {
  log.info(AppObject is null, send to front door.);
  log.info(sending path= + req.getContextPath() + onFailure);
  resp.sendRedirect(req.getContextPath() + onFailure);
  return;
} else {
  log.info();
  chain.doFilter(request, response);
}
  }

  public void destroy() {
  }
}


WEB.XML
filter
filter-nameAppFilter/filter-name
filter-classcom.mb.purcell.app.AppFilter/filter-class
init-param
  param-nameonFailure/param-name
  param-value/index.jsp/param-value
/init-param
  /filter

  filter-mapping
filter-nameAppFilter/filter-name
url-pattern/*/url-pattern
  /filter-mapping

Thanks,

Scott K Purcell

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





Re: Filter Being Called Repeatedly

2005-04-27 Thread gdeschen
Oh yes... I carefully looked at the code.
Apologies for misleading the list. 

- Glenn




Dave Newton [EMAIL PROTECTED] 
27/04/2005 10:42 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Filter Being Called Repeatedly
Classification








[EMAIL PROTECTED] wrote:

Umh... I believe that you don't need the  return after the chain.doFilter
 

You do, otherwise the remaining code in the filter will be executed 
after the request is finished being processed: filters _wrap_ a request. 
This is how a gzipping filter works, for example.

Dave



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





[OT] DOM JavaScript

2005-04-27 Thread gdeschen
Greetings,

Once again I call on my trusted community for insight !
I'm adding a row to a table dynamically. All is working well except for 
one thing the Mouse events.

Here is the code for adding a row to the table.
There is more code that adds the cells to the table (not shown).
...
// Only add a row when changing the last row of the table
if (s+(rowWithData) == selectId) {
var row = table.insertRow(lastRowInTable);
var className = rowNormal;

if (lastRowInTable % 2 == 0) {
className = rowAlternate;
}
row.className = className;
row.setAttribute(onmouseover, this.className = 'hilite';);
row.setAttribute(onmouseout, this.className = ' + className + 
');
...
}


Here is the JSP code that creates the table row (at least one row is in 
the page), here the mouse events are working:
tr valign=top onMouseOver=this.className = 'hilite' onMouseOut=
this.className = 'c:out value='${rowClass}'/' class=c:out value=
'${rowClass}'/

If I add an alert that dumps the innerHTML of the table after the 
row/cells are added and I compare the two rows... 
They are the same.
Why are the mouse events added dynamically not recongnized ?

BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158

TIA,
Glenn


Re: [OT] DOM JavaScript

2005-04-27 Thread gdeschen
Curiously... the mouse events are all in lowercase when they are shown in 
the dump.
TBODY
TR
TD class=tableHeader colSpan=2Effective Date/TD
TD class=tableHeader width=200CWW Schedule Type/TD
TD class=tableHeader id=calendarAnchor align=middle width=74Delete/TD
TD width=136/TD/TR

- - - - - This is from the JSP - - - - - - -
TR class=rowNormal onmouseover=this.className = 'hilite' 
onmouseout=this.className = 'rowNormal' valign=top
TD id=c00 width=15403 January 2004 /TD
TD id=c01 width=16A onclick=lineId='c00'; 
calendar.showCalendar('calendarAnchor', '2005-04-27'); return false; 
href=#IMG height=16 src=/hronline/images/calendar.jpg width=16 
border=0 /A/TD
TD id=c02SELECT class=dropdowns2 id=s0 
onchange=addTableRow('historyTable','s0') 
name=historyItems[0].scheduleTypeIdOPTION value=00/OPTION OPTION 
value=01 selected1 Week Cycle/OPTION OPTION value=022 Week 
Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION value=044 
Week Cycle/OPTION OPTION value=05Regular Week 
Schedule/OPTION/SELECT /TD
TD id=c03 align=middleINPUT type=checkbox value=on 
name=historyItems[0].delete /TD
TD class=rowNormal id=c04INPUT class=dropdowns2 id=d00 
style=VISIBILITY: hidden size=1 value=2004-01-03 
name=historyItems[0].startDate /TD/TR

- - - - - - - This is the row added dynamically - - - - - - -
TR class=rowNormal onmouseover=this.className = 'hilite' 
onmouseout=this.className = 'rowNormal' valign=top
TD id=c40/TD
TD id=c41A onclick=lineId='c40'; 
calendar.showCalendar('calendarAnchor', '2005-04-27'); return false; 
href=http://nati02:5001/hronline/secure/WEB-INF/personal/timeAndAttendance/cWWHistory.jsp#;IMG
 
height=16 src=http://nati02:5001/hronline/images/calendar.jpg; width=16 
border=0 /A/TD
TD id=c42SELECT class=dropdowns2 id=s4 
onchange=addTableRow('historyTable','s4') 
name=historyItems[4].scheduleTypeIdOPTION value=00 selected/OPTION 
OPTION value=011 Week Cycle/OPTION OPTION value=022 Week 
Cycle/OPTION OPTION value=033 Week Cycle/OPTION OPTION value=044 
Week Cycle/OPTION OPTION value=05Regular Week 
Schedule/OPTION/SELECT /TD
TD align=middleINPUT type=checkbox value=on 
name=historyItems[4].delete /TD
TD class=rowNormal id=c44INPUT class=dropdowns2 id=d40 
style=VISIBILITY: hidden size=1 value=2004-01-03 
name=historyItems[4].startDate /TD/TR/TBODY

- Glenn




Frank W. Zammetti [EMAIL PROTECTED] 
27/04/2005 04:27 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: [OT] DOM  JavaScript
Classification








Hmm... I notice that the JSP code is referencing onMouseOver, while your 
Javascript is trying to set the attribute onmouseover... I wonder if the 
capitalization difference is an issue?  Certainly, if setAttribute() 
takes case into consideration that would do it.  You said the lines were 
identical when you looked, but could it be you glossed over the 
difference in capitalization? (I may have too).

Frank

[EMAIL PROTECTED] wrote:
 Greetings,
 
 Once again I call on my trusted community for insight !
 I'm adding a row to a table dynamically. All is working well except for 
 one thing the Mouse events.
 
 Here is the code for adding a row to the table.
 There is more code that adds the cells to the table (not shown).
 ...
 // Only add a row when changing the last row of the table
 if (s+(rowWithData) == selectId) {
 var row = table.insertRow(lastRowInTable);
 var className = rowNormal;
 
 if (lastRowInTable % 2 == 0) {
 className = rowAlternate;
 }
 row.className = className;
 row.setAttribute(onmouseover, this.className = 'hilite';);
 row.setAttribute(onmouseout, this.className = ' + className 
+ 
 ');
 ...
 }
 
 
 Here is the JSP code that creates the table row (at least one row is in 
 the page), here the mouse events are working:
 tr valign=top onMouseOver=this.className = 'hilite' onMouseOut=
 this.className = 'c:out value='${rowClass}'/' class=c:out value=
 '${rowClass}'/
 
 If I add an alert that dumps the innerHTML of the table after the 
 row/cells are added and I compare the two rows... 
 They are the same.
 Why are the mouse events added dynamically not recongnized ?
 
 BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158
 
 TIA,
 Glenn
 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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





Re: DynaActionForm: ArrayIndexOutOfBoundsException

2005-04-21 Thread gdeschen
Oh man... I'm slightly confused this morning... perhaps an espresso is 
required !
I have been reading and searching based on the links below... however I am 
stuck.

For the time being this is what I have done; upgraded to :
- Struts 1.2.4
- BeanUtils 1.7
- Collections 3.1
- Digester 1.6
- Logging 1.0.4

I have used the jars and taglibs found here: 
jakarta-struts-1.2.4/contrib/struts-el/lib
In my struts-config.xml I have this:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts 
Configuration 1.2//EN
   
http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd;

form-bean name=lazyCWWHistoryForm type=
org.apache.commons.beanutils.LazyDynaBean
  form-property name=historyItems type=
hronline.secure.personal.cWWHistory.CWWHistoryVO[]/form-property
/form-bean
...

I get these errors:
- Type org.apache.commons.beanutils.LazyDynaBean does not support form 
properties
- org.apache.commons.beanutils.LazyDynaBean must be a subclass of the 
org.apache.struts.action.ActionForm

Now based on the errors it seems that I am not referencing the correct 
jar?
Something else?

- Glenn







Hubert Rabago [EMAIL PROTECTED]
20/04/2005 02:49 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: FW: DynaActionForm: 
ArrayIndexOutOfBoundsException
 Classification: 
 


Take a look at

http://struts.apache.org/faqs/indexedprops.html
http://www.developer.com/java/other/article.php/2233591
http://wiki.apache.org/struts/StrutsCatalogLazyList

Also, search the archives (like
http://marc.theaimsgroup.com/?l=struts-user ) for lazylist to get
ideas on approaches to dealing with dynamically sized form fields.

Hubert




Re: DynaActionForm: ArrayIndexOutOfBoundsException

2005-04-21 Thread gdeschen
Thanks Hubert !

Perhaps the wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList is 
not correct or I am interepting it falsely, 
It has this note in the section LazyDynaBean/LazyValidatorForm:
N.B. Solutions here require Struts 1.2.4 and Bean Utils 1.7.0 

- Glenn






Hubert Rabago [EMAIL PROTECTED]
21/04/2005 11:49 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: DynaActionForm: ArrayIndexOutOfBoundsException
 Classification: 
 


You need to use an ActionForm subclass for your form-bean.  The
Lazy-flavored form bean was added after 1.2.4.  If you're unable to
upgrade from 1.2.6, consider adding it directly to your code base for
now.

You can get it here:
http://svn.apache.org/viewcvs.cgi/struts/core/branches/STRUTS_1_2_BRANCH/src/share/org/apache/struts/validator/LazyValidatorForm.java?view=markup


Hubert


On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Oh man... I'm slightly confused this morning... perhaps an espresso is
 required !
 I have been reading and searching based on the links below... however I 
am
 stuck.
 
 For the time being this is what I have done; upgraded to :
 - Struts 1.2.4
 - BeanUtils 1.7
 - Collections 3.1
 - Digester 1.6
 - Logging 1.0.4
 
 I have used the jars and taglibs found here:
 jakarta-struts-1.2.4/contrib/struts-el/lib
 In my struts-config.xml I have this:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD 
Struts
 Configuration 1.2//EN
 
 http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd;
 
 form-bean name=lazyCWWHistoryForm type=
 org.apache.commons.beanutils.LazyDynaBean
   form-property name=historyItems type=
 hronline.secure.personal.cWWHistory.CWWHistoryVO[]/form-property
 /form-bean
 ...
 
 I get these errors:
 - Type org.apache.commons.beanutils.LazyDynaBean does not support form
 properties
 - org.apache.commons.beanutils.LazyDynaBean must be a subclass of the
 org.apache.struts.action.ActionForm
 
 Now based on the errors it seems that I am not referencing the correct
 jar?
 Something else?
 
 - Glenn
 
 Hubert Rabago [EMAIL PROTECTED]
 20/04/2005 02:49 PM
 Please respond to Struts Users Mailing List
 
 To: Struts Users Mailing List user@struts.apache.org
 cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
 
 Subject:Re: FW: DynaActionForm:
 ArrayIndexOutOfBoundsException
  Classification:
 
 
 Take a look at
 
 http://struts.apache.org/faqs/indexedprops.html
 http://www.developer.com/java/other/article.php/2233591
 http://wiki.apache.org/struts/StrutsCatalogLazyList
 
 Also, search the archives (like
 http://marc.theaimsgroup.com/?l=struts-user ) for lazylist to get
 ideas on approaches to dealing with dynamically sized form fields.
 
 Hubert
 


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





Re: html:link invalid for DTD???

2005-04-21 Thread gdeschen
What does the Action Mapping look like for /welcome ?





Scott Purcell [EMAIL PROTECTED]
21/04/2005 12:07 PM
Please respond to Struts Users Mailing List




 
To: user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:html:link invalid for DTD???
 Classification: 
 


Hello,

I am creating a new site, and I am having trouble interpreting an error 
message:
I have a jsp page with the following html:img in it.
html:img page=/images/shop.gif border=0/
and this shows the image with the context and all is happy.

As soon as I try and create this shop image into a link like so.
html:link action=/welcome
  html:img page=/images/shop.gif border=0/
/html:link

I get this error message:
org.apache.jasper.JasperException: /jsp/welcome.jsp(34,7) Attribute action 
invalid for tag link according to TLD
 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)

I am looking at the docs here: 
http://struts.apache.org/userGuide/struts-html.html#link

and there are no REQUIRED attributes.

Also, how would I know what DTD this is using?

Any help would be appreciated.

Thanks,
Scott


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





Re: html:link invalid for DTD???

2005-04-21 Thread gdeschen
The slash is okay in the action.
Where is exactly this snippet of code in the welcome.jsp?:
html:link action=/welcome
   html:img page=/images/shop.gif border=0/
/html:link






Jeff Beal [EMAIL PROTECTED]
21/04/2005 01:10 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: html:link invalid for DTD???
 Classification: 
 


Have you tried removing the slash so you just have 'action=welcome'?
 I can never remember when the slash is required and when it is not
allowed, but I think that for action names you don't use the slash.

-- Jeff

On 4/21/05, Scott Purcell [EMAIL PROTECTED] wrote:
 As soon as I try and create this shop image into a link like so.
 html:link action=/welcome
   html:img page=/images/shop.gif border=0/
 /html:link
 
 I get this error message:
 org.apache.jasper.JasperException: /jsp/welcome.jsp(34,7) Attribute 
action invalid for tag link according to TLD
 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)

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





RE: html:link invalid for DTD???

2005-04-21 Thread gdeschen
LOL... apologies... I meant in which page is the link?





Scott Purcell [EMAIL PROTECTED]
21/04/2005 02:01 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:RE: html:link invalid for DTD???
 Classification: 
 


The code snippet lives between the html:form tags /





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 21, 2005 12:56 PM
To: Struts Users Mailing List
Subject: Re: html:link invalid for DTD???


The slash is okay in the action.
Where is exactly this snippet of code in the welcome.jsp?:
html:link action=/welcome
   html:img page=/images/shop.gif border=0/
/html:link






Jeff Beal [EMAIL PROTECTED]
21/04/2005 01:10 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: html:link invalid for DTD???
 Classification: 
 


Have you tried removing the slash so you just have 'action=welcome'?
 I can never remember when the slash is required and when it is not
allowed, but I think that for action names you don't use the slash.

-- Jeff

On 4/21/05, Scott Purcell [EMAIL PROTECTED] wrote:
 As soon as I try and create this shop image into a link like so.
 html:link action=/welcome
   html:img page=/images/shop.gif border=0/
 /html:link
 
 I get this error message:
 org.apache.jasper.JasperException: /jsp/welcome.jsp(34,7) Attribute 
action invalid for tag link according to TLD
 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)

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





[Slightly OT] Upgrading WSAD to Struts 1.2.4

2005-04-20 Thread gdeschen
I'm currently using WebSphere Studio Application Developer v5.1.2.
Struts v1.1 is already included in this release.
What I'd like to do is to update the IDE to Struts v1.2.4. This way any 
new projects will include the latest version of Struts.

I do know that I can add the jars and taglibs to the project... but then 
I'd have to do this for every project.

TIA,
Glenn

DynaActionForm: ArrayIndexOutOfBoundsException

2005-04-20 Thread gdeschen
Hello,

I have a DynaActionForm such as:
form-bean name=dynaCWWHistoryForm type=
org.apache.struts.action.DynaActionForm
   form-property name=cancelButton type=
org.apache.struts.util.ImageButtonBean/form-property
   form-property name=displayContent type=java.lang.Boolean/
form-property
   form-property name=frmtPrinter type=java.lang.String/
form-property
   form-property name=historyItems type=personal.history.HistoryVO[]
/form-property
   form-property name=language type=java.lang.String/form-property
   form-property name=scheduleTypes type=java.util.List/
form-property
   form-property name=systemDate type=java.lang.String/
form-property
   form-property name=updateButton type=
org.apache.struts.util.ImageButtonBean/form-property
   form-property name=workWeekSchedule type=java.lang.String/
form-property
   form-property name=years type=java.util.List/form-property
/form-bean

If I assign a size to the array such as:
   form-property name=historyItems type=personal.history.HistoryVO[] 
size=4/form-property
It works fine.

My problem is two fold:
1. The HistoryVO[] can be of any size... therefore I cannot assgin a size 
to the form-property
2. The user can add rows dynamically to DOM using JavaScript... how can 
this also work with the DynaActionForm ?

Much appreciated,
Glenn

FW: DynaActionForm: ArrayIndexOutOfBoundsException

2005-04-20 Thread gdeschen
I'm browsing thru the source code... any help would be extremely welcomed 
!

In addition this is the dump:

[20/04/05 13:10:31:116 EDT] 67e967e9 WebGroup  E SRVE0026E: [Servlet 
Error]-[BeanUtils.populate]: java.lang.ArrayIndexOutOfBoundsException
at java.lang.Throwable.init(Throwable.java)
at java.lang.Throwable.init(Throwable.java)
at 
java.lang.ArrayIndexOutOfBoundsException.init(ArrayIndexOutOfBoundsException.java:60)
at java.lang.reflect.Array.get(Native Method)
at 
org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296)
at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474)
at 
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java)
at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java)
at 
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java)
at 
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at 
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at 
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at 
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at 
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at 
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at 
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at 
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at 
hronline.secure.app.HROnlineFilter.doFilter(HROnlineFilter.java:162)
at 
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at 
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at 
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at 
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at 
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at 
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at 
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at 
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)



Hello,

I have a DynaActionForm such as:
form-bean name=dynaCWWHistoryForm type=
org.apache.struts.action.DynaActionForm
   form-property name=cancelButton type=
org.apache.struts.util.ImageButtonBean/form-property
   form-property name=displayContent type=java.lang.Boolean/
form-property
   form-property name=frmtPrinter type=java.lang.String/
form-property
   form-property name=historyItems type=personal.history.HistoryVO[]
/form-property
   form-property name=language type=java.lang.String/form-property
   form-property name=scheduleTypes type=java.util.List/
form-property
   form-property name=systemDate type=java.lang.String/
form-property
   form-property name=updateButton type=
org.apache.struts.util.ImageButtonBean/form-property
   form-property name=workWeekSchedule type=java.lang.String/
form-property
   form-property name=years 

Re: html:multibox nested within a c:forEach Help!

2005-04-15 Thread gdeschen
David,

Sounds like the same thing I was having fun with yesterday.
I'm just back into the code... seems like the best would be Struts-EL 
tags.

I have not looked into how to use them in the current environment 
(WebSphere Studio Application Developer).

- Glenn





David Johnson [EMAIL PROTECTED]
15/04/2005 12:42 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:html:multibox nested within a c:forEach Help!
 Classification: 
 


Hi all

I have the following, with the goal being to allow the user to select
multiple portfolios, which I can then access in the action class.

JSP:
c:forEach var=portfolio items=${userPortfolios}
   html:multibox value= c:out value='${portfolio.portfolioName}'/
property=userPortfolio /
   c:out value=${portfolio.portfolioName}/br
/c:forEach

this prints out a checkbox, then thename of the current portfolio from
the userPortfolios collection.

The problem is that in the rendered HTML the portfolioName is not
being printed, only the following (from log.info in the Action Class)

user selected portfolioID=c:out value='${portfolio.portfolioName}'/

the Question is:
Should I be using the c:forEach here or would I have more luck using
the Struts logic:iterate tag would they play more nicely
together?

-- 
-Dave
[EMAIL PROTECTED]

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





Re: html:multibox nested within a c:forEach Help!

2005-04-15 Thread gdeschen
Here is what I know:
http://struts.apache.org/faqs/struts-el.html
http://struts.apache.org/userGuide/building_view.html section 3.4.6.

HTH,
Glenn




David Johnson [EMAIL PROTECTED]
15/04/2005 12:52 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: html:multibox nested within a c:forEach 
Help!
 Classification: 
 


Are there any resources you can point me to?

On 4/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 David,
 
 Sounds like the same thing I was having fun with yesterday.
 I'm just back into the code... seems like the best would be Struts-EL
 tags.
 
 I have not looked into how to use them in the current environment
 (WebSphere Studio Application Developer).
 
 - Glenn
 
 David Johnson [EMAIL PROTECTED]
 15/04/2005 12:42 PM
 Please respond to Struts Users Mailing List
 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)
 
Subject:html:multibox nested within a c:forEach Help!
 Classification:
 
 
 Hi all
 
 I have the following, with the goal being to allow the user to select
 multiple portfolios, which I can then access in the action class.
 
 JSP:
 c:forEach var=portfolio items=${userPortfolios}
   html:multibox value= c:out value='${portfolio.portfolioName}'/
 property=userPortfolio /
   c:out value=${portfolio.portfolioName}/br
 /c:forEach
 
 this prints out a checkbox, then thename of the current portfolio from
 the userPortfolios collection.
 
 The problem is that in the rendered HTML the portfolioName is not
 being printed, only the following (from log.info in the Action Class)
 
 user selected portfolioID=c:out value='${portfolio.portfolioName}'/
 
 the Question is:
 Should I be using the c:forEach here or would I have more luck using
 the Struts logic:iterate tag would they play more nicely
 together?
 
 --
 -Dave
 [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
-Dave
[EMAIL PROTECTED]

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





JSTL simply love it however ...

2005-04-14 Thread gdeschen
I have started to use JSTL this week. I simply love it !!!
However, I have one small problem that I cannot seem to get working.

Here is a snippet of code that works fine:
c:forEach items=${dynaCWWHistoryForm.map.historyItems} var=
historyItems varStatus=status
   tr valign=top
  td id=cc:out value='${status.index}'/2
 c:forEach items=${dynaCWWHistoryForm.map.scheduleTypes} var=
option
html:select name=historyItems property=scheduleTypeId 
indexed=true styleClass=dropdowns2
   html:optionsCollection name=dynaCWWHistoryForm property=
scheduleTypes
  label=label value=value/
/html:select
   /td
   /tr
/c:forEach



What I need to do is add an onChange event for the html:select tag such 
as:
c:forEach items=${dynaCWWHistoryForm.map.historyItems} var=
historyItems varStatus=status
   tr valign=top
  td id=cc:out value='${status.index}'/2
 c:forEach items=${dynaCWWHistoryForm.map.scheduleTypes} var=
option varStatus=optionStatus
html:select name=historyItems onchange=
addTableRow('historyTable','s_SOMETHING_HERE')
  property=scheduleTypeId indexed=true styleClass=
dropdowns2
   html:optionsCollection name=dynaCWWHistoryForm property=
scheduleTypes
  label=label value=value/
/html:select
   /td
   /tr
/c:forEach

Where the SOMETHING_HERE would need to be c:out value='${status.index}'/
.
Is this possible?

Any help would be appreciated.
- Glenn



RE: JSTL simply love it however ...

2005-04-14 Thread gdeschen
Niether solution works...
The expression is never evaluated. The output is:

select name=historyItems[2].scheduleTypeId 
onchange=addTableRow('historyTable','sc:out value='${status.index}'/') 
class=dropdowns2






Abdullah Jibaly [EMAIL PROTECTED]
14/04/2005 10:06 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:RE: JSTL simply love it however ...
 Classification: 
 


I think ${status.index} in place of s_SOMETHING_HERE would work fine.
Otherwise, try setting onChange=${addTableRow} with addTableRow prior 
defined as:

c:set var=addTableRowaddTableRow('historyTable','c:out 
value=${status.index} /')/c:set

-Abdullah

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 14, 2005 7:59 AM
To: user@struts.apache.org
Subject: JSTL simply love it however ...


I have started to use JSTL this week. I simply love it !!!
However, I have one small problem that I cannot seem to get working.

Here is a snippet of code that works fine:
c:forEach items=${dynaCWWHistoryForm.map.historyItems} var=
historyItems varStatus=status
   tr valign=top
  td id=cc:out value='${status.index}'/2
 c:forEach items=${dynaCWWHistoryForm.map.scheduleTypes} var=
option
html:select name=historyItems property=scheduleTypeId 
indexed=true styleClass=dropdowns2
   html:optionsCollection name=dynaCWWHistoryForm property=
scheduleTypes
  label=label value=value/
/html:select
   /td
   /tr
/c:forEach



What I need to do is add an onChange event for the html:select tag such 
as:
c:forEach items=${dynaCWWHistoryForm.map.historyItems} var=
historyItems varStatus=status
   tr valign=top
  td id=cc:out value='${status.index}'/2
 c:forEach items=${dynaCWWHistoryForm.map.scheduleTypes} var=
option varStatus=optionStatus
html:select name=historyItems onchange=
addTableRow('historyTable','s_SOMETHING_HERE')
  property=scheduleTypeId indexed=true styleClass=
dropdowns2
   html:optionsCollection name=dynaCWWHistoryForm property=
scheduleTypes
  label=label value=value/
/html:select
   /td
   /tr
/c:forEach

Where the SOMETHING_HERE would need to be c:out value='${status.index}'/
.
Is this possible?

Any help would be appreciated.
- Glenn


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





Re: JSTL simply love it however ...

2005-04-14 Thread gdeschen
How can I tell which version of the struts tags?





Dave Newton [EMAIL PROTECTED]
14/04/2005 10:53 AM
Please respond to Struts Users Mailing List

 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: JSTL simply love it however ...
 Classification: 
 
[EMAIL PROTECTED] wrote:

Niether solution works...
The expression is never evaluated. The output is:

select name=historyItems[2].scheduleTypeId 
onchange=addTableRow('historyTable','sc:out 
value='${status.index}'/') 
class=dropdowns2
 

Are you using the EL version of the struts tags?

Dave



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





Re: JSTL simply love it however ...

2005-04-14 Thread gdeschen
Okay... I am not using the Struts EL taglibs.
Should I be using them?


You choose to use the struts EL tags by a) using the struts EL tld (like 
struts-html-el.tld) and b) by having the struts-el tag JAR file. I don't 
know if they come by default with the latest release or not; you'd have 
to check.

Dave



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





Re: JSTL simply love it however ...

2005-04-14 Thread gdeschen
Okay... 
I tried the following:
html:select name=historyItems property=scheduleTypeId indexed=true 
styleClass=dropdowns2
  onchange=addTableRow('historyTable',
  's%=((javax.servlet.jsp.jstl.core.LoopTagStatus) 
pageContext.getAttribute(status)).getIndex()%')
   html:optionsCollection name=dynaCWWHistoryForm property=
scheduleTypes label=label value=value/
/html:select

and I get this error:
Error 500: /WEB-INF/personal/timeAndAttendance/cWWHistory.jsp(215,129) 
Attribute status has no value 

I'd really like to get this working, I will then spend some time looking 
into upgrading to a later version of Struts ti use the EL tags.
This upgrade will give me more work than I had anticipated... but in the 
end it is GOOD extra work ! :




I think Dave's got it.  Use the struts-el tags if you want to have EL 
expressions instead of RT expressions (%= ... %)

If you want/have to stick with RT, then you'd need this instead of 
${status.index}

%= ((javax.servlet.jsp.jstl.core.LoopTagStatus) 
pageContext.getAttribute(status)).getIndex() %

K.C.


Re: JSTL simply love it however ...

2005-04-14 Thread gdeschen
Umh... I am now getting this error: Attribute addTableRow( has now value.

I have downloaded the Struts 1.2.4 and noticed that there is a lib 
directory and then there is a contrib/lib.
What is necessary to use the Struts-EL tags?


I think that with RT the attribute is all expression or no expression.
so try :

html:select name=historyItems 
  property=scheduleTypeId indexed=true 
  styleClass=dropdowns2
  onchange=% = addTableRow('historyTable', 's + 
((javax.servlet.jsp.jstl.core.LoopTagStatus)
pageContext.getAttribute(status)).getIndex() + ') %

I'm not sure if i parsed your intention correctly, but the idea is that
the attribute should be all expression. a simpler example:

wrong - sometag value=this is a %= beanName.getValue() %
right - sometag value=%= this is a  + beanName.getValue() %


dave


Re: c:forEach tag and indexed properties problem

2005-04-13 Thread gdeschen
Have you included the taglb in the JSP ?
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %





Axel Sachmann [EMAIL PROTECTED]
12/04/2005 05:49 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: c:forEach tag and indexed properties problem
 Classification: 
 


[EMAIL PROTECTED] wrote:

Any data in the dynamicArrayForm.map.artikel ?
 

yes it's work fine without the html:text tag.
here  is an example output.

TR
  TD bad - Ausstattung PS-Exklusiv 
  2000.0 Euro
 /TD
 TDTyp 1/TD
 TD30.05.2005 
 
 /TD
 
  /TR

But it doesn't work with the html:text tag!







Axel Sachmann [EMAIL PROTECTED]
12/04/2005 04:11 PM
Please respond to Struts Users Mailing List




 
To: user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:c:forEach tag and indexed properties problem
 Classification: 
 


Hi Guys,

i have a problem with the forEach Tag and an indexed propertie!
Please have a look at this peace of code.

c:forEach var=artikel items=${dynamicArrayForm.map.artikel} 
TR
  TD   c:out value=${artikel.kategorie}/ - c:out
value=${artikel.setbezeichnungkurz}/
  c:out value=${artikel.preisnetto}/ c:out
value=${artikel.preiseinheit}/
   /TD
TD
   c:out value=${artikel.warengruppe}/
   /TD
   TD
 c:out value=${artikel.angebotsdatumbis}/
html:text  name=artikel indexed=true property=menge/
  /TD
  /TR
/c:forEach

Everthing goes okay - but the html:text element throws an error -

Cannot find bean artikel in any scope

Why it doesn't work?

Thanks for Help

Axel Sachmann





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




 



-- 
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln

Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12

Internet: http://www.profiIT.de 



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





Re: c:forEach tag and indexed properties problem

2005-04-13 Thread gdeschen
Ah yes... you do not have the html:form tag?

According to the Developer Guide (
http://struts.apache.org/userGuide/struts-html.html#text)
Render an input button of type text. This tag is only valid when nested 
inside a form tag body. 

Try wrapping it in the html:form tag.






Axel Sachmann [EMAIL PROTECTED]
13/04/2005 07:55 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: c:forEach tag and indexed properties problem
 Classification: 
 


[EMAIL PROTECTED] wrote:

Have you included the taglb in the JSP ?
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 

Yes but the bean is not in any scope!  How can i access the Form-property?





Axel Sachmann [EMAIL PROTECTED]
12/04/2005 05:49 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: c:forEach tag and indexed properties problem
 Classification: 
 


[EMAIL PROTECTED] wrote:

 

Any data in the dynamicArrayForm.map.artikel ?


 

yes it's work fine without the html:text tag.
here  is an example output.

TR
  TD bad - Ausstattung PS-Exklusiv 
  2000.0 Euro
 /TD
 TDTyp 1/TD
 TD30.05.2005 
 
 /TD
 
  /TR

But it doesn't work with the html:text tag!



 



Axel Sachmann [EMAIL PROTECTED]
12/04/2005 04:11 PM
Please respond to Struts Users Mailing List





   To: user@struts.apache.org
   cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

   Subject:c:forEach tag and indexed properties problem
Classification: 



Hi Guys,

i have a problem with the forEach Tag and an indexed propertie!
Please have a look at this peace of code.

c:forEach var=artikel items=${dynamicArrayForm.map.artikel} 
   TR
 TD   c:out value=${artikel.kategorie}/ - c:out
value=${artikel.setbezeichnungkurz}/
 c:out value=${artikel.preisnetto}/ c:out
value=${artikel.preiseinheit}/
  /TD
   TD
  c:out value=${artikel.warengruppe}/
  /TD
  TD
c:out value=${artikel.angebotsdatumbis}/
html:text  name=artikel indexed=true property=menge/
 /TD
 /TR
   /c:forEach

Everthing goes okay - but the html:text element throws an error -

Cannot find bean artikel in any scope

Why it doesn't work?

Thanks for Help

Axel Sachmann





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






 



 



-- 
profiIT e.K. , die Dienstleistungsplattform für IT - Profis
Axel Sachmann
Amtsgericht Köln, HR A 21756
Melanchthonstraße 29a
51061 Köln

Telefon: +49 221 97716 - 11
Telefax: +49 221 97716 - 12

Internet: http://www.profiIT.de 


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





Re: [OT: JSTL] Re: c:forEach for an object that extends ArrayList in Application **and** Session

2005-04-13 Thread gdeschen
David, can you post the code that defines the PortfolioBean.





David Johnson [EMAIL PROTECTED]
13/04/2005 04:21 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: [OT: JSTL] Re: c:forEach for an object that 
extends ArrayList in Application **and** Session
 Classification: 
 


Hey

That totally makes sense, and I definitely see hot to iterate through
a collection of Strings or other straightforward things, but what I'm
confused about is that my PortfolioBeanCollection (extends ArrayList)
contains objects of type PortfolioBean which in  turn contain the
attribute I'm trying to display..so the PortfolioBean itself has no
explicit name to which I can refer...

so I really want to do something like

PortfolioBeanCollection.PortfolioBean.portfolioName

normally, I'd just loop through the PortfolioBeanCollection casting
the resulting Object into a PortfolioBean then calling the
getPortfolioName() method on the bean

The examples I'be found deal more with simple Collections of Strings,
ints, etc. where you might have a collection of teachers for example
and want to print out the firstName attribute of each... whereas my
example has another later.

I might be babbling. Does that make sense?

On 4/13/05, Dave Newton [EMAIL PROTECTED] wrote:
 David Johnson wrote:
 
 that makes sense, but the individual portfolios (the members of the
 PortfolioBeanCollection) dont really have a name, I just looped
 through my result set doing
 
 PortfolioBeanCollection PBC=new PortfolioBeanCollection ();
 while (result.hasnext){
  pbc.add (new PortfolioBean(resultSet.getString(namefield)));
 }
 
 so I really just used the PortfolioBeanCollection as if it were a
 garden variety ArrayList does your comment still apply?
 
 
 Of course--you have to tell the c:out... tag a) what bean to get the
 property from and b) what property to display. When you say c:forEach
 items=${userPortfolios}... you are telling c:forEach what collection
 to use for the iteration. When you say c:forEach var=portfolio...
 you are creating a variable you can use in other JSTL tags--in essence
 naming each portfolio bean portfolio for the purposes of JSTL.
 
 But you still have to tell c:out... what bean and what property,
 otherwise how would it know what to print? When you just say c:out
 value=${portfolioName}/ it's looking for an application, session,
 request, or page scoped attribute named portfolioName. Without the
 prepended portfolio it doesn't know that the property portfolioName
 is associated with a bean created through the c:forEach iterator.
 
 I'd recommend checking out some very basic JSTL docs to get a feel for
 how JSTL works:
 http://www.onjava.com/pub/a/onjava/2002/08/14/jstl1.html
 http://www.onjava.com/pub/a/onjava/2002/09/11/jstl2.html
 
 Dave
 
 (Wouldn't it have been quicker to just but the property name in your
 code and see if it worked?)
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
-Dave
[EMAIL PROTECTED]

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





Re: c:forEach tag and indexed properties problem

2005-04-12 Thread gdeschen
Any data in the dynamicArrayForm.map.artikel ?





Axel Sachmann [EMAIL PROTECTED]
12/04/2005 04:11 PM
Please respond to Struts Users Mailing List




 
To: user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:c:forEach tag and indexed properties problem
 Classification: 
 


Hi Guys,

i have a problem with the forEach Tag and an indexed propertie!
Please have a look at this peace of code.

c:forEach var=artikel items=${dynamicArrayForm.map.artikel} 
TR
  TD   c:out value=${artikel.kategorie}/ - c:out
value=${artikel.setbezeichnungkurz}/
  c:out value=${artikel.preisnetto}/ c:out
value=${artikel.preiseinheit}/
   /TD
TD
   c:out value=${artikel.warengruppe}/
   /TD
   TD
 c:out value=${artikel.angebotsdatumbis}/
html:text  name=artikel indexed=true property=menge/
  /TD
  /TR
/c:forEach

Everthing goes okay - but the html:text element throws an error -

Cannot find bean artikel in any scope

Why it doesn't work?

Thanks for Help

Axel Sachmann





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





Re: [REFERENDUM] Struts is a Community

2005-04-11 Thread gdeschen
It is simply a community.

I my case I had started my own version of Struts without realizing that 
there was already one created but with a community behind it !
I soon stopped using my own and switched to Struts. [Okay, I still have on 
application in production yet to be converted]

In the end Struts is way of doing things within  an MVC architecture.
However, it is an industry wide accepted and used framework.
This is a powerful argument in the corporate world... since there is a 
community behind it, lots of documentation/books, and lots of resources 
who know it.

The framework would not have advanced so quickly without the community,,, 
for developers to commit code, for users to use it, the whole for 
injecting the framework with a momentum to sustain its evolution.

- Glenn

Re: Authorized Site Creation With Struts

2005-04-08 Thread gdeschen
Scott.

I have architectured an application a little over a year ago...
And opted to use a filter to handle logic before getting into the Struts 
portion of the application.
At first... I was unsure if this was the best way to go... but today I am 
sure glad I did so.

The users started making riduculous demands... since they have the stash 
of money it is hard to tell them they are crazy!
As an example, they wanted the application to update a database (another 
system) with the requested pages... plus with some detailed information.
This was not availble in the standard log files.
Since this was not the goal of the application but an external user 
request (dumb one) I simply used the HTTP Client to fire off a post to a 
page and don't really care what happens afterwards.

The filter gave me an incredibly efficient option to handle changes 
without affecting the application logic at all.
SInce then I have had other twisted requests!
Finally, if ever I need to remove this feature... it can be done in 5 
minutes!

- Glenn





Scott Purcell [EMAIL PROTECTED]
08/04/2005 10:28 AM
Please respond to Struts Users Mailing List




 
To: user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Authorized Site Creation With Struts
 Classification: 
 


Hello,
First off, I am having trouble with creating a more elegant solution to a 
proboem.
 
A- Problem, I have a site that requires authentication (form-based) when 
they hit our site. 
Upon building the site which requires an AppObject and UserObject, 
I subclassed the
RequestProcessor, and put in logic to ensure that both objects 
existed.
 
This works good.
 
   Next, I needed to find out when a user's session expired. Upon further 
investigation,
   I subclassed an Action class and added a new executeAction(signature) 
that pulled in
   the AppObject and UserObject that were in the session from the Request 
Processor.
 
  I then checked if the UserObject had a logged-in flag. If so, great, 
they can work, else
  I would throw them to the front door and create a ActionMessage that 
says Session Expired.
 
All of this works, and does its job. Problem is now, I am not happy with 
my creation. It screwed with my ability to use
DispatchAction and LookupDispatchAction. Two things I wasn't sure I would 
need when I began.
 
Anyway, I have searched and searched, and was hoping someone may have a 
better way to handle
this session-management possibly all in the RequestProcesor?
 
The problem I am finding, is that I create new UserObject and AppObject 
each time someone comes through, because I do not know if they
are new or returning users. It is not until they are looking for an inside 
page, that I am aware they are not valid.
 
Does this make sense? I figured a lot of you out there may have this same 
type of secure site. Any ideas?
 
Thanks,

Scott K Purcell

 

 




Anxiously awaiting...

2005-04-07 Thread gdeschen
Hi,

I am anxiously awaiting for the thread between Stéphane, Rick and Niall to 
continue.
I am experimenting with trying to do the same thing as Stéphane.

In the mean time I am having one of those mornings where nothing seems to 
be going my way.
I am trying to use JSTL for the first time and the expression does not 
seem to get evaluated.
Ex.:
bean:define id=emply name=HRnlnVO property=emplyVO /
bean:write name=emply property=firstName /
c:out value=${emply.firstName}/


The bean:write line works like a charm.
The c:out line just writes out the expression: ${emply.firstName}

Why?

TIA,
Glenn

Re: Anxiously awaiting...

2005-04-07 Thread gdeschen
Tried it and just writes the out the string ${emply.firstname}

- Glenn




Stéphane Zuckerman [EMAIL PROTECTED]
07/04/2005 11:39 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: Anxiously awaiting...
 Classification: 
 


Hello,

 Ex.:
 bean:define id=emply name=HRnlnVO property=emplyVO /
 bean:write name=emply property=firstName /
 c:out value=${emply.firstName}/

[code]
bean:define id=emply name=HRnlnVO property=emplyVO /
bean:write name=emply property=firstName /
${emply.firstname}
[/code]

Have you tried to do just that ?


-- 
Stéphane Zuckerman

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





RE: Anxiously awaiting...

2005-04-07 Thread gdeschen
What is the difference between the two:
%@ taglib uri=http://java.sun.com/jstl/core_rt; prefix=c %

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

- Glenn





Brad Balmer [EMAIL PROTECTED]
07/04/2005 01:17 PM
Please respond to Struts Users Mailing List




 
To: 'Struts Users Mailing List' user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:RE: Anxiously awaiting...
 Classification: 
 


Did you define the tag at the top of the jsp?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 07, 2005 11:32 AM
To: Struts Users Mailing List
Subject: Re: Anxiously awaiting...

Tried it and just writes the out the string ${emply.firstname}

- Glenn




Stéphane Zuckerman [EMAIL PROTECTED]
07/04/2005 11:39 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: Anxiously awaiting...
 Classification: 
 


Hello,

 Ex.:
 bean:define id=emply name=HRnlnVO property=emplyVO /
 bean:write name=emply property=firstName /
 c:out value=${emply.firstName}/

[code]
bean:define id=emply name=HRnlnVO property=emplyVO /
bean:write name=emply property=firstName /
${emply.firstname}
[/code]

Have you tried to do just that ?


-- 
Stéphane Zuckerman

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





HTML Map Definition

2005-04-06 Thread gdeschen
Greetings,

I have a small problem that I'd like to resolve.
I have just upgraded (sometimes it feels more like a downgrade!) from 
WebSphere Studio Application Developer (WSAD) v5.1.1 to v5.1.2.

The issue is that I now have a warning that the hrefs below: targets 
cannot be resolved.
It is just annoying to have these messages.

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
map name=tabMap
   area shape=rect coords=96,5,5,23 href=
/personal/timeAndAttendance/LeaveAndOvertimeCalendar.do
  alt=bean:message key='title.calender'/
   area shape=rect coords=192,5,100,23 href=
/personal/timeAndAttendance/LeaveAndOvertimeBalances.do
alt=bean:message key='title.balances'/
   area shape=rect coords=276,5,195,23 href=
/personal/timeAndAttendance/LeaveAndOvertimeDetails.do
  alt=bean:message key='title.details'/
/map

Is there any better way to write this map definition?

- Glenn


re: Session Idle

2005-04-06 Thread gdeschen
Perhaps a different approach can be used for processes that are time 
consuming.
Some form of batch process.
The user can submit a request... this is queued... and then processed by a 
DB trigger (as an example).
The results of the processing is stored and the user can view the status 
of their requests via a sort of history of requests page.
myTwoCents/

- Glenn





Leon Rosenberg [EMAIL PROTECTED]
06/04/2005 02:11 PM
Please respond to Struts Users Mailing List




 
To: 'Struts Users Mailing List' user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:re: Session Idle
 Classification: 
 


I would solve it by adding a 1 minute refresh in a hidden frame in your 
page
to a action which just delivers next refresh header. As long as the user 
has
the page open, the session will never expire. After he closes the browser,
the session expires normally.

Regards
Leon

 -Ursprüngliche Nachricht-
 Von: Wiebe de Jong [mailto:[EMAIL PROTECTED] 
 Gesendet: Mittwoch, 6. April 2005 20:02
 An: 'Struts Users Mailing List'
 Betreff: RE: Session Idle
 
 Is it possible to create a listener for the session timeout 
 event? This listener would check to see if there is an 
 operation in progress. If there is, reset the timeout 
 counter. If not, let the session expire.
 
 Wiebe
 
 -Original Message-
 From: Justin Morgan [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, April 06, 2005 10:20 AM
 To: Struts Users Mailing List
 Subject: RE: Session Idle
 
 I think Eain is saying that he has some operations that take 
 a long time, and he wants to suspend the timeout counter 
 during those operations.
 
 So suppose the timeout in web.xml is 5 minutes.  One 
 particular operation takes 10 minutes to complete.  Do not 
 expire session.
 
 However, if the user is idle when there is NOT a long process 
 running, expire after 5 minutes.
 
 Is that what you meant, Eain?
 
 -Justin
 
 
 
 -Original Message-
 From: Fogleson, Allen [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 05, 2005 8:57 PM
 To: Struts Users Mailing List
 Subject: RE: Session Idle
 
 That is exactly how the session timeout works. If the user is 
 idle (i.e has not submitted a request in X time) then it is 
 timed out (assuming X is the timeout) otherwise a request 
 acts sort of as a renew this session for X more minutes
 
 Al
 
 
 -Original Message-
 From: Eain Mat [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 05, 2005 7:32 PM
 To: Struts Users Mailing List
 Subject: Re: Session Idle
 
 if i invalidate the session, everything will be destory in 
 the session.
 I still want the session to keep alive when user is in the 
 middle of their processing operation even the session-timeout 
 is passed. I only want to timeout their session, if they are 
 not doing anything.
 
 
 Eain mat
 
 Martin Gainty [EMAIL PROTECTED] wrote:
 --web.xml contents--
 
 
 5 
 
 
 then trap on the invalidate method for your HttpSession 
 object Makes sense???
 Martin-
 - Original Message -
 From: Eain Mat 
 To: 
 Sent: Tuesday, April 05, 2005 7:44 PM
 Subject: Session Idle
 
 
  What is the simplest way to track the session idle? We cannot use
 session-timeout in web.xml because there may be leftover 
 operation that is needed to process.
 
  Eain Mat
 
 
 -
 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]
 
 
 -
 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: How to submit a variable number of text fields ?

2005-04-05 Thread gdeschen
Hello Rick,

Let me try to define a simular problem that I have that would most 
probably answer Stéphane's.
But only Stéphane can confirm this. :)

I have classes such as:

public class Description {

private String id;
private String Description;
...
}

public class HistoryItem {

private boolean delete;
private String startDate;
private List descriptions;
private String descriptionId;
...
}

public class HistoryForm extends ActionForm {

private List historyItems;
...
}

I need to display the historyItems.
However, the user can via JavaScript add many more history items.
I must be able to capture all of the items from the JSP and save them to 
the DB.

Regards,
Glenn





Rick Reumann [EMAIL PROTECTED]
05/04/2005 10:09 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:Re: How to submit a variable number of text fields 
?
 Classification: 
 


Jeff Beal wrote the following on 4/5/2005 9:51 AM:
  I created a simple page like this where the dynamically
 created form properties were just named field0, field1, field2,
 field3, etc. 

I'll be willing to bet almost anything, that Stéphane does not need to 
do this.

Stéphane could you explain a bit more what you are attempting to capture 
from the user? There probably is a pretty a clean solution to what you 
are trying to do.

(More than likely a List in yoru form bean containing the objects you 
need is going to do the trick, but there will be some things to consider 
if you need to dynamically create form fields.. but I want to make sure 
that is what you really need to do. Some people think they need to make 
extra form fields because they aren't really aware of how a List of 
objects can submit just fine.)

-- 
Rick

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





Dynamic Tables and Data

2005-03-30 Thread gdeschen
Greetings,

Apologies if this has already been posted... but since the List Archive is 
not available I must post.

I have a requirement to display rows of the the same data such as:
Date
Description
Delete indicator

The user can change any data in any row at any time.
Additionally, the user can add a row (done via DOM and JavaScript) and 
then add the data.

How can I write this data out to the JSP page... AND how can I capture and 
update the data from the JSP page.

Any insight would be greatly appreciated !!
- Glenn

Re: OT: Handling concurrency issues with web apps

2005-02-07 Thread gdeschen
You can use a timestamp rather than a count... more meaningful.
In the current application I'm developing, the user is informed of the 
interim update along with the new data.

HTH,
Glenn





Lee Harrington [EMAIL PROTECTED]
07/02/2005 11:08 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List user@struts.apache.org
cc: (bcc: Glenn Deschenes/NAT/CMHC-SCHL/CA)

Subject:OT: Handling concurrency issues with web apps
 Classification: 
 


Ok...here's a general development issue that conerns any web based app
that is data entry oriented.  I've been doing reporting systems so
long, I've gotten a bit rusty with transactional development.

What's the best strategy for avoiding last save wins concurrency
issues?  If two people open a web maintenance page, change data, and
save, the last saved wins, meaning the person who saved first loses
their changes.

In the client server world, we'd simply lock the record when someone
opened the screenbut you can't do that in a stateless web
environment.  How would you know the client logged off (or simply
closed their browser)?  The record could remain locked forevernot
to mention you are using shared connections and only the app server
has an account with the database.

Right now I have a plan for keeping a field with a count...that gets
incremented when someone saves a change.  But before a save occurs,
the count is checked, and if it's not the same as when you opened the
page, that means someone else has saved in the mean time, and you can
inform the user that they need to refresh, and remake their changes.

Any better plan than this?

Lee

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





Links and Targets

2005-02-03 Thread gdeschen
Hi,

I'm very very discouraged with not being able to resolve this problem.

I do know that this is a WebSphere Studio Application Developer (WSAD) 
related problem but I have being searching the web for half a day now 
without any success. So I'm turning to you for help.

I have imported a project from a WebSphere Studio Application Developer 
(WSAD) version 5.1.0 to version 5.1.2 [with the latest fixpacks].

My problem is that I have perhaps 30% of my links and targets in the 
struts-config.xml as broken or target not resolved.
However the application executes without any problems.

How can I get WSAD to recognize that the links are valid?

Any insight would be greatly appreciated !
maestro

Re: format attribute of the Bean:Write tag

2005-01-20 Thread gdeschen
After waiting sometime for any suggestions I decided to download the 
source code and look at the format attribute of the Write tag.
String values are never formatted.

// Return String object as is.
if ( value instanceof java.lang.String ) {
return (String)value;
} else {
if ( value instanceof Number ) {
...
} else if (  value instanceof java.util.Date ) {


- Glenn





[EMAIL PROTECTED]
19/01/2005 12:38 PM
Please respond to Struts Users Mailing List




 
To: user@struts.apache.org
cc: 

Subject:format attribute of the Bean:Write tag
 Classification: 
 


Hi,

1.  I'd like to find some documentation on the possible values for format 
attribute of the Bean:Write tag.

2.  What I'd like to do is to convert to lowercase the property value 
during a Bean:Write.

TIA,
Glenn


format attribute of the Bean:Write tag

2005-01-19 Thread gdeschen
Hi,

1.  I'd like to find some documentation on the possible values for format 
attribute of the Bean:Write tag.

2.  What I'd like to do is to convert to lowercase the property value 
during a Bean:Write.

TIA,
Glenn

Multiple ImageButtonBeans

2004-10-13 Thread gdeschen
Greetings,

I have searched the lists for some time without any success.
I have a Session Form Bean (this is necessay to do a unit of work that 
spans many pages...)
On a page I have 3 ImageButtonBeans. Update, Cancel and Beneficiaries.

My problem arises in the Validate method of the Form.
In order to Update the user must have a beneficiary.
So the user tries to update and a message stating that a beneficiary is 
required.
The user then clicks on the Beneficiaries button... the validate method is 
executed...
and the Update button still has its X and Y values and the request fails 
the validation and the message is redisplayed.
This loop goes on...

I have tried to set the Update button to a new ImageButtonBean.. same 
problem
I have also tried to update the session Form bean after setting the Update 
button to a new ImageButtonBean with no luck.

How can I get around this situation?

TIA,
Glenn

Re: JSP / ActionForm / Action design quesetion

2004-07-27 Thread gdeschen
Non technical advice. :)

Since I've been doing Web applications for some years now, one of the most 
enduring processes is educating Users.
Web applications have many benefits as well as drawbacks, the User must 
understand the differences and accept them.
You cannot always do what the 3270 terminal application or a client/server 
application can do , you can be very very close!

But in the end the most diificult part is getting the User's to change 
their habit.
After doing things the same way for 10-15 yrs good luck! Often I take the 
time to review with the User the business process.
It is important to do it with the User, this way they get a sense of 
creating, participating with the Web application and end up being more 
receptive to changes.

In the end, Web applications sort of simplfy the process (as compared to 
client/server applications) and ultimately make applications easier to 
use.

- Glenn





Chuck Chopp [EMAIL PROTECTED]
Sent by: news [EMAIL PROTECTED]
26/07/2004 04:29 PM
Please respond to Struts Users Mailing List




 
To: [EMAIL PROTECTED]
cc: 

Subject:JSP / ActionForm / Action design quesetion
 Classification: 
 


I'm experimenting with putting a JSP / Struts front-end onto an existing 
green screen application on a midrange system.  I have JavaBeans that 
serve as wrappers around the underlying code that implements the business 
logic, which allows me  to divorce the legacy green screen terminal I/O 
interface routines from the business logic.  Now, however, I have to meet 
a 
requirement of the end-user and I'm too new at using Struts and JSPs to 
know 
for certain how to go about doing meeting the requirement.

In a nutshell, the green screen interface allow for rapid data entry, and 
the JSP front-end that I'm trying to build needs to allow for the same 
techniques to be used or else it will fail to meet the user's 
requirements. 
  Currently, a lot of of the data that gets entered is for fixed length 
fields, and when the data input results in one field being full, the focus 

automatically jumps to the next field as if the TAB key had been hit. When 

all of the fields of data have been entered, simply hitting the ENTER key 
results in the screen full of data fields being submitted, validated and 
then the screen is reset to empty field values again for additional data 

entry.  Most of the data is numeric and the data entry is done via the 
numeric keypad.

I need to know if it is possible to set up a JSP to work in the same way. 
Is it possible to set up a JSP such that quick data entry can be done with 

the focus automatically forwarding from one field to the next as the 
fields 
are filled up with fixed length data w/o having to hit the TAB key and 
with 
the ENTER key resulting in posting the form data to the applet?

I can already handle the ActionForm programming for data validation and 
the 
success/failure forwarding so that the successfully validated data is fed 
into the model and then the controller forwards back to the same JSP / 
ActionForm combination again for additional data entry.

I'm not sure if I can code things so that some other single keystroke can 
be 
used in place of clicking a CANCEL button on the form, such as hitting 
the 
ESC key and having that trigger an event in the JSP that is the same as 
clicking the CANCEL button.  In the green screen application, hitting 
ESC 
results in leaving the data entry screen and returning to a higher level 
menu.  I'd like to preserve as much of the legacy application's quick data 

entry functionality while putting a more modern web-enabled frontend onto 
the application.


TIA,

Chuck
-- 
Chuck Chopp

ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com

RTFM Consulting Services Inc. 864 801 2795 voice  voicemail
103 Autumn Hill Road  864 801 2774 fax
Greer, SC  29651

Do not send me unsolicited commercial email.


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





# anchor

2004-07-09 Thread gdeschen
Hi,

This is what I have defined:

action path=/Page type=PageAction parameter=/WEB-INF/page.jsp 
name=pageForm scope=request validate=false
   forward name=pageForm path=/WEB-INF/page.jsp
   /forward
/action

action path=/PageSubmit type=pageSubmitAction name=pageForm 
scope=request validate=true input=/Page.do
   forward name=cancel path=/Reports.do redirect=true 
contextRelative=false
   /forward
   forward name=submit redirect=false contextRelative=true 
path=/Page.do
   /forward
   forward name=printerVersion path=/WEB-INF/pagePrintableVersion.jsp 
contextRelative=false
   /forward
/action

What happens is that the Page.do allows a user to enter report parameters.
The PageSubmit.do builds the report and then returns the report to the 
Page.do.
Once here, the user has the report parameters at the top and the report 
under the parameters.

However, the user would like to have the page move down a little so the 
that the report section is more apparent.
I have tried to use the # anchor but keep getting page not found...

Any help is appreciated!
Glenn

RE: Session facade

2004-07-07 Thread gdeschen
my 2 cents...

I am using the Facade in my current project.

Firstly, just in case that EJBs will be introduced in subsequent phases.

Secondly, the DAO throws exceptions of DAOException  a FatalException.
Say that a Stored Procedure returns an application error (invalid 
parameter in a SP); this is treated as a DAOException.
Say that the DB is not there this is treated as a FatalException.

The Facade catches and interprets the DAOException with a Return Code.
Say that the DB is used to authenticate a User Id and Password.
The Facade is where the DAOException to translated into a simple Return 
Code that the Action will check for.

This a way the Action classes are nice a clean!
- Glenn





Ricardo Cortes [EMAIL PROTECTED]
07/07/2004 03:28 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:RE: Session facade
 Classification: 


I would assert you don't need the Session Facade as one of the advantages 
of the Session Facade is it's ability to abstract the low level operations 
of the Session EJBs from upper layers of your architecture.  You could 
probably have your actions talking to a Business Delegate layer or your 
DAO layer directly.  Of course, this is just one viewpoint.

-Original Message-
From: Zhang, Larry (L.) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 07, 2004 2:59 PM
To: Struts Users Mailing List
Subject: Session facade



 It seems session facade design pattern is becoming ubiquitous. My 
question is that 
 if we are not going to use EJB(but we do have DAO-data access object), 
does it still make sense to use session facade?

Thanks.

 

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




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





Spring or Tapestry Framework

2004-07-07 Thread gdeschen
I'd like to thank both Robert and Jim for yesterdays help with my Request 
bean is lost.
After a small 30 Km bike ride I decided to go with the hidden field to 
track the First time the page is accessed.
But I digress... Espresso time!

I decided to start another discussion...
I am in the process of converting a project using Hiberate and 
Spring or Tapestry?

TIA,
Glenn

Re: [OT] Session facade

2004-07-07 Thread gdeschen
:)

Perhaps I could have used Exceptions but well at least I use a Constant 
file a little better!
The more I think about the better it seems to get damn I have some 
code rewriting to do...

Thanks Bill.






Bill Siggelkow [EMAIL PROTECTED]
Sent by: news [EMAIL PROTECTED]
07/07/2004 04:10 PM
Please respond to Struts Users Mailing List




 
To: [EMAIL PROTECTED]
cc: 

Subject:Re: [OT] Session facade
 Classification: 


Glenn, I was with you until the part about the return code ... I think 
it would be better to translate the DAOException to some 
BusinessServiceException or something similar instead of a return code.
Generally, I try and avoid the method returns a -1 to indicate that the 
operation failed kind of thing -- it is so 'C' like :)

[EMAIL PROTECTED] wrote:

 my 2 cents...
 
 I am using the Facade in my current project.
 
 Firstly, just in case that EJBs will be introduced in subsequent phases.
 
 Secondly, the DAO throws exceptions of DAOException  a FatalException.
 Say that a Stored Procedure returns an application error (invalid 
 parameter in a SP); this is treated as a DAOException.
 Say that the DB is not there this is treated as a FatalException.
 
 The Facade catches and interprets the DAOException with a Return Code.
 Say that the DB is used to authenticate a User Id and Password.
 The Facade is where the DAOException to translated into a simple Return 
 Code that the Action will check for.
 
 This a way the Action classes are nice a clean!
 - Glenn
 
 
 
 
 
 Ricardo Cortes [EMAIL PROTECTED]
 07/07/2004 03:28 PM
 Please respond to Struts Users Mailing List
 
 
 
 
 
 To: Struts Users Mailing List [EMAIL PROTECTED]
 cc: 
 
 Subject:RE: Session facade
  Classification: 
 
 
 I would assert you don't need the Session Facade as one of the 
advantages 
 of the Session Facade is it's ability to abstract the low level 
operations 
 of the Session EJBs from upper layers of your architecture.  You could 
 probably have your actions talking to a Business Delegate layer or your 
 DAO layer directly.  Of course, this is just one viewpoint.
 
 -Original Message-
 From: Zhang, Larry (L.) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 07, 2004 2:59 PM
 To: Struts Users Mailing List
 Subject: Session facade
 
 
 
  It seems session facade design pattern is becoming ubiquitous. My 
 question is that 
  if we are not going to use EJB(but we do have DAO-data access object), 
 does it still make sense to use session facade?
 
 Thanks.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 


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





RE: [OT] Session facade

2004-07-07 Thread gdeschen
Well. In my case I used the Facade pattern without the Session.
I did have a discussion with a friend as to determine if it is closer to a 
 Delegate or a Facade.
Facade... eventhough it does not adhere to the J2EE Pattern 100%.





Matthias Wessendorf [EMAIL PROTECTED]
07/07/2004 04:45 PM
Please respond to Struts Users Mailing List




 
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
cc: 

Subject:RE: [OT] Session facade
 Classification: 


yes it should be a SessionEJB

however, if you are new to EJB

look here, for generating EJBs
http://xdoclet.sf.net
and a Xdoclet-Petstore-Sample
http://xpetstore.sf.net




and Struts and EJBs
http://developers.sun.com/events/techdays/codecamps/

THE LINK:
Struts and Core J2EE Patterns Together Demo



and
https://strutsejb.dev.java.net/



i guess... now you have stuff...

:-)

cheers,

PS: J2EE-Patterns-Book is great!

Matthias


 However, before the discussion goes far from what I initially 
 wanted, let me ask you this: is your Facade the same as my 
 Session Facade? I am reading 
 http://java.sun.com/blueprints/corej2eepatterns/Patterns/Sessi
 onFacade.html, and I think Session Facade itself should be a 
 session EJB, right?
 
 
 -Original Message-
 From: klute [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 07, 2004 4:34 PM
 To: Struts Users Mailing List
 Subject: Re: [OT] Session facade
 
 
 Agree with Bill here. Also... the Constants file is
 (or can be) quite 'C' as well. There is a temptation
 to put all of your constants in one place and before
 you know you end up putting all of your constants
 encountered within your app there. So totally
 unrelated stuff gets piled up into one place :-)
 
 
 
 
 --- [EMAIL PROTECTED] wrote:
  :)
  
  Perhaps I could have used Exceptions but well at
  least I use a Constant
  file a little better!
  The more I think about the better it seems to
  get damn I have some 
  code rewriting to do...
  
  Thanks Bill.
  
  
  
  
  
  
  Bill Siggelkow [EMAIL PROTECTED]
  Sent by: news [EMAIL PROTECTED]
  07/07/2004 04:10 PM
  Please respond to Struts Users Mailing List
  
  
  
  
  
  To: [EMAIL PROTECTED]
  cc:
  
  Subject:Re: [OT] Session facade
   Classification:
  
  
  Glenn, I was with you until the part about the
  return code ... I think
  it would be better to translate the DAOException to
  some 
  BusinessServiceException or something similar
  instead of a return code.
  Generally, I try and avoid the method returns a -1
  to indicate that the 
  operation failed kind of thing -- it is so 'C' like
  :)
  
  [EMAIL PROTECTED] wrote:
  
   my 2 cents...
   
   I am using the Facade in my current project.
   
   Firstly, just in case that EJBs will be introduced
  in subsequent phases.
   
   Secondly, the DAO throws exceptions of
  DAOException  a FatalException.
   Say that a Stored Procedure returns an application
  error (invalid
   parameter in a SP); this is treated as a
  DAOException.
   Say that the DB is not there this is treated as a
  FatalException.
   
   The Facade catches and interprets the DAOException
  with a Return Code.
   Say that the DB is used to authenticate a User Id
  and Password.
   The Facade is where the DAOException to translated
  into a simple Return
   Code that the Action will check for.
   
   This a way the Action classes are nice a clean!
   - Glenn
   
   
   
   
   
   Ricardo Cortes [EMAIL PROTECTED]
   07/07/2004 03:28 PM
   Please respond to Struts Users Mailing List
   
   
   
   
   
   To: Struts Users Mailing List
  [EMAIL PROTECTED]
   cc:
   
   Subject:RE: Session facade
Classification:
   
   
   I would assert you don't need the Session Facade
  as one of the
  advantages 
   of the Session Facade is it's ability to abstract
  the low level
  operations 
   of the Session EJBs from upper layers of your
  architecture.  You could
   probably have your actions talking to a Business
  Delegate layer or your
   DAO layer directly.  Of course, this is just one
  viewpoint.
   
   -Original Message-
   From: Zhang, Larry (L.) [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, July 07, 2004 2:59 PM
   To: Struts Users Mailing List
   Subject: Session facade
   
   
   
It seems session facade design pattern is
  becoming ubiquitous. My
   question is that
if we are not going to use EJB(but we do have
  DAO-data access object),
   does it still make sense to use session facade?
   
   Thanks.
   
   
   
  
 
 -
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
   
   
   
   
  
 
 -
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
   
   
   
   
  
  
 
 

Re: Form bean scope question

2004-07-06 Thread gdeschen
I have had a problem like this before and what I did is add the
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
in the included/inserted jsp pages.

HTH,
Glenn






John Moore [EMAIL PROTECTED]
06/07/2004 06:24 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:Re: Form bean scope question
 Classification: 


Mark Lowe wrote:

 You may have stuff configured to process such requests but an out the 
 box version of struts would probably need

 html:form action=/Purchase.do ..

 to find a mapping such as

 action path=/Purchase ..

Yes, I do. It's actually all working perfectly, the only problem I'm 
having is when I try to factor out the common HTML, as I mentioned.

John


-- 
==
John Moore - Norwich, UK - [EMAIL PROTECTED]
==

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





Request bean is lost

2004-07-06 Thread gdeschen
Greetings,

I have an action Page.do that gets 3 lists from a database.
It then places the lists inside a bean which is set in the request.
The Page.jsp iterates thru the bean to display the data.

The form is posted to the PageSubmit.do.
But before the PageForm.validate() is executed.
Assume that an error is found...
The response is returned 

And this is where my bean is lost.
Why?

I do not want to store thr bean in the HTTP Session.

TIA,
Glenn.

RE: Request bean is lost

2004-07-06 Thread gdeschen
My lists are specific to each user based on security attributes obtained 
from the database.
Therefore, the application scope solution is not acceptable for these 
lists.

If I go the first solution route, then I have my 3 Lists as part of the 
Form bean.
The user selects from the list and submits the data.
If I set the imput to /Page.do wouldn't I lose the user's input?

- Glenn





Robert Taylor [EMAIL PROTECTED]
06/07/2004 02:39 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:RE: Request bean is lost
 Classification: 


One solution is to point the input attribute value of the PageSubmit.do 
action mapping
to the Page.do action mapping thus re-retrieving the lists before 
displaying the page.

An alternative solution is to override the reset() of your action form so 
that it
retrieves the lists from the database and places them in the appropriate 
scope.

If the lists are composed of static data, you might consider retrieving 
them on 
application start up and placing them in application scope 
(ServletContext) where
they will be available to all requests and then there would be no need to 
retrieve
them each time the page is displayed.

robert

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 06, 2004 1:39 PM
 To: [EMAIL PROTECTED]
 Subject: Request bean is lost
 
 
 Greetings,
 
 I have an action Page.do that gets 3 lists from a database.
 It then places the lists inside a bean which is set in the request.
 The Page.jsp iterates thru the bean to display the data.
 
 The form is posted to the PageSubmit.do.
 But before the PageForm.validate() is executed.
 Assume that an error is found...
 The response is returned 
 
 And this is where my bean is lost.
 Why?
 
 I do not want to store thr bean in the HTTP Session.
 
 TIA,
 Glenn.

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





RE: Request bean is lost

2004-07-06 Thread gdeschen
Umh...
Let me try to express myself more clearly!

Page.do
-
My Page.do obtains 3 lists from the DB based on the user's security 
attributes.
Default values are set for 2 of the lists such as month and year.
All of this is done in the Form Bean.


PageSubmit.do
---
The user selects a diffierent month other than the default and submits the 
request to PageSubmit.do

The input for the PageSubmit.do mapping is /Page.do
So this means that all of the Page.do logic is done again?
Won't this overwrite what the user has entered?






Jim Barrows [EMAIL PROTECTED]
06/07/2004 04:16 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:RE: Request bean is lost
 Classification: 




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 06, 2004 1:04 PM
 To: Struts Users Mailing List
 Subject: RE: Request bean is lost
 
 
 My lists are specific to each user based on security 
 attributes obtained 
 from the database.
 Therefore, the application scope solution is not acceptable for these 
 lists.
 
 If I go the first solution route, then I have my 3 Lists as 
 part of the 
 Form bean.
 The user selects from the list and submits the data.
 If I set the imput to /Page.do wouldn't I lose the user's input?

No, the input param in struts-config.xml is expressly used for the case 
where validation fails.  So you 
won't lose anything.

 
 - Glenn
 
 
 
 
 
 Robert Taylor [EMAIL PROTECTED]
 06/07/2004 02:39 PM
 Please respond to Struts Users Mailing List
 
 
 
 
 
 To: Struts Users Mailing List [EMAIL PROTECTED]
 cc: 
 
 Subject:RE: Request bean is lost
  Classification: 
 
 
 One solution is to point the input attribute value of the 
 PageSubmit.do 
 action mapping
 to the Page.do action mapping thus re-retrieving the lists before 
 displaying the page.
 
 An alternative solution is to override the reset() of your 
 action form so 
 that it
 retrieves the lists from the database and places them in the 
 appropriate 
 scope.
 
 If the lists are composed of static data, you might consider 
 retrieving 
 them on 
 application start up and placing them in application scope 
 (ServletContext) where
 they will be available to all requests and then there would 
 be no need to 
 retrieve
 them each time the page is displayed.
 
 robert
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 06, 2004 1:39 PM
  To: [EMAIL PROTECTED]
  Subject: Request bean is lost
  
  
  Greetings,
  
  I have an action Page.do that gets 3 lists from a database.
  It then places the lists inside a bean which is set in the request.
  The Page.jsp iterates thru the bean to display the data.
  
  The form is posted to the PageSubmit.do.
  But before the PageForm.validate() is executed.
  Assume that an error is found...
  The response is returned 
  
  And this is where my bean is lost.
  Why?
  
  I do not want to store thr bean in the HTTP Session.
  
  TIA,
  Glenn.
 
 -
 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: Request bean is lost

2004-07-06 Thread gdeschen
Exactly.

My Page.do has as a parameter the jsp page along with its Form Bean.
So it will get overwritten.

Now what is the best clearest way to get this done?
Must I absolutely use a Session Bean to maintain the List and the Form 
Bean for the user inputted data?





Jim Barrows [EMAIL PROTECTED]
06/07/2004 04:28 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:RE: Request bean is lost
 Classification: 




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 06, 2004 1:23 PM
 To: Struts Users Mailing List
 Subject: RE: Request bean is lost
 
 
 Umh...
 Let me try to express myself more clearly!
 
 Page.do
 -
 My Page.do obtains 3 lists from the DB based on the user's security 
 attributes.
 Default values are set for 2 of the lists such as month and year.
 All of this is done in the Form Bean.
 
 
 PageSubmit.do
 ---
 The user selects a diffierent month other than the default 
 and submits the 
 request to PageSubmit.do
 
 The input for the PageSubmit.do mapping is /Page.do
 So this means that all of the Page.do logic is done again?
 Won't this overwrite what the user has entered?

It shouldn't... unless you are overwriting those fields in page.do 
explicitly.
Basically what's happening is right after the user hits submit, struts 
creates a form bean ( or uses an existing one), fills it from the form, 
then validates it.  At that point, if there is a problem it forwards to 
the input param, without changing the form bean.  In the case of the 
action, it doesn't even know when or where the form bean was created.  It 
just does it's thing quite merrily, then hands of to your code.


 
 
 
 
 
 
 Jim Barrows [EMAIL PROTECTED]
 06/07/2004 04:16 PM
 Please respond to Struts Users Mailing List
 
 
 
 
 
 To: Struts Users Mailing List [EMAIL PROTECTED]
 cc: 
 
 Subject:RE: Request bean is lost
  Classification: 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 06, 2004 1:04 PM
  To: Struts Users Mailing List
  Subject: RE: Request bean is lost
  
  
  My lists are specific to each user based on security 
  attributes obtained 
  from the database.
  Therefore, the application scope solution is not acceptable 
 for these 
  lists.
  
  If I go the first solution route, then I have my 3 Lists as 
  part of the 
  Form bean.
  The user selects from the list and submits the data.
  If I set the imput to /Page.do wouldn't I lose the user's input?
 
 No, the input param in struts-config.xml is expressly used 
 for the case 
 where validation fails.  So you 
 won't lose anything.
 
  
  - Glenn
  
  
  
  
  
  Robert Taylor [EMAIL PROTECTED]
  06/07/2004 02:39 PM
  Please respond to Struts Users Mailing List
  
  
  
  
  
  To: Struts Users Mailing List [EMAIL PROTECTED]
  cc: 
  
  Subject:RE: Request bean is lost
   Classification: 
  
  
  One solution is to point the input attribute value of the 
  PageSubmit.do 
  action mapping
  to the Page.do action mapping thus re-retrieving the lists before 
  displaying the page.
  
  An alternative solution is to override the reset() of your 
  action form so 
  that it
  retrieves the lists from the database and places them in the 
  appropriate 
  scope.
  
  If the lists are composed of static data, you might consider 
  retrieving 
  them on 
  application start up and placing them in application scope 
  (ServletContext) where
  they will be available to all requests and then there would 
  be no need to 
  retrieve
  them each time the page is displayed.
  
  robert
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, July 06, 2004 1:39 PM
   To: [EMAIL PROTECTED]
   Subject: Request bean is lost
   
   
   Greetings,
   
   I have an action Page.do that gets 3 lists from a database.
   It then places the lists inside a bean which is set in 
 the request.
   The Page.jsp iterates thru the bean to display the data.
   
   The form is posted to the PageSubmit.do.
   But before the PageForm.validate() is executed.
   Assume that an error is found...
   The response is returned 
   
   And this is where my bean is lost.
   Why?
   
   I do not want to store thr bean in the HTTP Session.
   
   TIA,
   Glenn.
  
  
 -
  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: 

RE: Request bean is lost

2004-07-06 Thread gdeschen
:)

I was just contemplating while browsing the code...
Getting the the data from the DB requires lots of work such as setting a 
Transfer Object, calling a Facade and the error handling should the DB 
return an error.

If this still out weighs the use of a Session Bean then so be it I will 
code it.
Using a hidden value to indicate the first time is also an option.





Robert Taylor [EMAIL PROTECTED]
06/07/2004 04:40 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:RE: Request bean is lost
 Classification: 


Let me clarify the last statement:

Page.do will write over any input values to which it is
programmed to write. 

...more eloquently stated by Jim

It shouldn't... unless you are overwriting those fields in page.do 
explicitly.

robert

 -Original Message-
 From: Robert Taylor [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 06, 2004 4:37 PM
 To: Struts Users Mailing List
 Subject: RE: Request bean is lost
 
 
 Yes, it will write over any input values...
 
 In this case, you might want to consider populating
 the lists in the forms.reset() as mentioned earlier.
 
 ...not my prefered approach as it puts business logic
 in the form; its more of a work around.
 
 
 robert
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 06, 2004 4:23 PM
  To: Struts Users Mailing List
  Subject: RE: Request bean is lost
  
  
  Umh...
  Let me try to express myself more clearly!
  
  Page.do
  -
  My Page.do obtains 3 lists from the DB based on the user's security 
  attributes.
  Default values are set for 2 of the lists such as month and year.
  All of this is done in the Form Bean.
  
  
  PageSubmit.do
  ---
  The user selects a diffierent month other than the default and submits 
the 
  request to PageSubmit.do
  
  The input for the PageSubmit.do mapping is /Page.do
  So this means that all of the Page.do logic is done again?
  Won't this overwrite what the user has entered?
  
  
  
  
  
  
  Jim Barrows [EMAIL PROTECTED]
  06/07/2004 04:16 PM
  Please respond to Struts Users Mailing List
  
  
  
  
  
  To: Struts Users Mailing List [EMAIL PROTECTED]
  cc: 
  
  Subject:RE: Request bean is lost
   Classification: 
  
  
  
  
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, July 06, 2004 1:04 PM
   To: Struts Users Mailing List
   Subject: RE: Request bean is lost
   
   
   My lists are specific to each user based on security 
   attributes obtained 
   from the database.
   Therefore, the application scope solution is not acceptable for 
these 
   lists.
   
   If I go the first solution route, then I have my 3 Lists as 
   part of the 
   Form bean.
   The user selects from the list and submits the data.
   If I set the imput to /Page.do wouldn't I lose the user's input?
  
  No, the input param in struts-config.xml is expressly used for the 
case 
  where validation fails.  So you 
  won't lose anything.
  
   
   - Glenn
   
   
   
   
   
   Robert Taylor [EMAIL PROTECTED]
   06/07/2004 02:39 PM
   Please respond to Struts Users Mailing List
   
   
   
   
   
   To: Struts Users Mailing List [EMAIL PROTECTED]
   cc: 
   
   Subject:RE: Request bean is lost
Classification: 
   
   
   One solution is to point the input attribute value of the 
   PageSubmit.do 
   action mapping
   to the Page.do action mapping thus re-retrieving the lists before 
   displaying the page.
   
   An alternative solution is to override the reset() of your 
   action form so 
   that it
   retrieves the lists from the database and places them in the 
   appropriate 
   scope.
   
   If the lists are composed of static data, you might consider 
   retrieving 
   them on 
   application start up and placing them in application scope 
   (ServletContext) where
   they will be available to all requests and then there would 
   be no need to 
   retrieve
   them each time the page is displayed.
   
   robert
   
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 06, 2004 1:39 PM
To: [EMAIL PROTECTED]
Subject: Request bean is lost


Greetings,

I have an action Page.do that gets 3 lists from a database.
It then places the lists inside a bean which is set in the 
request.
The Page.jsp iterates thru the bean to display the data.

The form is posted to the PageSubmit.do.
But before the PageForm.validate() is executed.
Assume that an error is found...
The response is returned 

And this is where my bean is lost.
Why?

I do not want to store thr bean in the HTTP Session.

TIA,
Glenn.
   
   
-
   To 

Message Resources Confusion

2004-07-05 Thread gdeschen
Greetings,

I am somewhat unclear with the Message Resources.

I have defined in my struts-config:
message-resources parameter=app.resources.ApplicationResources/
message-resources parameter=app.resources.SystemErrors 
key=systemErrors/

In my Action class I have the following code:
if (getSPName() == null) {
MessageResources errorMessages = (MessageResources) 
request.getAttribute(Globals.MESSAGES_KEY);
String errorMessage = 
errorMessages.getMessage(errors.invalid.SPName);

logger.error(errorMessage);

errors.add(ActionErrors.GLOBAL_MESSAGE, new 
ActionMessage(errors.9000));
saveErrors(request, errors);
return 
mapping.findForward(errorMessages.getMessage(forward.systemError));
}

Question 1:
Does the request.getAttribute(Globals.MESSAGES_KEY) load the keys of both 
resources found in the struts-config?
The message with the key (errors.invalid.SPName) returns a null.

Question 2:
If I code it this way the message found.
MessageResources errorMessages = this.getResources(request, 
systemErrors);


Any help explaining this is appreciated.

TIA,
Glenn

ServletContextListener

2004-06-16 Thread gdeschen
Greetings,

I have created a ServletContextListener that sets a Bean in the 
application scope.
This Bean contains 2 list of Months... and these lists contain 
LabelValueBeans.

My uncertainty is on the best way to get my JSP to use the appropriate 
List depending on the locale.

JSP code:
html:select property=toMonth styleClass=dropdowns
   html:optionsCollection name=ApplicationBean property=months 
label=label value=value/
/html:select


Option One:
Do I pass as a parameter to the months method the Locale?

Any other suggestions would be appreciated. :)
- Glenn

Re: ServletContextListener

2004-06-16 Thread gdeschen
My apologies for being unclear...
Yes the Bean has one method called getMonths()...
and in this method I will return the appropriate months based on the 
locale.

It is just that getting/passing the Locale to the getMonths() in a JSP is 
not really elegant.

JSP code:
html:select property=toMonth styleClass=dropdowns
   html:optionsCollection name=ApplicationBean property=months(foo) 
label=label value=value/
/html:select

And wondering if there are other options...

- Glenn





mike [EMAIL PROTECTED]
16/06/2004 03:25 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED], 
[EMAIL PROTECTED]
cc: 

Subject:Re: ServletContextListener


At 12:13 PM 6/16/2004, [EMAIL PROTECTED] wrote:
Greetings,

I have created a ServletContextListener that sets a Bean in the
application scope.
This Bean contains 2 list of Months... and these lists contain
LabelValueBeans.

My uncertainty is on the best way to get my JSP to use the appropriate
List depending on the locale.

JSP code:
Option One: Do I pass as a parameter to the months method the Locale? Any 

other suggestions would be appreciated. :) - Glenn

What months method?  I assume you mean that your bean has some method 
called getMonths()?

If so, there is clearly a problem making the method getMonths(Locale 
locale) with a bean.  If you have only two locales, then you might want to 

do the otherwise dumb thing and use two methods which are chosen depending 

on the locale, e.g.:


if(locale == ?) {
  bean.getMonthLocaleA();
} else {
  bean.getMonthLocaleB();
}

This helpful?

Michael




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





Re: ServletContextListener

2004-06-16 Thread gdeschen
Sure, my idea of using a Bean in the application scope is to not have to 
do the creation of the List of months in every Action class and just 
reference the Bean in the application scope from the JSP page..

So I guess that the Action class can obtain the Months from the Bean in 
the application scope and create a new bean in the request scope (and this 
bean will be in the appropriate language).

- Glenn
.




mike [EMAIL PROTECTED]
16/06/2004 03:56 PM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED], Struts Users 
Mailing List [EMAIL PROTECTED]
cc: 

Subject:Re: ServletContextListener


You are using struts so, instead of calling a jsp page for the response, 
call an action class that sets an appropriate months in the request 
scope 
and forwards to your jsp page and then just call the correct months from 

request scope in the jsp page.

At 12:47 PM 6/16/2004, [EMAIL PROTECTED] wrote:
My apologies for being unclear...
Yes the Bean has one method called getMonths()...
and in this method I will return the appropriate months based on the
locale.

It is just that getting/passing the Locale to the getMonths() in a JSP is
not really elegant.

JSP code:
And wondering if there are other options... - Glenn mike 16/06/2004 03:25 

PM Please respond to Struts Users Mailing List To: Struts Users 
Mailing 
List , [EMAIL PROTECTED] cc: Subject: Re: ServletContextListener At 

12:13 PM 6/16/2004, [EMAIL PROTECTED] wrote: Greetings,  I have 

created a ServletContextListener that sets a Bean in the application 
scope. This Bean contains 2 list of Months... and these lists 
contain LabelValueBeans.  My uncertainty is on the best way to get my 
JSP to use the appropriate List depending on the locale.  JSP 
code: Option One: Do I pass as a parameter to the months method the 
Locale? Any other suggestions would be appreciated. :) - Glenn What 
months method? I assume you mean that your bean has some method called 
getMonths()? If so, there is clearly a problem making the method 
getMonths(Locale locale) with a bean. If you have only two locales, then 
you might want to do the otherwise dumb thing and use two methods which 
are chosen depending on the locale, e.g.: if(locale == ?) { 
bean.getMonthLocaleA(); } else { bean.getMonthLocaleB(); } This helpful? 
Michael 
- 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]





One Forward Action Multiple JSPs

2004-06-03 Thread gdeschen
Greetings,

What I would like to do is to be able to display different JSPs for the 
same ForwardAction.

I now have this:
action path=/TermsAndConditions
type=org.apache.struts.actions.ForwardAction
parameter=/WEB-INF/secure/credentials/termsAndConditions.jsp
/action

What I would like is based on the Locale show a different JSP.
I cannot use the i18n for this with resource bundles since the page 
contains lots of text and the format is different for both languages.

So if I create my own ForwardAction 
(secure.credentials.TermsAndConditionsForwardAction) how would I set the 
parameter value to either
/WEB-INF/secure/credentials/termsAndConditions_en.jsp
or
/WEB-INF/secure/credentials/termsAndConditions_fr.jsp

Is this the best way to go about or are there other suggestions?

TIA,
Glenn.

Re: Undeliverable Message

2004-05-28 Thread gdeschen
Yes so do I.





Henrique VIECILI [EMAIL PROTECTED]
05/28/2004 09:00 AM
Please respond to Struts Users Mailing List




 
To: Struts Users Mailing List [EMAIL PROTECTED]
cc: 

Subject:Undeliverable Message


Hi all,
 
every time I send a message to the [EMAIL PROTECTED] I receive the message bellow. I´d 
like to know if you guys are receiving 
this message too.
 
Regards,
 
Henrique Viecili
 
 
- Original Message - 
From: System Administrator 
To: viecili 
Sent: Friday, May 28, 2004 8:53 AM
Subject: Undeliverable:Re: html:options only with bean?

Your message

  To:  Struts Users Mailing List
  Subject: Re: html:options only with bean?
  Sent:Fri, 28 May 2004 08:46:29 -0300

did not reach the following recipient(s):

[EMAIL PROTECTED] on Fri, 28 May 2004 08:55:14 -0300
The e-mail account does not exist at the organization this message
was sent to.  Check the e-mail address, or contact the recipient
directly to find out the correct address.
asterix.rave-tech.com #5.1.1

- Message from viecili [EMAIL PROTECTED] on Fri, 28 May 2004 
08:46:29 -0300 -
To:
Struts Users Mailing List [EMAIL PROTECTED]
Subject:
Re: html:options only with bean?
Hi Samuel,

let´s suppose in your form you have the method getArrayListValues() 
returning the ArrayList containing the values and the method 
getArrayListLabels() returning the ArrayList containing the values for 
each option you wanna render. Then:

html:form action=data focus=identification
html:text property=identification/
html:select property=selectedItem !-- selectedItem must be a 
single-valued property --
html:options property=arrayListValues labelProperty=arrayListLabels/
/html:select
/html:form

I think it will work, but you can try this too: (I´m not sure it works)

struts-config.xml
form-bean name=myForm type=my.pkg.MyForm/

in MyForm there is a method (getValuesAndLabels()) returning a collection 
containing beans holding the label (getLabel()) and value (getValue()) for 
each option. Then:

html:options collection=myForm.valuesAndLabels property=value 
labelProperty=label /, or maybe:
html-el:options collection=${myForm.valuesAndLabels} property=value 
labelProperty=label

Just thoughts,

Henrique Viecili



  - Original Message -
  From: Samuel Rochas
  To: Struts Users Mailing List
  Sent: Thursday, May 27, 2004 6:58 PM
  Subject: html:options only with bean?


  Hello there,

  I am able to create a html select with struts when the collection to
  display in the options tag is a collection stored in the session or
  request and to use the selected value for my form. Fine.

  But now I have a Form representing a bean. This form has an attribute of
  type ArrayList. I'd like the select/options tag to show me the content
  of the ArrayList for the actual Form property value. I want to use the
  form attribute and not create a collection to store in a scope.

  My JSP looks like:
  html:form action=data focus=identification
  html:text property=identification/
  html:select property=selectedItems
  html:options collections=allItems
  property=id labelProperty=description/
  /html:select

  My form DataForm has the attributes identification, selectedItems and
  allItems.

  But it is not working. Anybody a hint?

  Sincerly
  Samuel

  ---  andinasoft SA - Software y Consulting  ---
  Mariano Aguilera 276 y Almagro - Quito, Ecuador
  Tel. +593 2 290 55 18  Cel. +593 9 946 4046
  -  http://www.andinasoft.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]



Submit Design Question

2004-05-25 Thread gdeschen
Hi,

I have an application that permits a user to view and update Contact 
information.
/app/Contact (gets data from the DB) -- posts to -- /app/ContactSubmit 
(updates the data after validation)

I would like to ensure that the application is solid and executes smoothly 
(doesn't eveyone!). ;

Question 1:
-
Is the above process a valid one?
Or should the GET and POST be done with the same URI such as 
(/app/Contact).

Question 2:

I would like to prevent any processing or errors if someone enters the 
/app/ContactSubmit URI in a browser address.
One way to do so is the check the HTTP request for a GET in the Action 
class... and if found show an error page...
Any other suggestions?

TIA,
Glenn. 

Re: Logic Tags using OR

2004-05-25 Thread gdeschen
Hi,

The logic:equal can only used to test against one value.

Perhaps in your example you can us something like:
logic:greaterThan name=user property=key value=1
   ...do this
/logic:greaterThan

- Glenn





Ciaran Hanley [EMAIL PROTECTED]
25/05/2004 03:15 PM
Please respond to Struts Users Mailing List




 
To: Struts User Mailing List [EMAIL PROTECTED]
cc: 

Subject:Logic Tags using OR


Can the struts logic tags be used to perform OR Logic?

 

For example instead of 

 

logic:equal name=user property=key value=1

  ...do this

/logic:equal

logic:equal name=user property=key value=2

  ...do this

/logic:equal

logic:equal name=user property=key value=3

  ...do this

/logic:equal

 

 

logic:equal name=user property=key value=1 OR 2 OR 3

  ...do this

/logic:equal

 

Any ideas anybody?

 

Thanks

CH





Message Resources

2004-05-21 Thread gdeschen
Greetings,

The following code snippet is from my ActionForm.validate() method.
What I don't like and wonder if there is a better way to this: is the 
loading of the Message Resources.
I need to do this to get a value that is passed as a parameter to a 
message.

private static MessageResources messages = 
MessageResources.getMessageResources(resources.ApplicationResources);

errors.add(ActionErrors.GLOBAL_ERROR, new 
ActionMessage(errors.general.alphabetic.required, 
messages.getMessage(hrOnlineLocale.getLocaleLocale(), 
label.first.name)));

Is there a better way to do this?

TIA,
Glenn

FormBean Irregularities

2004-05-20 Thread gdeschen
Hi,

I am having a problem with a JSP not displaying the latest ActionForm 
data.

A very light use case:
-
The application is simple; a user views their Contact information.
The user can change the information and save it.

The application does the following:
--
1 Gets the user's Contact information from the DB including a TimeStamp
2 Validates any changes and then updates the information in the DB
3 Finally, the application gets the user's Contact information again to 
obtain the latest TimeStamp (for technical difficulties the latest 
TimeStamp cannot be returned during a update).

Problem:
--
In step 3 above, the latest data is never shown; only the data that was 
entered by the user is what is shown. I discovered this due to the 
TimeStamp not changing?

Details:

Here are some details:
action-mappings
action path=/Contact
   type=secure.contact.ContactAction
   parameter=/WEB-NF/secure/contact/contact.jsp
   name=contactForm
   scope=request
   validate=false
   forward name=contactForm
  path=secure/ContactForm
  contextRelative=false
   /forward
   forward name=contactPrintableVersionForm
  path=secure/ContactPrintableVersionForm
  contextRelative=false
   /forward
/action

action path=/ContactForm
   parameter=/WEB-INF/secure/contact/contact.jsp
   type=org.apache.struts.actions.ForwardAction
   name=contactForm
   scope=request
   validate=false
/action

action path=/ContactSubmit
   type=secure.contact.contactSubmitAction
   input=/WEB-INF/secure/contact/contact.jsp
   name=contactForm
   scope=request
   validate=true
   forward name=cancel
  path=MyData
  contextRelative=true
  redirect=true
   /forward
   forward
  name=update
  path=secure/Contact
  contextRelative=false
  redirect=false
   /forward
/action

action path=/ContactPrintableVersionForm
   type=org.apache.struts.actions.ForwardAction
   parameter=/WEB-INF/secure/contact/contactPrintableVersion.jsp
   name=contactForm
   scope=request
   validate=false
/action
/action-mappings
action-mappings

ContactForm.java
--
package secure.contact;

import ..

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionServlet;
import org.apache.struts.util.ImageButtonBean;
import org.apache.struts.util.MessageResources;

public class ContactForm extends ActionForm {

   private ImageButtonBean cancelButton = new ImageButtonBean();
   private String firstName = null;
   private String timeStamp = null;
   private String token = null;
   private ImageButtonBean updateButton = new ImageButtonBean();

 
   public void reset(ActionMapping mapping,
 HttpServletRequest request) {
   }

   public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {

  ActionErrors errors = new ActionErrors();

  HttpSession httpSession = request.getSession();
  OnlineVO onlineVO = (OnlineVO) httpSession.getAttribute(OnlineVO);

  // Get the user's locale
  OnlineLocale onlineLocale = new OnlineLocale(request);

  // Exit if the Cancel button is clicked?
  if (getCancelButton().isSelected()) {
 httpSession.removeAttribute(contactBean);
 return errors;
  }

  // First Name is required and must only be composed of alphabetic 
characters
  if (getFirstName().trim() == null || getFirstName().trim().length() 
 1) {
 errors.add(firstName, new 
ActionError(errors.general.alphabetic.required, 
messages.getMessage(onlineLocale.getLocaleLocale(), label.first.name)));
  }

  public String getFirstName() {
 return firstName;
  }

  public String getTimeStamp() {
 return timeStamp;
  }

  public void setTimeStamp(String string) {
 timeStamp = string;
  }

  public ImageButtonBean getCancelButton() {
 return cancelButton;
  }

  public ImageButtonBean getUpdateButton() {
 return updateButton;
  }

  public void setCancelButton(ImageButtonBean bean) {
 cancelButton = bean;
  }

  public void setUpdateButton(ImageButtonBean bean) {
 updateButton = bean;
  }

  public String getToken() {
 return token;
  }

  public void setToken(String string) {
  token = string;
   }

}


ContactAction.java
--
package secure.contact;

import ..

import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import