RE: Indexed properties...setters and getters

2002-01-17 Thread Rey Francois


What are the methods on your form bean? Are they public? It may help to see
your code.

Fr.

-Original Message-
From: Tom Goemaes [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2002 09:34
To: Struts Users Mailing List
Subject: Re: Indexed properties...setters and getters


Is the indexed feature supported in 1.0.1 ? don't think so... not sure.
Use the nightly builds.


 "Struts Users Mailing List" <[EMAIL PROTECTED]> wrote:


>If I have a html:text field on my form with the property named table[5].min
>imumSales, wouldn't this result in:
>
>1) A getTable(5).getMinimumSales() for displaying the form
>2) A getTable(5).setMinimumSales(data) for posting the form through an 
>Action class
>
>I am not seeing this behavior at all in my web application and I am using 
>the Struts 1.0.1 release. Any ideas? Any suggestions on how to debug this?
>
>Thanks,
>Todd Harney
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>



--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Subclassing ActionMapping

2002-01-16 Thread Rey Francois

Typically you would derive it in order to add a new property, which value
can be set in the struts-config.xml (as Ted described in his post). This
property can be used for example to control the logic of
ActionForm.validate() or of Action.perform(): both are given the
ActionMapping instance as parameter and thus can access this extra property.
That would be a nice way to integrate a validation framework: this extra
property can specify which validation logic to use.

Fr.

-Original Message-
From: Mark Woon [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2002 01:15
To: Struts Users Mailing List
Subject: Re: Subclassing ActionMapping


Ted Husted wrote:

> You can create your own ActionMapping subclass, and specify that in the
> web.xml.
>
> If it uses additional methods, you would type-cast the mapping in the
> perform to access those, just as you type-case the ActionForm to get to
> its extended properties.
>
> To set new properties on the ActionMapping subclass, you can use the
> Digester syntax:
>
> 
>
> to avoid touching the struts-config syntax.

You know, I've never really understood what to do with the ActionMapping
objects.
Maybe that's because I absolutely don't need to touch it, like I don't need
to
touch ActionServer, but it kinda nags at me.

So, why/when would I want to subclass ActionMapping?

Thanks,
-Mark


--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with mapped properties

2002-01-15 Thread Rey Francois

I'm not really sure in understand you problem but in order for
"property(key)" to work, you need to have the following methods on your form
bean:

  public Object getProperty(String key)
  public void setProperty(String key, Object value)

These methods typically store your property values in a map of some sort.
For example, if you had the following on your form bean:

  public Object getAddress(String key)
  public void setAddress(String key, Object value)

you would be able to  use "address(personal)" and "address(office)".

Hope this helps,

Fr.

-Original Message-
From: Maciej Kolodziej [mailto:[EMAIL PROTECTED]]
Sent: 15 January 2002 15:53
To: Struts Users Mailing List
Subject: Problem with mapped properties


Hi,

I'm  building  an  application,  which  uses  database as a source for
configuration  data.  For example I have a page which enables users to
customize  their  personal  UI schema, like which columns they want to
see in search result.

Now  that  means,  that  I  have to build dynamic html forms and use mapped
properties   to   populate  action  forms. Also property attributes in
form  tags (like 


but  that  doesn't  work.  I guess I don't have to mention, that using
another  jsp  tag  instead  of  <%=key%>  doesn't work either. It just
appears  in  html  output  as  ordinary  text  - it's not parsed while
converting  .jsp to .java. I noticed, that these are the brackets that
cause this malfunction. If I write:



everything works fine.

-- 
Best regards,
Maciej


--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Mapped properties

2001-12-07 Thread Rey Francois

Ted,
Your answer is correct, that should work for him.
Fr.

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 07 December 2001 11:59
To: Struts Users Mailing List
Subject: Re: Mapped properties


Rey, 

Is my answer here correct? 

http://jguru.com/forums/view.jsp?EID=567079

I *really* haven't done enough work with the mapped properties, and have
just been cribbing things from your messages ;-)


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Mapped properties

2001-12-07 Thread Rey Francois

Make zzz also has the proper get/set methods, and that all these get/set
methods are public.
Hope this helps,
Fr.

-Original Message-
From: Francesco Marsoni [mailto:[EMAIL PROTECTED]]
Sent: 06 December 2001 19:55
To: Struts Users Mailing List
Subject: Mapped properties


I get an exception with


Something like No getter method for yyy(kkk).zzz property of bean xxx
The method in my class is Object getYyy(String key).
I use dev distribution that I think have mapped properties support.




--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Any Struts Reference Apps that implement DAO?

2001-11-30 Thread Rey Francois

Not about DAO, but about the difference between web.xml and
struts-config.xml: the first one is loaded by the container, reloading is a
feature of the container, while the second one is loaded by Struts
(ActionServlet), reloading it does not involve redeploying anything, you can
just send a request to the Struts application to reload its configuration.

Fr.

> -Original Message-
> From: Matt Raible [mailto:[EMAIL PROTECTED]]
> Sent: 30 November 2001 04:43
> To:   [EMAIL PROTECTED]
> Subject:  Any Struts Reference Apps that implement DAO?
> 
> I'd like to implement the DAO pattern in a struts application I'm building
> - is anyone using this - if so, would you recommend?
> 
> Also, what's the advantages/disadvantages for declaring your database
> parameters in struts-config.xml vs. web.xml?
> 
> Thanks,
> 
> Matt << File: ATT48491.txt >> 

The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [REPOST FROM DEV] General Model Question...

2001-11-30 Thread Rey Francois

Check the earlier discussion "Design question - Action Form vs Business
Delegates/Value Objects", started by this post
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18315.html. If
you try now, you should see all posts down this page:
http://www.mail-archive.com/struts-user@jakarta.apache.org/thrd2.html.

Fr.


-Original Message-
From: Allen M. Servedio [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2001 14:01
To: [EMAIL PROTECTED]
Subject: [REPOST FROM DEV] General Model Question...


Hi,

It was correctly pointed out to me that I had posted this to the wrong list 
(sorry about that folks!). So, I am posting this here in the hopes that 
some of you can help me:

I have a couple of basic questions (I have only started using STRUTS, so if 
this is obvious please slap some links at me and send me on my way :-) ):

Which object type are people having their Action's send into their business 
and/or data layers: ones that derive from ActionForm or ones that implement 
the Value Object pattern? And how are they converting the business and/or 
data layer's response back (into Action Forms? or are you sending back the 
Value Object so that the custom tags can use that?).

My initial feeling on this was to only send Value Objects to the business 
and data layers so that they would not get coupled to what is obviously a 
presentation layer object (I saw Actions as bridges between the layers, 
converting between the Action Forms and Value Objects and back again). The 
problem I hit was that I did not want to have to write a bunch of 
conversion code (see below) to create my Value Object (since it is 
immutable and, hence does not have the setValue(object) methods that 
automatic JavaBean conversion utilities need):
 MyValueObject val = new 
MyValueObject(converter.convert(form.getValue(), typeOfConversion));

Where the above code would take the String value from an ActionForm, 
convert it into the type needed, and pass it into the constructor for the 
Value Object. Hit the same problem running back the other way (from Value 
Objects to Action Forms).

OR are people making their value objects mutable and maybe having them 
implement a read-only interface that the business and data layers use when 
interacting with or returning the object?

OR are people passing in the ActionForm to the Value Object so that it can 
extract what it needs (are you fronting it with an interface?)?

OR are people passing in a map of properties and their values to the Value 
Object for it to pick and choose what it wants?

OR something else entirely...?

When you are going back from Value Object to Action Form, how are you 
controlling the output format? I know that the Action needs to understand 
the format of the data that it would expect to receive from a submitted 
form... So, I am assuming that all formatting has to happen before it gets 
to the custom tag (the only exception being when it is writing data that 
will not come back through a form or query string). Is this what people are 
doing?

Thanks!
Allen


--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Design question - Action Form vs Business Delegates/Value Objects

2001-11-23 Thread Rey Francois


There is no plan to have it within the Jakarta commons, although it wouldn't
be a bad thing. The mapper framework offers the same functionality as
David's validation framework, except for the javascript generation. Having
them work in parallel is definitely possible, however you'll have two
separate XML configuration files: one for the validation based on David's
framework, and one mapper configuration for the conversion/transfer between
forms and value objects.

Fr.

-Original Message-
From: Roland Berger [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2001 10:31
To: Struts Users Mailing List
Subject: AW: Design question - Action Form vs Business Delegates/Value
Objects


Hi Francois

Will yor mapper framework become a part of jakarta commons? What are the
plans?
When should I use David Winterfeld's validation framework and when yours?
Can they work in parallel?
TIA
Roland

-Ursprüngliche Nachricht-
Von: Rey Francois [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 23. November 2001 09:17
An: 'Struts Users Mailing List'
Betreff: RE: Design question - Action Form vs Business Delegates/Value
Objects


I've had the same problem as you describe and like yourself have created a
mapper framework, see http://husted.com/struts/resources/mapper.zip. It can
handle validation, conversion and transfer of data, all this based on XML
configuration. The framework is not dependent on Struts, but can easily
integrate with it.

For an overview of the motivations behind this framework, read this earlier
posting
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02058.html.

Fr.

-Original Message-
From: Sobkowski, Andrej [mailto:[EMAIL PROTECTED]]
Sent: 22 November 2001 19:28
To: 'Struts Users Mailing List'
Subject: Design question - Action Form vs Business Delegates/Value
Objects


Hello,

we're working on a quite large project with J2EE (including EJBs) and we're
using Struts (we're still in the early phases). To design a "clean"
application, I've defined different "object conversions":
* Request phase
- the ActionForm is converted to a Value Object
- the Value Object is passed to the EJBs
* Response phase
- the EJBs return one ore more Value Objects
- the Value Object(s) is (are) converted back to ActionForms.

I think it's a good approach, but:
- my ActionForm and Value Objects have an almost identical interface. The
main difference is that the ActionForm instance variables are always of type
String while for the Value Object  have "final types" information (Date,
Integer, whatever)
- the conversion "ActionForm to VO" and back is slowing down the performance
as my EJBs often return hundreds of VOs (each one to be converted to an
ActionForm).
I know this can be improved by using paging (Page-by-Page iterator) on both
the back-end and the front-end; furthermore, I've written a small "mapper"
that uses extensively the Reflection API to automatically perform the
mapping and this probably has an impact on the overall performance.

My question is: what are the best practices for this type of issues? Does
anybody have the same problems? Should I reduce the level of abstraction
between the layers?

Thank you!

Andrej

PS. if you're interested, I can share the simple mapper. It's a very small
mapper (less than 15k) that works fine with my app. It's waaay less
complete than the mapper on Ted Husted's site but...

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 22, 2001 12:10 PM
To: 'Struts Users Mailing List'
Subject: RE: design question




-Original Message-
From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]]
Sent: 22 November 2001 16:54
To: Struts-list (E-mail)
Subject: design question

Hello

I have several questions about design, "best practises":

1)  Where to store client's profile information (like login name) ?
session  or system state bean ?

Use the HttpSession. But be aware that you should put as little as possible
into the session. Large sessions do not work well in a cluster.

2)  How to create and use a system state bean ?

System state bean should be in scope "session", shouldnt it ?

Again put as little as possible in the session and avoid statefull session
beans. If you must put a bean in the session, make it as small as possible,
ideally it would just hold key info that can be used to request beans at
request level when needed. This is a trade off between performance and
scalability.

3) Where to put business logic (where I invoke JDBC) ?
Should business logic class be a bean ?

If you have an app server business logic should go into a stateless session
bean (BusinessService), which is invoked (via a BusinessDelegate) from a
struts Action class. If you are not using EJBs then the Action class should
still invoke a business delegat

RE: Design question - Action Form vs Business Delegates/Value Objects

2001-11-23 Thread Rey Francois

I've had the same problem as you describe and like yourself have created a
mapper framework, see http://husted.com/struts/resources/mapper.zip. It can
handle validation, conversion and transfer of data, all this based on XML
configuration. The framework is not dependent on Struts, but can easily
integrate with it.

For an overview of the motivations behind this framework, read this earlier
posting
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02058.html.

Fr.

-Original Message-
From: Sobkowski, Andrej [mailto:[EMAIL PROTECTED]]
Sent: 22 November 2001 19:28
To: 'Struts Users Mailing List'
Subject: Design question - Action Form vs Business Delegates/Value
Objects


Hello,

we're working on a quite large project with J2EE (including EJBs) and we're
using Struts (we're still in the early phases). To design a "clean"
application, I've defined different "object conversions":
* Request phase
- the ActionForm is converted to a Value Object
- the Value Object is passed to the EJBs
* Response phase
- the EJBs return one ore more Value Objects
- the Value Object(s) is (are) converted back to ActionForms.

I think it's a good approach, but:
- my ActionForm and Value Objects have an almost identical interface. The
main difference is that the ActionForm instance variables are always of type
String while for the Value Object  have "final types" information (Date,
Integer, whatever)
- the conversion "ActionForm to VO" and back is slowing down the performance
as my EJBs often return hundreds of VOs (each one to be converted to an
ActionForm).
I know this can be improved by using paging (Page-by-Page iterator) on both
the back-end and the front-end; furthermore, I've written a small "mapper"
that uses extensively the Reflection API to automatically perform the
mapping and this probably has an impact on the overall performance.

My question is: what are the best practices for this type of issues? Does
anybody have the same problems? Should I reduce the level of abstraction
between the layers?

Thank you!

Andrej

PS. if you're interested, I can share the simple mapper. It's a very small
mapper (less than 15k) that works fine with my app. It's waaay less
complete than the mapper on Ted Husted's site but...

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 22, 2001 12:10 PM
To: 'Struts Users Mailing List'
Subject: RE: design question




-Original Message-
From: M`ris Orbid`ns [mailto:[EMAIL PROTECTED]] 
Sent: 22 November 2001 16:54
To: Struts-list (E-mail)
Subject: design question

Hello

I have several questions about design, "best practises":

1)  Where to store client's profile information (like login name) ?
session  or system state bean ?

Use the HttpSession. But be aware that you should put as little as possible
into the session. Large sessions do not work well in a cluster.

2)  How to create and use a system state bean ?

System state bean should be in scope "session", shouldnt it ?

Again put as little as possible in the session and avoid statefull session
beans. If you must put a bean in the session, make it as small as possible,
ideally it would just hold key info that can be used to request beans at
request level when needed. This is a trade off between performance and
scalability.

3) Where to put business logic (where I invoke JDBC) ?  
Should business logic class be a bean ?

If you have an app server business logic should go into a stateless session
bean (BusinessService), which is invoked (via a BusinessDelegate) from a
struts Action class. If you are not using EJBs then the Action class should
still invoke a business delegate, but the delegate would simply create a
normal Java bean to act as the Business Service. The business service
(Stateless EJB or Java Bean) should delegate to another class to access a
datasource. If your are using EJBs this should be a CMP or BMP+DAO depending
on your app server (EJB 2 compliant consider CMP, else try CMP if supported
but be prepared to subclass to a BMP+DAO at a later date).

thanx in advance
Maris Orbidans


Jon Ridgway.

--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

RE: bean:message and performance

2001-11-19 Thread Rey Francois

- Are you absolutely sure the i18n is the reason of the poor performance or
is it an assumption? Using some profiling tool could help pinpoint the
problem.

- Another solution to the size issue: decompose your pages into included
subcomponents that are of smaller size.

Fr.

-Original Message-
From: Francois-Xavier Bonnet [mailto:[EMAIL PROTECTED]]
Sent: 19 November 2001 14:18
To: [EMAIL PROTECTED]
Subject: bean:message and performance


Hello all,

I am using bean:message tag for internationalizing my pages. My problem 
is that some pages have too many tags (sometimes up to 50 just for bean:
message) :

1) for some jsp, the generated .class file may exceed the 64 K limit 
allowed for a java method

2) even if pages do not reach this limit, performance are poor

I have been thinking about 2 solutions to this problem :

1) writing some servlet that would replace bean:message tags by their 
value before compilation and cache the result jsp file in one folder for
 each language.

2) using some other tool for i18n of my application (maybe cocoon ?)


Any idea or advice would be greatly appreciated.


Francois-Xavier
[EMAIL PROTECTED]

--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Recursive loop through an object collection

2001-11-15 Thread Rey Francois

Some ideas:
 - Struts/Jakarta Common BeanUtils and PropertyUtils: the nested property
feature allows you to write things like getProperty(bean,
"object1.object2.object3.field"), even in struts tag. Requires no changes to
the objects. Best if the structure is stable.
 - Visitor pattern, however requires some changes to the objects. Best if
structure is variable (in terms of hierarchy levels, number of objects, type
of objects in the structure.

Fr.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 12:39
To: [EMAIL PROTECTED]
Subject: Recursive loop through an object collection


Hello All,

I am looking for a way to loop through an object structure to retrieve some
information to populate a list box. The object structure looks similar to
the following:

Root
  Object 1
Object 2
Object 3
  Object 4
  Object 5
Object 6
Object 7

I need to retrieve the details and then create a list box containing them.
Does anyone have any suggestions?

Thanks.

Regards,

Stephen.




---

Copyright material and/or confidential and/or privileged information may be
contained in this e-mail and any attached documents.  The material and
information is intended for the use of the intended addressee only.  If you
are not the intended addressee, or the person responsible for delivering it
to the intended addressee, you may not copy, disclose, distribute,
disseminate or deliver it to anyone else or use it in any unauthorised
manner or take or omit to take any action in reliance on it. To do so is
prohibited and may be unlawful.   The views expressed in this e-mail may not
be official policy but the personal views of the originator.  If you receive
this e-mail in error, please advise the sender immediately by using the
reply facility in your e-mail software, or contact [EMAIL PROTECTED]
Please also delete this e-mail and all documents attached immediately.  
Many thanks for your co-operation.

BMW Financial Services (GB) Limited is registered in England and Wales under
company number 01288537.
Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF

--

--
To unsubscribe, e-mail:

For additional commands, e-mail:


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email 
immediately. You should not copy, use or disseminate the 
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Hashmaps and string keyed properties

2001-10-30 Thread Rey Francois


Viral,

Could you be more precise on the runtime exception you get?
What you are trying to do should be possible with the Common BeanUtils.
However there is a bug that is fixed only in the nightly build of the
Commons BeanUtils. This bug is about the inability to recognize the
read-only mapped properties in some cases. Perhaps you will resolve your
problem by taking the latest build of the commons BeanUtils
(commons-beanutils.jar).

The second thing you want to do is, if I understand well, the ability to get
the whole map of values, like it is possible in the JDK to get an array of
values for an indexed property using a no-arg getMethod. This is actually
not implemented. However the class MappedPropertyDescriptor in BeanUtils is
implemented in a way that makes it easy to do so. If you feel like it, you
can implement this feature yourself and perhaps submit the code for
inclusion in the BeanUtils. It should be easy to implement, have a look at
how the JDK IndexedPropertyDescriptor is implemented in Java and try to do
the same in MappedPropertyDescriptor. One concern however in implementing
this: is the type Map the best choice as a return value? The problem with
Map is that it does not enforce the use of String as keys. The other problem
was that it forces the use of standard Java collections (for example the JGL
HashMap could not be used). However I cannot think of any better
alternatives than Map...

The third thing you talk about, I'm not sure what. Using the current
convention for nested properties, you could do this:
method(key1).prop2(key2).prop3(key3), but I'm not sure that's what you want.

Hope this helps,

Fr.

-Original Message-
From: Viral V. Tolat [mailto:[EMAIL PROTECTED]]
Sent: 31 October 2001 04:48
To: '[EMAIL PROTECTED]'
Subject: Hashmaps and string keyed properties


Three questions.

First, we're trying to get the following to work with the Struts nightly
build



where SomeForm implements 
String getMethod ( String key ).  
We  get a runtime error in the write tag for this and we can't figure out
why.  Any suggestions?  Do we need the Bean 
Utils with indexed string contributor extension?  But if we take this, does
it merge with the current BeanUtils from 
Commons?

Second, we'd like to be able to access a HashMap directly from the taglibs,
similar to how an Array can be accessed. 
So we'd like to be able to do the same as above except that

HashMap getMethod()

returns a HashMap and doesn't take an argument. 

And lastly, we'd like to be able to nest Hashmaps and then have something
like



where getMethod returns a HashMap but then key1 through key3 index into
successive Hashmaps or other JavaBeans.  
Essentially we'd like to wrap our form beans around a hashmap. We'll then
write code in our action beans to convert the hashmaps to and from Java
business objects.  We just don't see alot of value in creating a FormBean
for every domain object of which we have several hundred.

Thanks.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: PropertyUtils & dot notation

2001-10-19 Thread Rey Francois


The things you're talking about (making the getProperty return null instead
of throwing an error when a nested property is null, and making the
setProperty creating a nested object in the same situation) are indeed not
supported within struts or within the commons BeanUtils. As you said, there
is no hook to extend and do so.

I agree this is definitely a pain to have to deal manually with these
situations. The solution for you would be to either keep using your own
framework for that part, or to modify/extend yourself the commons/struts
BeanUtils, and perhaps submit these enhancements to the list (I think a few
people could benefit from this as well). However you must make sure these
enhancements preserve backward compatibility. This will allow you to have
these enhancements available throughout the whole Struts framework,
including the form tags. This also means you have to work this out behind a
static class that has cached PropertyDescriptors, and static classes are not
that easy to extend! 

Fr.

-Original Message-
From: Matt Smith [mailto:[EMAIL PROTECTED]]
Sent: 17 October 2001 11:05
To: [EMAIL PROTECTED]
Subject: PropertyUtils & dot notation


This question has to do with PropertyUtils, so it might be more
appropriately posted to the Commons mailing list, but they don't have a
"User" list so I'm starting here.

My company currently has an page generation framework we developed in-house,
and I'm looking at replacing it with Struts.  I, like some of the users I've
seen on the mailing list, deal with large multi-page forms with many
(sometimes hundreds) of fields, and I really don't want to code setters &
getters for all of them. At first I was particularly worried about the
apparent tight coupling of ActionForms to a particular HTML form, but the
dot-notation of referencing nested bean properties seems to take care of
that nicely. We implemented a very similar system of dot-notation that used
reflection, etc, in the same way, but we made some slightly different
choices and I'm hoping someone can help me with how I could achieve the same
functionality with the struts version.

In PropertyUtils.java, get/setNetstedProperty throw
IllegalArgumentExceptions if any of the getters return null. So if you try
to get a.foo.bar, and getFoo() returns null, then an exception will be
thrown. Likewise, setting a.foo.bar will fail.

The choice we made was that when you're getting, if anything along the path
returned null, then the whole expression was just assumed to be null, and
that was fine. so if getFoo() is null, then getting a.foo.bar is null and
that's kosher. I assume this is solvable with struts, and that somehow I can
ignore the exception. (I just haven't found any hooks into that part of the
framework yet).

The thing I'm more worried about is object creation - we have things set up
so that on sets (and sets only), intermediate objects will be created
automatically. So if you try to set a.foo.bar, and getFoo() is null, then
foo will be created for you so that bar can be set. How is this normally
dealt with in Stuts? Seems like if you have a large object graph that you're
trying to deal with in a general way (letting the HTML people move fields
from page to page, etc), then having to hard-code object creation would be a
huge pain.

Thanks for your time,
-Matt


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: The final word on struts and jboss 2.2.2 and tomcat 3.2.2

2001-09-18 Thread Rey Francois


Not at all an answer to the original question but more of a comment on your
dev. setup. My personal experience is that you should aim at having the
development environment as close as possible to the production environment.
If you develop your app on JBoss and Tomcat, you may spend lots of time
trying to make it work on WebSphere at the end. So my advice is really to
make sure you test your application on the target platform as soon as
possible, or at least very early in the process and regularly.

Fr.

-Original Message-
From: Luis Olivares [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2001 17:17
To: [EMAIL PROTECTED]
Subject: Re: The final word on struts and jboss 2.2.2 and tomcat 3.2.2


Im too very interested in this topic, since we'll be developing an
Application for WebSphere 4.0, but our Development Enviroment will be Jboss
with Tomcat.

Regards.

   Luis Olivares.
   [EMAIL PROTECTED]
   --
  "Intelligence is the ability to avoid doing
   work, yet getting the work done"
  --Linus Torvalds--

- Original Message -
From: "bill milbratz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 9:36 AM
Subject: The final word on struts and jboss 2.2.2 and tomcat 3.2.2


> I'd like to confirm from the Struts Authorities, that indeed, struts
> doesn't quite-work-right with tomcat 3.2.2 and jboss 2.2.2.  (Classloader
> problems and sundry "'class not found" exceptions). Does jboss-2.4.1a and
> Tomcat-3.2.3 solve the problem?
>
> I've seen a few posts on this topic:
>
> This one suggests that Tomcat 3.3 makes the problem disappear:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14601.html
>
> This one suggests a workaround which involves precompiling the jsp pages:
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12335.html
>
> This one suggests dropping back to tomcat 3.2.1
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12400.html
>
>
> thanks in advance,
>
> bill m


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Session STOMP

2001-09-05 Thread Rey Francois

I have actually the same problem on Tomcat 3.3 Beta 1, my session is renewed
for each request... What container do you use ?

Fr.

-Original Message-
From: Clay Graham [mailto:[EMAIL PROTECTED]]
Sent: 05 September 2001 17:26
To: '[EMAIL PROTECTED]'
Subject: Session STOMP


User Crew,

My sessions are being stomped (or actually being overriden by new ones) 
every time I make a new request. They are fine from the form to the action 
part, but the second I do a new request the session evaporates. I need to 
be able to keep the session around because I have a userMgr object that I 
store in the session that I need as long as the user is logged in (old 
hat).

the_session.setAttribute("UserMgr", 
l_new_user);
the_session.setMaxInactiveInterval(300);

so when it gets to the home page for logged in users it gets the user 
manager fine:

Welcome to Contextuon Clay!
session id:8k2hwyjun1
session attributes:
org.apache.struts.action.TOKEN
org.apache.struts.action.LOCALE
UserMgr
loginForm
and the URL that made that fine message relates to the action handler for 
login
http://localhost/contextuon/login.do;jsessionid=8k2hwyjun1
greatgoodness...I saved the user manager to session, now the problem 
startsthe user is logged in so they can goto all "user pages", those 
pages will actually forward back to the login page if the user is not 
logged in.

<% if (UserMgr.isActive() == false){%>

<%}%>
THE PROBLEM: from this point forward any request will stomp the session and 
create a new one. The UserMgr is gone on any "user page" because there is 
an entirely new session. I use a goto action to make sure I am not leaving 
the struts framework and pass a forward directive to the action 
handler...(paranoia)
http://localhost/contextuon/goto.do?forward=contextmgr
I tried using the "false" directive in this action
HttpSession session = request.getSession(false);
but that didn't do a thing.
any ideas why my session.EVAPORATES?
any ideas are appreciated.

Clay





ok, so just to make it clear...I NEVER do this (Except in my logout action 
which has not happened), so it ain't me.

session.removeAttribute("UsrMgr");
session.invalidate();



So I don't know why this is happening, or even if its because of struts, it 
may actually be Tomcat that is generating new sessions but I found out 
about it while writing my my LoginAction class so there ya have it...



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: CDATA with Digester

2001-09-04 Thread Rey Francois

Not sure if this is the reason, but the XML you wrote below is actually
going to be parsed as two elements: one text part, then one CDATA section.
Both of them make up the body of your tag. Perhaps the digester expects only
one element inside the tag...

Try this instead:





Fr.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 04 September 2001 12:22
To: [EMAIL PROTECTED]
Subject: CDATA with Digester


Hello List,

Is it normal to get an exception when one tries to parse CDATA tags  with
Digester ? (maybe related to Sax)
Like in :
..

some text 


Thanks for any hint,

.B


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Dynamic Form Beans?

2001-08-30 Thread Rey Francois

One part of the solution is to use the MappedProperty feature recently added
to the jakarta-commons bean-utils.
The original submission is in this message:
http://www.mail-archive.com/jakarta-commons@jakarta.apache.org/msg03005.html

It has been integrated into the commons source, as indicated by this
message:
http://www.mail-archive.com/jakarta-commons@jakarta.apache.org/msg03596.html

Also look at this message for a bug that needs to be fixed (hopefully the
patch will be committed soon):
http://www.mail-archive.com/jakarta-commons@jakarta.apache.org/msg03897.html

Other relevant messages are referenced in this one:
http://www.mail-archive.com/jakarta-commons@jakarta.apache.org/msg03429.html


Hope this helps,

Fr.

-Original Message-
From: John Townsend [mailto:[EMAIL PROTECTED]]
Sent: 29 August 2001 19:54
To: [EMAIL PROTECTED]
Subject: Dynamic Form Beans?


I am working on a project where is would be nice to have the ability to
define a dynamic form bean (i.e. a form bean where the fields are
defined at runtime). The most obvious (but perhaps not the best)
solution to this problem would be if the ActionServlet could handle
saving data in a form bean that was a hashtable. 

Has someone else run into this problem and come up with a solution? 

Thanks,
-- John Townsend
 


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Security, authentication and authorisation with Struts

2001-08-24 Thread Rey Francois


We actually do more or less the same. During the login phase we retrieve the
user profile which includes the authorization information and store this in
the session context. Each action can then take some access control decision
based on this information.

However I am currently trying to use JAAS (Java Authentication and
Authorization Service) just for the authorization part. I have written a doc
on the various issues of doing so and how I'm planning to do so. I'm still
working on it but it may be useful to some of you, so I attach it. This
document mentions "eShell": this is the name of the framework we use, and it
is extending Struts.

As usual, any comments on this is welcome :)

Fr.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 24 August 2001 15:27
To: [EMAIL PROTECTED]
Subject: RE: Security, authentication and authorisation with Struts


> I wondered what approach you guys took when implementing security,
> authentication and authorisation.  I have the common scenario 
> where the application I am creating allocates roles to certain
> types of users, allows them to login, then restricts access to
> certain pages and within the pages certain content.

I use a subclass of ActionServlet that ensures that the username
(a String) and authorization info (a bean) for this user are
saved in the session scope before any Actions are called. (They
aren't combined into one object because I need the username
for other situations when I may not require auth information.)

At the top of each Action I consult the authorization bean to see
if this user has the appropriate permissions to call this Action.
If so, I just keep going. If not, I forward to a JSP that tells
them "no". If the authorization bean doesn't exist anymore it's
because the session timed out in which case I forward to another
JSP asking them to start over. The ability to choose your view in
the Action is really, really nice.

I don't have a login procedure because there is a front-end that
they need to pass through before they get to my application
and this guarentees me a username in the HTTP headers. So I just
need to pull it out of the headers in the special ActionServlet
subclass and put it in the scope. But it would be easy enough for
a login page to do the same thing.

Devon




The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***

Title: Using JAAS within eShell web applications





Using JAAS within eShell web applications

[Introduction]
[JAAS support in eShell]
[Configuration]

 

Introduction

The Java Authentication and Authorization Service (JAAS) is
a standard Java API that extends the standard Java security model in order to:


Provide a standard API of authenticating users while allowing different
authentication methods to be plugged-in (pluggable login modules).
Provide subject-based access control by extending the standard Java 2
security model: access control can be based on who is running the
code in addition to which code source is running.
Allow the use of a custom policy object which can retrieve user permissions
from any storage.

JAAS is distributed as a standard extension to the J2SE 1.3 platform,
and is completely integrated into J2SE 1.4. However despite this integration,
there are important issues that makes it difficult to integrate JAAS in the
context of a web application.

Integration Issues
The issues one faces when using JAAS within a web application relate on
one side to the current state of the J2EE specifications, and on the other side
to the way JAAS is currently defined. At present there is no way to provide a
portable solutions to these issues.

Issues with the J2EE specification
The issues with the current J2EE 1.2 specification is that it does not
integrate JAAS. Indeed, container providers are not required to use JAAS for
implementing authentication and authorization. In the case of the Servlet
specification, web containers are just required to support:

Basic authentication: browser asks for userid/password
Form-based authentication: allow a custom screen for userid/pwd
Client certificate authentication: based on PKI infrastructure
Role-based access control to web resource

Therefore it's only through these standard authentication and authorization
mechanisms that one can benefit from container managed security (e.g.
propagation of the user identity to an EJB container).
The J2EE specification v1.3 goes a little further in integrating JAAS within
the J2EE

RE: session id

2001-08-21 Thread Rey Francois

request.getSession().getId()

Fr.

-Original Message-
From: Mike Dewhirst [mailto:[EMAIL PROTECTED]]
Sent: 21 August 2001 11:20
To: '[EMAIL PROTECTED]'
Subject: session id
Importance: High


how can i get the user session id within an Action class?


=**

If you are not the intended recipient, employee or agent responsible for
delivering the message to the intended recipient, you are hereby notified
that any dissemination or copying of this communication and its attachments
is strictly prohibited.

If you have received this communication and its attachments in error, please
return the original message and attachments to the sender using the reply
facility on e-mail.

Internet communications are not secure and therefore the UCLES Group does
not accept legal responsibility for the contents of this message.  Any views
or opinions presented are solely those of the author and do not necessarily
represent those of the UCLES Group unless otherwise specifically stated.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not
guarantee that this email is virus free.

**=


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Displaying a hashmap through html:options

2001-08-20 Thread Rey Francois


Have a look at the following messages which discuss the addition of such
feature.
In this message you'll find some source code that can help you until
hopefully this gets into the commons.
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02804.html

Fr.

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02864.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02863.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02849.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02847.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02843.html

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02805.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02804.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02802.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02801.html


-Original Message-
From: Will Jaynes [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2001 13:36
To: [EMAIL PROTECTED]
Subject: Re: Displaying a hashmap through html:options


The options tag doesn't permit the use of a Hashmap. A Hashmap is not
actually a
Collection, since it doesn't implement the Collection interface. Perhaps
this
utility is a possible enhancement for the options tag.

- Original Message -
From: "Ganendran Kumaraswamy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 4:45 AM
Subject: Displaying a hashmap through html:options


I have created and set a hashmap called "hm" in the request object in my
action class.  Action class forwards it to a JSP page. In the JSP page, I
have the following line to get the bean into the page.



I am trying to populate the options tag using the data in the hashmap. I
want the keys of the hashmap to be the value of the  tag in html and
the value of the hashmap to be the displayed text.

Currently I have something like,





This doesnt seem to work.  Any ideas ?





The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: referring to hashmap elements with struts...

2001-08-20 Thread Rey Francois


Have a look at the following messages which discuss the addition of such
feature.
In this message you'll find some source code that can help you until
hopefully this gets into the commons.
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02804.html

Fr.

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02864.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02863.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02849.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02847.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02843.html

http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02805.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02804.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02802.html
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02801.html


-Original Message-
From: Andy Goldstein [mailto:[EMAIL PROTECTED]]
Sent: 15 August 2001 04:52
To: [EMAIL PROTECTED]
Subject: referring to hashmap elements with struts...


Hi there.

I have an Action that's tossing a very nice HashMap object at a Struts page.
Is there a way (using Struts) that I can refer to the individual values in
the Hash by using their keys?  I see how I would iterate (although I'm not
crazy about this functionality), but that's not what I'm interested in: I
need to be able to use the key/value pairs.  After all, isn't that what
makes a Hash so helpful?

Thanks,

Andy
[EMAIL PROTECTED]



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Re[2]: String as Index

2001-08-03 Thread Rey Francois


Well, you won't be able to tell Struts how to use it without
changing/duplicating its code.
For example if you want to use it with a tag, you'll have to reimplement the
tag.

I would think that Struts should ultimately incorporate this 'string keyed
properties' feature, there as been several people asking for them already.
So my suggestion would be for a committer to the commons package to do this
on the actual commons PropertyUtils, then other people can start upgrading
the tags...

Fr.

-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2001 13:07
To: [EMAIL PROTECTED]
Subject: Re: Re[2]: String as Index


"Rey Francois" <[EMAIL PROTECTED]> wrote:

> The zip file is here: http://www.husted.com/about/struts/mapper.zip.
> Check the com.capco.util package, it contains a PropertyUtils class.
> 
> Fr.

Hi, I can see how to use the PropertyUtils, but I cannot find out,
how to tell struts, how to use it. :-((

--
gR


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Re[2]: String as Index

2001-08-02 Thread Rey Francois


The zip file is here: http://www.husted.com/about/struts/mapper.zip.
Check the com.capco.util package, it contains a PropertyUtils class.

Fr.

-Original Message-
From: Oleg V Alexeev [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2001 14:55
To: [EMAIL PROTECTED]
Subject: Re[2]: String as Index


Hello Rey,

Rey, I search page but can not found anything about your string keyed
proeprties. Can you send URL to the archive with sources?

Wednesday, August 01, 2001, 3:59:51 PM, you wrote:


RF> You can use the PropertyUtils that I have created (reusing the Struts
one)
RF> within the Mapper framework
RF> (http://www.husted.com/about/struts/resources.htm#extensions). It
supports
RF> "string keyed properties", using the notation
RF> 'simple.nested.indexed[1].stringKeyed("key")'.
RF> See this posting about this topic.
RF> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10858.html

RF> Fr.

RF> -Original Message-
RF> From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
RF> Sent: 01 August 2001 13:55
RF> To: [EMAIL PROTECTED]
RF> Subject: String as Index


RF> Hi,

RF> as far as I can remember, there was a topic about String as index in
RF> property getters/setters here some time ago.


RF> I'd like somethigh like this:

RF> 

RF> and aaa{bbb} should be converted to getAaa("bbb") and setAaa("bbb",
value).

RF> Is there something implemented in this direction already? Can I use the
RF> results? Can I help?

RF> --
RF> gR

RF> 
RF> The information in this email is confidential and is intended solely
RF> for the addressee(s).
RF> Access to this email by anyone else is unauthorised. If you are not
RF> an intended recipient, you must not read, use or disseminate the
RF> information contained in the email.
RF> Any views expressed in this message are those of the individual
RF> sender, except where the sender specifically states them to be
RF> the views of Capco.

RF> http://www.capco.com
RF> ***



-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: String as Index

2001-08-01 Thread Rey Francois


You can use the PropertyUtils that I have created (reusing the Struts one)
within the Mapper framework
(http://www.husted.com/about/struts/resources.htm#extensions). It supports
"string keyed properties", using the notation
'simple.nested.indexed[1].stringKeyed("key")'.
See this posting about this topic.
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10858.html

Fr.

-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2001 13:55
To: [EMAIL PROTECTED]
Subject: String as Index


Hi,

as far as I can remember, there was a topic about String as index in
property getters/setters here some time ago.


I'd like somethigh like this:



and aaa{bbb} should be converted to getAaa("bbb") and setAaa("bbb", value).

Is there something implemented in this direction already? Can I use the
results? Can I help?

--
gR


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




New release of the Mapper framework

2001-07-30 Thread Rey Francois


A new release of the Mapper framework is available on Ted Husted's site on
http://husted.com/about/struts/resources.htm. The Mapper framework can be
used for automating the process of validating/converting/transferring data
fields. Although the framework is independent from Struts itself, it can
easily be integrated in order to validate ActionForm beans. See the
following posting on this topic:
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02129.html.


In this new release:
 - documentation in the form of javadoc (start by the mapper package
javadoc). More documentation is still needed, notably on the validation rule
language itself, but that would be for a later release. Let me know if you
have any questions in the meantime.
 - simplified XML config file (new elements: declarations, rules; deleted
elements: nested-mapper)
 - nested mappers are now handled within the rules instead of a special XML
tag
 - ability to load multiple config files

There is still an impressive list of further development that could be done,
see the 'todo.xml' file. I hope I will get a chance to do most of them in
the near future (but if any of you is interested to participate...)

Questions/feedback: mailto:[EMAIL PROTECTED]

Fr.


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: URL mapping

2001-07-17 Thread Rey Francois

No, you can forward to whatever path can be used to construct a
RequestDipatcher object, as shown in the ActionServlet.processForward()
method (which I pasted below). That includes .jsp paths.
Fr.

/**
 * Process a forward requested by this mapping, if any.  Return
 * true if processing of this request should continue (i.e.
 * be processed by an Action class), or false if we have
 * already handled this request.
 *
 * @param mapping The ActionMapping we are processing
 * @param request The request we are processing
 * @param response The response we are processing
 *
 * @exception IOException if the included resource throws an exception
 * @exception ServletException if the included resource throws an
 *  exception
 */
protected boolean processForward(ActionMapping mapping,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {

// Are we going to process this request?
String forward = mapping.getForward();
if (forward == null)
return (true);

//unwrap the multipart request if there is one
if (request instanceof MultipartRequestWrapper) {
request = ((MultipartRequestWrapper) request).getRequest();
}
// Construct a request dispatcher for the specified path
RequestDispatcher rd =
getServletContext().getRequestDispatcher(forward);
if (rd == null) {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
   internal.getMessage("requestDispatcher",
   forward));
return (false);
}


-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: 17 July 2001 13:29
To: [EMAIL PROTECTED]
Subject: Re: URL mapping


Of course. But with this action-forward approach, you can forward only *.do
URLs.
Please correct me, if I am wrong.

--
gR


- Original Message -----
From: "Rey Francois" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 12:25 PM
Subject: RE: URL mapping


> You could, but I would favor the use of the 'forward' attribute in the
> 'action' element in the struts-config.xml.
> Here is an extract of the documentation in the DTD:
>  forward Context-relative path of the servlet or JSP resource
> that
>  will process this request, instead of instantiating
and
>  calling the Action class specified by "type".
Exactly
> one
>  of "forward", "include", or "type" must be specified.
>
>
> Doing it this way makes it very easy to map to an action at a later stage
if
> the requirements have changed.
>
> Fr.
>
>
> -Original Message-
> From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
> Sent: 17 July 2001 12:25
> To: [EMAIL PROTECTED]
> Subject: Re: URL mapping
>
>
> "Chris Callaghan" <[EMAIL PROTECTED]> asks:
>
>
> > Hey all,
> >
> > I want to be able to map a URL to certain JSPs which may or may not have
> > an action involved with them e.g
> > map /logon to logon.jsp which also has as action also called logon
> > also /tour to tour.jsp which has no associated action.
> >
> > How can I do this with struts?
> >
> > Cheers
> > Chris
>
> You can do it with your http server, not with struts.
>
> --
> gR
>
> 
> The information in this email is confidential and is intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised. If you are not
> an intended recipient, you must not read, use or disseminate the
> information contained in the email.
> Any views expressed in this message are those of the individual
> sender, except where the sender specifically states them to be
> the views of Capco.
>
> http://www.capco.com
> ***
>


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: URL mapping

2001-07-17 Thread Rey Francois

You could, but I would favor the use of the 'forward' attribute in the
'action' element in the struts-config.xml.
Here is an extract of the documentation in the DTD:
 forward Context-relative path of the servlet or JSP resource
that
 will process this request, instead of instantiating and
 calling the Action class specified by "type".  Exactly
one
 of "forward", "include", or "type" must be specified.


Doing it this way makes it very easy to map to an action at a later stage if
the requirements have changed.

Fr.


-Original Message-
From: Gregor Rayman [mailto:[EMAIL PROTECTED]]
Sent: 17 July 2001 12:25
To: [EMAIL PROTECTED]
Subject: Re: URL mapping


"Chris Callaghan" <[EMAIL PROTECTED]> asks:


> Hey all,
> 
> I want to be able to map a URL to certain JSPs which may or may not have 
> an action involved with them e.g
> map /logon to logon.jsp which also has as action also called logon
> also /tour to tour.jsp which has no associated action.
> 
> How can I do this with struts?
> 
> Cheers
> Chris

You can do it with your http server, not with struts.

--
gR


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Java-related question: thread safe ActionClasses

2001-07-17 Thread Rey Francois

Holger,

I'm a bit confused by your explanations, notably about the method
isPropertySet(Object helperObject).
What property is it supposed to test? I'd be tempted to write/understand it
as:
isPropertySet(Object object, String propertyName), implying reflection is
used for getting accessing the property. I suppose also you would base you
logic on the fact that a property is set when it is null. However sometimes
a null value is a valid value, which is not the same as having no value set
(we had to do such distinction in some cases).

In any case, the way to decouple your business objects from the struts stuff
is usually done via intermediate objects which are typically called value
objects or command objects. These objects are part of the interface to your
business logic and are not dependent on Struts. In this approach, the Action
typically create those value/command objects and populate them using the
data from the ActionForm object. I have tried to automate this process in a
separate mapper framework (pre-release available on Ted Husted's site) so
that custom coding is removed as much as possible.

Finally, to answer your question about static method, building up on David's
answer: make sure that all the required state information for the request to
process is passed as parameters, so that you method only accesses these
parameters.

Fr. 

-Original Message-
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: 16 July 2001 21:22
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: Java-related question: thread safe ActionClasses


If you call a static method that doesn't access any
external variables that are maintaining state, it will
be safe to call from a thread.  Just like the perform
method in your Action class should be thread safe
since it can be used by multiple threads.  

The general consensus is that it is good to separate
your business logic from being aware of the web layer.

David

--- Holger Wiechert <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I've got a question about an issue to the thread
> safe execution.
> The whole setup was made in order to have a business
> logic triggered by
> struts, that still can retrieve information from its
> environment -- here Struts -- without
> having explicit knowledge of it. In short, the
> processing is like this:
> 
> a) the ActionObject gets the business object
> b) calls the business method on the business object
> including 
> -the HttpServletRequest just received in the perform
> call, and
> -a reference to itself 
> c) the business object now uses this reference to
> retrieve from this object 
>some information about the business objects
> environment. Thus, the business object
>calls the ActionObject (without knowing, that it
> is a struts Action) and hands in
>the HttpServletRequest (as an java.lang.Object).
> d) the ActionObject uses the HttpServletRequest to
> get the desired information
>(like request.getParameter()) and returns the
> result back to the business object.
> 
> Basically, I want to know, if I can use a static
> method (no static fields) within the ActionObject
> for performing the environment lookup thread safe.
> 
> Sounds a little complicated, doesn't it? Well, to
> those who have the time to get involved.
> It's actually not that difficult.
> 
> The class structure in my struts app is like the
> following:
> 
> -Class MyActionClass: extends ...struts.Action
> implements myClasses.Environment
> 
> -Interface myClasses.Environment has (let's say)
> just one method: 
> public boolean isPropertySet(Object helperObject)
> 
> -Class DoSomeStuffRq is a class that contains 
> a)translated form data, and 
> b) an java.lang.Object reference to store the
> HttpServletRequest 
> (which the MyActionObject just has recieved in its
> perform method).
> 
> -Class MyBusinessClass:
> doSomeBusinessStuff(DoSomeStuffRq stuffInfo,
> Environment env)
> 
> The Environment interface is there in order to
> decouple Struts from the business logic - giving
> the chance to reuse the MyBusinessClass when not
> using Struts anymore (well, I hope I don't have to,
> but still).
> 
> So finer grained, the actions are:
> 
> 1) Let the MyActionClass get the businessObject (of
> type MyBusinessClass),
> 2) MyActionClass calls the method
> businessObject.doSomeBusinessStuff(stuffInfo, this);
> 
> ["this" is of type Environment]
> 
> 3) in order to process the business actions, the
> BusinessObject has to 
> retrieve a boolean value from it's (unknown)
> environment. So it calls
> the isPropertySet from the Environment interface
> (which has the MyActionClass implementation):
> 
> public StuffResponse
> doSomeBusinessStuff(DoSomeStuffRq stuffInfo,
> Environment env)
> {
>   boolean importantProperty =
>
environment.isPropertySet(stuffInfo.getObjectReference());
>   ...
> }
> 
> where stuffInfo.getObjectReference() gives the above
> mentioned HttpServletRequest reference as a
> java.lang.Object.
> 
> 4) the rest is quite obvious: m

RE: struts w/ej

2001-07-10 Thread Rey Francois

If any of you have already tried the mapper framework, the next release
planned for next week will make some of the elements in the mapper-config
DTD obsolete (nested-mapper, converters, validators, conversions,
validations) and will add a couple new elements (declarations, rule). This
means you'll need to change your mapper-config.xml accordingly.

Fr.

-Original Message-
From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 15:06
To: '[EMAIL PROTECTED]'
Subject: RE: struts w/ej


(I hit Send by mistake - sorry for the premature mailing)

Paul, 

I'm afraid I'm pressed for time at the moment, but I'd like to share our
approach. I can't say with certainty that this was the best approach (we've
discussed it on the list before in fact) but it is getting the job done for
us. (Criticisms welcome :) 

We have multiple "objects" upon which we perform maintenance. Each object
has a "search" screen and a "detail" screen. Our Action needs to do
different things when a different button is pressed (basic CRUD functions,
few advanced things, etc). Each object, while different, shares a great deal
of generic code in order to prepare data and pass it along to some EJB
(session bean).   Thus, we have an abstract "Action" class that contains all
our generic code.  Then, in our object-specific action implementations (they
extend the abstract class and then also contain the perform method) we make
calls to the various generic methods defined in the abstract class.  
Depending on the situation, we will pass in a (EJB) home reference to a
method and that method will then make the appropriate method calls to the
session bean.  To get data back and forth, we have a second method on the
object-specific actions (because the data is different for different
objects) wherein we set values on a "data object" that the bean uses for
running queries, etc. 

Basically sample syntax is: data.setSomeId(form.getSomeId());   

We simply call this method when calling the session bean's method that
requires the data, and then pass the data object in.  It's certainly not the
best way to do this -- there are more efficient ways to populate the data
object but we hit certain limitations process-wise and time-wise and this is
where we are.  All short-comins aside, it does get the job done. :)  

BTW -- The mapper framework looks extremely promising and I'm interested to
try it out shortly, just wish time would provide itself. :P

Chris


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: struts w/ej

2001-07-10 Thread Rey Francois

Paul,
 
The problem you are facing is exactly what I tried to solve in the mapper
framework I'm developing. I'm still working on it, but plan to have another
more mature release within a week. In the meantime you can see an early
release on Ted's site
http://www.husted.com/about/struts/resources.htm#extensions
 . I've made an
earlier posting in the dev list giving some background info, see
http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg02058.html
 .
 
Feedback welcomed,
 
Fr.
 
 

-Original Message-
From: Paul Beer [mailto:[EMAIL PROTECTED]]
Sent: 09 July 2001 22:55
To: [EMAIL PROTECTED]
Subject: struts w/ej


i have followed some old threads about this but see no resolution to how to
map the struts form bean to EJB value objects; they all seem to allude to a
mysterious an non-existent struts 1.1.  is it recommended to do validation
from within the form bean and then create a value object w/the data for the
EJB or to do the validation in the value object?  Seems like duplicate work
to create a form bean and a value object for an ejb, but if you dont , then
the html form is dangerously coupled with the functioning of the EJB which I
am trying to avoid in my application design.  Can people give some real
world examples of this ?  And on a technical note, if you use the struts
form bean to instantiate and populate a value object how is it passes to the
action?  are people just putting it in the http session ?  sample code would
be helpful.
 
-paul



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: specifying multiple forms in an action mapping

2001-07-10 Thread Rey Francois


Purely using the struts-config.xml/struts tags, it is not possible to have
two forms for one mapping.
But why do you need this?
I suppose you want one HTML form to populate two form beans, is this right?
My suggestion then would be to either give up on this idea or to have a
third form that encapsulates the two others, while exposing both set of
properties.

Fr.

-Original Message-
From: Grassotti, Michael [mailto:[EMAIL PROTECTED]]
Sent: 09 July 2001 22:27
To: [EMAIL PROTECTED]
Subject: RE: specifying multiple forms in an action mapping


Has anyone gotten back to you on this? I'm having the same problem...

> -Original Message-
> From: Narasimhan, Shyamala [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 04, 2001 9:21 AM
> To: [EMAIL PROTECTED]
> Subject: specifying multiple forms in an action mapping
> 
> 
> hi
> 
> i would like to use two different forms in an action class... 
> kindly advise
> as to how to specify the action mapping
> 
> thanks
> 
> shyamala.


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: jsp vs do

2001-07-02 Thread Rey Francois

Probably because you want to remain faithful to the MVC approach: only the
controller should decide where to dispatch a request. Linking JSPs together
directly can lead to a spaghetti mess. What you want is one central point
where the request dispacthing is done (the ActionServlet) so you can easily
change it later on for all pages containing a certain request. This is why
is's better to go through the ActionServlet (using .do instead of .jsp).
Your login.jsp may not need some pre-processing logic at present, but in the
future you may have the requirement to do so later on, in which case you
need an Action and a mapping in struts-config.xml (the MVC approach
recommends that you do not put such logic directly in the login.jsp itself).

Fr.

-Original Message-
From: Bob Byron [mailto:[EMAIL PROTECTED]]
Sent: 02 July 2001 18:56
To: struts-user
Subject: jsp vs do


I am still in the early stages of understanding struts
and would like to know a bit more about the jsp vs do
extensions.  In looking at the index.jsp page of the
struts-example, you see two links.  
"Register with the MailReader Demonstration
Application" links to editRegristration.do (***DO***)
"Log on to the MailReader Demonstration Application"
links to login.jsp (***JSP***)
Why was the register page linked to a "do" instead of
a "jsp" page?  Why was the login page linked to a
"jsp" instead of a "do"?  I do understand that the
"do" takes you through the struts actions, but don't
understand why the login link was set to login.jsp
instead of login.do initially.  (I am not asking
"What" it does so much as I am asking "Why" was the
decision made to do it that way.)

Thank You,
Bob Byron



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: jsp vs do

2001-07-02 Thread Rey Francois

Oops forget my answer, I did not read well enough the question in the first
instance, sorry.
Fr.

-Original Message-
From: Rey Francois 
Sent: 02 July 2001 18:56
To: '[EMAIL PROTECTED]'
Subject: RE: jsp vs do


Probably because you want to remain faithful to the MVC approach: only the
controller should decide where to dispatch a request. Linking JSPs together
directly can lead to a spaghetti mess. What you want is one central point
where the request dispacthing is done (the ActionServlet) so you can easily
change it later on for all pages containing a certain request. This is why
is's better to go through the ActionServlet (using .do instead of .jsp).
Your login.jsp may not need some pre-processing logic at present, but in the
future you may have the requirement to do so later on, in which case you
need an Action and a mapping in struts-config.xml (the MVC approach
recommends that you do not put such logic directly in the login.jsp itself).

Fr.

-Original Message-
From: Bob Byron [mailto:[EMAIL PROTECTED]]
Sent: 02 July 2001 18:56
To: struts-user
Subject: jsp vs do


I am still in the early stages of understanding struts
and would like to know a bit more about the jsp vs do
extensions.  In looking at the index.jsp page of the
struts-example, you see two links.  
"Register with the MailReader Demonstration
Application" links to editRegristration.do (***DO***)
"Log on to the MailReader Demonstration Application"
links to login.jsp (***JSP***)
Why was the register page linked to a "do" instead of
a "jsp" page?  Why was the login page linked to a
"jsp" instead of a "do"?  I do understand that the
"do" takes you through the struts actions, but don't
understand why the login link was set to login.jsp
instead of login.do initially.  (I am not asking
"What" it does so much as I am asking "Why" was the
decision made to do it that way.)

Thank You,
Bob Byron



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: validation

2001-07-02 Thread Rey Francois


Ted,

Do you think this approach of splitting validation between both the
ActionForm.validate() and the Action.perform() is the most desirable?
Somehow I have the feeling that by extracting these validations into
separate classes is a better approach because it makes it easier to reuse
the validation logic, which is one of the benefit of having validation
framework. The real question then is whether this framework should only do
the domain-type checking or should also support the business logic checking.
I think it should support both, especially if you can also separate them
within the same framework.

Fr.

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 02 July 2001 18:04
To: [EMAIL PROTECTED]
Subject: Re: validation


The general thinking is that there are at least two levels of
validation. First, there is the simple domain-type checking, such as
fields that are suppose to be numeric should contain only numerals.
Second, there is business-logic checking, like invoice numbers are all
greater than 1000 or no start dates should occur before 1984, or that
the username and password match. 

The first type is easy to automate and doesn't require access to the
business logic, so we have a standard method that you can override if
you want to do that as part of your ActionForm. With that method, there
would not be a good place for you to plug-in simple validations.

The second type gets to be application specific, and is usually handled
in the Action perform method. Since you are already overriding perform,
there didn't seem to be much value in providing a yet another method to
override here. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


"Gogineni, Pratima" wrote:
> Please let me know if I am missing something / got something wrong ...
>
>I which case should we not have a validate method in the action classes
too?
>
> On second thoughts ...I guess if there is some validation common to all
the
> actions its probably better to place it in the actionform even if it means
> looking at information outside the view/form itself?
> I which case should we not have a validate method in the action classes
too?
> 
> Thanks
> Pratima


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: validation

2001-07-02 Thread Rey Francois

Don't forget as well the validation framework from David, which normally
should be integrated into Struts at some point.
Fr.

-Original Message-
From: Rey Francois 
Sent: 02 July 2001 13:58
To: '[EMAIL PROTECTED]'
Subject: RE: validation



There would a few pros and cons for each of the approaches you mention,
making the choice difficult.

A third approach is to have the validation extracted into another set of
classes, so that neither the ActionForm nor the Action itself contain the
real validation logic. The mapper framework I'm working on does such a
thing. I've made an early release available on Ted Husted site
(http://www.husted.com/about/struts/resources.htm#extensions) if you're
curious.

Fr.


-Original Message-
From: Gogineni, Pratima [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 18:45
To: '[EMAIL PROTECTED]'
Subject: RE: validation


On second thoughts ...I guess if there is some validation common to all the
actions its probably better to place it in the actionform even if it means
looking at information outside the view/form itself?

-Original Message-
From: Gogineni, Pratima 
Sent: Friday, June 29, 2001 9:41 AM
To: '[EMAIL PROTECTED]'
Subject: validation


Hi,

I have a design question about validation in struts. So far I had been doing
most of my validation in my action classes rather than in my actionform.

I was just looking into moving some of the validation into the validate
method of the action form and find that I have to access some information in
the servlet context to do this since the action form itself does not have
all the information to do the complete validation.

I was thinking that this has a couple of problems - 
1. performance since I have to access the same info again in the action
classes. 
2. I feel it is messy because I am making my actionform which is just a
piece/view of the whole picture access information that is outside the view
itself ...

All of the above leads me to believe that most of the heavy duty validation
should happen in the action class. The actionform only does some minor
validation like maybe checking for null (basically just using the
information it knows).

I which case should we not have a validate method in the action classes too?

Please let me know if I am missing something / got something wrong ...

Thanks
Pratima


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: validation

2001-07-02 Thread Rey Francois


There would a few pros and cons for each of the approaches you mention,
making the choice difficult.

A third approach is to have the validation extracted into another set of
classes, so that neither the ActionForm nor the Action itself contain the
real validation logic. The mapper framework I'm working on does such a
thing. I've made an early release available on Ted Husted site
(http://www.husted.com/about/struts/resources.htm#extensions) if you're
curious.

Fr.


-Original Message-
From: Gogineni, Pratima [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 18:45
To: '[EMAIL PROTECTED]'
Subject: RE: validation


On second thoughts ...I guess if there is some validation common to all the
actions its probably better to place it in the actionform even if it means
looking at information outside the view/form itself?

-Original Message-
From: Gogineni, Pratima 
Sent: Friday, June 29, 2001 9:41 AM
To: '[EMAIL PROTECTED]'
Subject: validation


Hi,

I have a design question about validation in struts. So far I had been doing
most of my validation in my action classes rather than in my actionform.

I was just looking into moving some of the validation into the validate
method of the action form and find that I have to access some information in
the servlet context to do this since the action form itself does not have
all the information to do the complete validation.

I was thinking that this has a couple of problems - 
1. performance since I have to access the same info again in the action
classes. 
2. I feel it is messy because I am making my actionform which is just a
piece/view of the whole picture access information that is outside the view
itself ...

All of the above leads me to believe that most of the heavy duty validation
should happen in the action class. The actionform only does some minor
validation like maybe checking for null (basically just using the
information it knows).

I which case should we not have a validate method in the action classes too?

Please let me know if I am missing something / got something wrong ...

Thanks
Pratima


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: String indexing in beans (was: Global values as Tag parameters... .How???)

2001-07-02 Thread Rey Francois


I though about using curly braces as well. What stopped me using them was
the possible conflict with MessageFormat arguments. It may not be a strong
argument, but I still preferred using another pair of symbols. The other
reason is because when accessing a Map you call a method and use normal
brackets, so I though I would keep the simple idea of [] for arrays and ()
for maps (even though the semantic is different, one being a real index, and
the other a method call). This is actually more or less what you advocate by
saying ()=method call, isn't it?

I'd love to see this extension incorporated into the commons as well. I
think it would just take a few developers/committers supporting this idea.

Any other opinion on both of these topics (standardization + integration)?

Fr.

-Original Message-
From: Immanuel, Gidado-Yisa [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 18:01
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: String indexing in beans (was: Global values as Tag
parameters... .How???)


For Rey's extensions to PropertyUtils, if I want to traverse my
bean-object, I should be able to do something like this:

 property="report.matrix(Accounts).column(DateCreated).row[1]"

Rey's extension is great.  I would suggest however, replacing
the '(' and ')' parenthesis with curly braces: '{' & '}'.  Just
because, I tend to think:

 () - method/function
 [] - array index
 {} - perl-style hash-association

My question to the community is, "Can we standardise" on the
convention for string indexing (namely, with regards to delimiters),
so that when some of these extensions find there way into tag
hanlders like bean:write and bean:define, there will not be
any backward compatibility issues?

On a related note, any idea what it would take to get extensions
such as these incorporated into JakartaCommons.BeanUtils?  I'm
assuming that Struts will be using the JakartaCommons.BeanUtils
as soon as it becomes available; any clarification on this would
be helpful.

Thanks,
Gidado

-Original Message-
From: Rey Francois [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 2:48 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Global values as Tag parametersHow???


I have extended the PropertyUtils so that it can support as well what we
call 'string keyed' properties. It's part of the mapper framework I made
publicly available recently (
http://www.husted.com/about/struts/resources.htm#extensions
<http://www.husted.com/about/struts/resources.htm#extensions> ).
Have  look at it and you may be able to do what you want.
 
Fr.

-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 20:51
To: [EMAIL PROTECTED]; Jonathan
Subject: Re: Global values as Tag parametersHow???



I imagine you'll have to parse that attribute yourself and use reflection to
get that value.  I don't think Struts has support for this.  It might be
difficult to keep it generic however, since I don't think there is way you
can access the imports that are declared in a JSP page.
 
Of course, there's always this:
 

 
Calvin

- Original Message - 
From: Jonathan <mailto:[EMAIL PROTECTED]>  
To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
Sent: Wednesday, June 27, 2001 10:03 AM
Subject: Global values as Tag parametersHow???

I am creating a custom Struts tag which needs to search for an object in a
HashMap.  I want the 'key" for the object in the HashMap to be some agreed
upon, pre-defined, final global value defined in a file available to the
whole application.  How do I refer to this value in a Tag attribute?
 
eg.

 
where "Globals.MESSAGES_OBJECT" is some static final variable in a file



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Non-Web-based Application with STRUTS

2001-06-29 Thread Rey Francois

I have no experience with this but the TCF from IBM may be of help.
It is based on MVC so perhaps you can combine it with Struts MVC.

Fr.

::: Thin-Client Framework
Thin-Client Framework (TCF) is a framework and design/development
approach that makes it easy to rapidly develop high function,
extendable and responsive distributed clients in Java.
http://alphaworks.ibm.com/tech/tcf?open&1=NT0601,t=awflash

-Original Message-
From: Andreas Dejung [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 15:21
To: [EMAIL PROTECTED]
Subject: Non-Web-based Application with STRUTS


Hi there

I have done some prototyp with Struts.
Now a new requirement is that the application runs not only  with a Broser.
It should also run with a fat java client.

Has somebody experiences with this?

Is it possible? and if yes, with what kind of architecture?


I very intressted in your answer


Andy






*** PLEASE NOTE ***
This message, along with any attachments, may be confidential or legally
privileged.  It is intended only for the named person(s), who is/are the
only authorized recipients. If this message has reached you in error,
kindly destroy it without review and notify the sender immediately. Thank
you for your help.
**


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: concatenating resources files - in which class?

2001-06-28 Thread Rey Francois

You could also avoid merging them by having multiple resources loaded into
the app. This is not directly supported by Struts though. The way we have
done this in our project is by extending the ActionServlet and having it
load multiple resources in the same way the application resources are loaded
(in initApplication). All these resources are then placed in the application
context (servlet context). Then you can use the parameter 'bundle' of the
message tag to select which message resources to use. If you follow this
route I suggest you don't create a message resource for each JSP, especially
if you have many of them, but rather for each logical grouping of JSP.
 
Fr.

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]]
Sent: 28 June 2001 13:08
To: [EMAIL PROTECTED]; Jonathan
Subject: RE: concatenating resources files - in which class?



I wouldn't put them anywhere in your code - I'd use some kind of deployment
script to concatenate them and copy them to the appropriate directory.
 
Niall

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 16:57
To: [EMAIL PROTECTED]
Subject: concatenating resources files - in which class?


Anyone have any suggestions as to where in the code I should concatenate my
multiple resource files?  I actually would like the resource files to be in
the same directory as the templates to which they pertain (ie in with the
jsp files).  Assuming I put my jsp's in WEB-INF/pages, I guess I would have
to put the WEB-INF in the classpath as well so that the properties files are
visible to the ActionServlet.



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Global values as Tag parameters....How???

2001-06-28 Thread Rey Francois

I have extended the PropertyUtils so that it can support as well what we
call 'string keyed' properties. It's part of the mapper framework I made
publicly available recently (
http://www.husted.com/about/struts/resources.htm#extensions
 ).
Have  look at it and you may be able to do what you want.
 
Fr.

-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 20:51
To: [EMAIL PROTECTED]; Jonathan
Subject: Re: Global values as Tag parametersHow???



I imagine you'll have to parse that attribute yourself and use reflection to
get that value.  I don't think Struts has support for this.  It might be
difficult to keep it generic however, since I don't think there is way you
can access the imports that are declared in a JSP page.
 
Of course, there's always this:
 

 
Calvin

- Original Message - 
From: Jonathan   
To: [EMAIL PROTECTED]   
Sent: Wednesday, June 27, 2001 10:03 AM
Subject: Global values as Tag parametersHow???

I am creating a custom Struts tag which needs to search for an object in a
HashMap.  I want the 'key" for the object in the HashMap to be some agreed
upon, pre-defined, final global value defined in a file available to the
whole application.  How do I refer to this value in a Tag attribute?
 
eg.

 
where "Globals.MESSAGES_OBJECT" is some static final variable in a file



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Form Bean Validation

2001-06-28 Thread Rey Francois

Jonathan,

I'm not sure yet I understand exactly what you need yet, and why validation
on the setter methods of the form would help you. But have a look at the
mapper framework I made publicly available recently
(http://www.husted.com/about/struts/resources.htm#extensions). It does not
do validation on the setter method of the form, but it may be flexible
enough for you to do more than just validating. You could imagine a mapper
that actually contains more mappings than there is fields in the form. Those
extra mappings could for example provide you with the ability to specify the
SQL statement. You could create with this framework some custom validator
classes that allow you to specify valid ranges, default values, etc. Almost
every XML element in the mapper config file supports one or more child
'set-property' elements like in struts-config.xml, so you can use that
pattern to customize several instances of the same class of
validators/converters that are registered with the mappers.

Fr.

PS: I'm sending this also to you Jonathan personally because for some
reasons I do not see messages I posted on the list recently... Perhaps
they've change the setup so that one does not get his own postings?



-Original Message-
From: Jonathan Fuerth [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 20:03
To: [EMAIL PROTECTED]
Subject: Re: Form Bean Validation


On Wed, Jun 27, 2001 at 09:27:13AM -0700, David Winterfeldt wrote:
> The ActionForm is considered to be a container for
> holding and preserving the information the user has
> entered.  So you don't want to reject any data at this
> level because if the validation fails you want to
> return exactly what the user has entered.  So most

Aha!  Ok, that makes a few things clearer in my head.  Unfortunately,
it also raises some new questions. :)

For instance, how would you go about modeling this generic and (I
imagine) common web-application scenario:

-A server-side validated form is presented to the client, who is
expected to make mistakes.
-The server catches the mistakes and presents the previous values to
the user, flagging the ones that need to be re-entered.
-Finally, the user gets everything right.  A page is presented to the
user which summarises the input, along with an "accept" or "cancel"
choice at the bottom.
-The user gives the go-ahead, and the correct information is stored in
a JDBC-accessed database.
-Later, the user (or other interested parties) will be presented with
this data.

This is essentially what I've been trying to figure out for a year now
(when I first got into servlets).  In my experience, the fields in the
form will change fairly often, as will their default values and
acceptable ranges.  What I'm aiming for is to be able to perform this
sequence of events for any given set of database-stored data, while
only specifying the labels, datatypes, defaults, accepted ranges, and
underlying SQL statements once (and hopefully in one place, but that
may be too much of a stretch).

Have you (or other struts users) managed this feat yet?  I'm very
interested in anything anyone has to say on this topic.. It's become
an obsession (since my full-time job is to design and implement
java-based, RDBMS-backed web applications).


> * When the exception/validation happens in the setter,
> you can't do things that depend on other fields.  Like
> this field is required only if another field is filled
> in.

Ok, excellent point.  That JavaBeans constrained property model kind
of relies on an AWT/Swing-type GUI, where this isn't an issue.  As
you've observed, it's certainly an issue in a web application.
Dependant fields would have to be informed whenever their dependencies
change value.

> Also the current system isn't able to handle an
> exception being thrown during the auto-population of
> the ActionForm from the request.

Ok.  It sounds like I'll have to make a similar (but different) bean
to each FormAction bean which does the actual database manipulation
and stuff.  That throws me off my little quest for the
single-specification-of-everything-in-the-form paradigm. :)

Thanks for your reply.


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Indexed Properties

2001-06-28 Thread Rey Francois

The problem is that your getUsers() return an array of User instances while
your getUsers(int i) returns a String.
As a result the PropertyDescriptor class for the users property will
consider the User class as the type of your property, and will check the
existence of User getUsers(int i) and void setUser(int i, User user).

You must make sure that indexed and non-indexed read/write methods use the
same type.

Fr.

-Original Message-
From: Jason Rosenblum [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 18:21
To: '[EMAIL PROTECTED]'
Subject: Indexed Properties


Hello all,

I'm trying to get my code to work with indexed properties. Thanks to Dave
Hay and his Struts tweak, I was able to generate input types like this:



using the following Struts tags:



The problem is that I cannot get my ActionForm to pick up these input
fields. I wrote several setters and getters in my ActionForm:
   /**
 * Return the users.
 */
public String getUsers(int i) {

return (users[i].getUsername());

}


/**
 * Set a user.
 *
 * @param user
 * @param index
 */
public void setUsers(int i, String user) {
this.users[i].setUsername(user);

}
 
 
/**
 * Return the users.
 */
public User[] getUsers() {

return (this.users);

}


/**
 * Set a user.
 *
 * @param user list
 */
public void setUsers(User[] users) {
this.users = users;

}
 
/**
 * Return the roles.
 */
public String getRoles(int i) {

return (users[i].getRole());

}


/**
 * Set a role.
 *
 * @param role
 * @param index
 */
public void setRoles(int i, String role) {

this.users[i].setRole(role);

}
 
 
/**
 * Return the roles.
 */
public User[] getRoles() {

return (this.users);

}


/**
 * Set a role.
 *
 * @param role list
 */
public void setRoles(User[] roles) {

this.users = users;

} 


Do you see anything wrong with this scheme? Currently, the ActionForm
returns null for all items in the User[] when I call any of the get methods.
Please help.

~Jason


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Delegating the request processing to an Action class

2001-06-27 Thread Rey Francois


This will work as well indeed, and is a lot simpler than what I suggested.
However it will go through the web server layers again before it gets to the
container and then the ActionServlet, which will do the usual things as with
any request. The solution I proposed was more an optimized solution and
should be considered only if performance is an issue. We actually developped
this solution as part of a DispatcherAction, which we use in forms so that
the submit can forward to more than one action (using a parameter which
contains the action path preceded by a special prefix).

Fr.

-Original Message-
From: Oleg V Alexeev [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 14:39
To: [EMAIL PROTECTED]
Subject: Re: Delegating the request processing to an Action class


Hello ssuku,

Wednesday, June 27, 2001, 4:24:58 PM, you wrote:



shhc> Hi,
shhc>  How can a  request processing be delegated from an Action class
to
shhc> another?

shhc> Thanks
shhc> Sandhya

Return forward to another action -

 return new ActionForward( "someaction.do" );



-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Delegating the request processing to an Action class

2001-06-27 Thread Rey Francois

I while ago I had the same question. It was a bit tricky at that time and
don't know if it's made any easier now.
The problem is that you can always create your own instance of the Action,
but this is not the ideal solution.
Ideally you would like to use the instance cached by the ActionServlet.

Here is how we solved this problem.

1- Derive from the ActionServlet and create this method:
public Action getAction(ActionMapping mapping, HttpServletRequest
request)
{
return processActionCreate(mapping, request);
}

You have to do this because the processActionCreate is protected in
ActionServlet.

2- In struts-config.xml, you need to have a mapping that maps to the action
you want to delegate to. Then the following code should work in your Action:

//Find the mapping
ActionMapping aMapping = getServlet().findMapping("/" + match);

//Retrieve the action instance, associated with the actionmapping
Action delegate = ((MyServletClass)getServlet()).getAction(aMapping,
request);

//This will return an ActionForward
return delegate.perform(aMapping, form, request, response);


If you don't have or don't want to have a mapping for your delegate action
in struts-config.xml, then you can directly access the actions cache in your
servlet like it is done in processActionCreate()


Hope this helps,

Fr.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 14:25
To: [EMAIL PROTECTED]
Subject: Delegating the request processing to an Action class




Hi,
 How can a  request processing be delegated from an Action class to
another?

Thanks
Sandhya



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




RE: Problem with resources when extending ActionServlet

2001-06-27 Thread Rey Francois

Make sure you call super.init() in the init() method of your subclass.
Fr.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 14:21
To: [EMAIL PROTECTED]
Subject: Problem with resources when extending ActionServlet


The struts documentation states than extending ActionServlet is
unproblematic. However, as soon as I do this (regardless of the
subclass's functionality), I run into the following exception:

Internal Servlet Error:

javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at javax.servlet.ServletException.(ServletException.java:161)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:459)
at
_0002ftest_0002ejsptest_jsp_1._jspService(_0002ftest_0002ejsptest_jsp_1.
java:87)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Com
piled Code))
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49
8)
at java.lang.Thread.run(Thread.java:481)

Root cause: 

javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at javax.servlet.jsp.JspException.(JspException.java:73)
at
org.apache.struts.util.RequestUtils.message(RequestUtils.java:568)
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at
_0002ftest_0002ejsptest_jsp_1._jspService(_0002ftest_0002ejsptest_jsp_1.
java:68)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:797)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Com
piled Code))
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:49
8)
at java.lang.Thread.run(Thread.java:481)

This is running under Tomcat 3.2.1.

Any ideas?



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




JSP Components

2001-03-08 Thread Rey Francois


In the context of building reusable JSP components, I have been confronted
with the following limitation that both the Struts templating and the
Components from Cedric Dumoulin currently have.

In a word, this limitation is actually due to the fact that none of them
provide a way to perform an action specific to the included JSP. For
example, an application home page may be composed of a body that actually
corresponds to another page in the web application. In this case, the body
is already modeled with a mapping and an action that performs the necessary
logic to retrieve the dynamic content. When servicing the home page, one
would logically like to reuse that action in order to avoid the duplication
of its logic in the action servicing the home page.

One way to do this would be to directly call the action to reuse within the
perform() of the action servicing the home page. However this is not very
flexible because it requires manual intervention.

My short research in past postings actually seems to indicate that this
problem has been mentioned before under various forms. A proposal for a
portal framework was discussed before, and such framework would require such
feature. In one instance the Jetspeed framework was considered for
integration with Struts. In another case one talked about allowing the
ActionServlet to do both forwards and includes.

My questions then are:
- has anybody else been confronted to this limitation, and if so, did you
avoid the problem (for example by using frames) or did you find a solution? 
- would such a feature be considered for inclusion in either Struts or the
Components framework from Cedric Dumoulin?
- anybody having further thoughts on this issue?

Thanks for your feedback on this topic.

François Rey
Financial WebSuite
The Capital Markets Company
http://www.capco.com/



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
The Capital Markets Company.

http://www.capco.com
***




RE: TogetherJ patterns

2001-02-28 Thread Rey Francois

We're using in a pilot project the JSP pattern from TJ4.2. We're now
thinking of doing more customization along those lines:
- Improvement of the existing JSP pattern:
   - add the bean name to the dependency link between the JSP and the used
beans.
   - automatically create the corresponding Page context class (an class on
which we describe the expected attributes in the page context)
- New Request pattern
   - create a new request class with an inner class Parameters
- New Action pattern
   - creates a new action class inheriting from the correct Action base
class (setting somewhere)
- New ActionForm pattern
   - creates a new ActionForm class inheriting from the correct ActionForm
base class (setting somewhere)

Has anybody done anything similar?

François Rey
Financial WebSuite
The Capital Markets Company
http://www.capco.com/

-Original Message-
From: Sebastien Cesbron [mailto:[EMAIL PROTECTED]]
Sent: 16 February 2001 15:18
To: [EMAIL PROTECTED]
Subject: TogetherJ patterns


Did anibody try to use TogetherJ patterns to create a struts project
with this CASE tool ? If yes, is it possible to have any feedback ?

Thanks

Seb
 

__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of
The Capital Markets Company.

http://www.capco.com
***




RE: Data Validation

2001-02-06 Thread Rey Francois


In our case, we have chosen to use the java.text.Format as a superclass of
all our validation and formatting classes. I would suggest Struts to
consider this approach. Our decision derives from the following
requirements:

1 Validation of Strings data according to a specified format
The basic requirement is to validate that a string complies to a specified
format. For example, for a string representing a date, the requirement is to
make sure it is of the form: dd/mm/.

2 Parsing Strings to Objects and vice-versa
Beyond the simple aspect of validating the format of an input string, it is
also often required to transform the validated string into a usable form for
further processing. In Java this means creating an object instance from the
string. With the date example, this could mean creating a java.util.Date
object.
On the other hand, it is also required to perform the reverse operation. In
the case of an instance of a java.util.Date, it should be possible to get a
string representation of it according to a specified format.

3 String buffer parsing and formatting
It should be easy to parse only a certain part of a larger string when the
latter contains the formatting of several elements. Conversely, it should be
easy to append the string representation of an object to an existing string.
This can be useful for example in the context of marshalling object
instances into an XML representation.

4 Independence of the usage context
The classes involved should be coupled to any context of usage. This is to
allow maximum reuse of the logic in various contexts. For example the
framework should not depend on the HTTP request of the Servlet API.
This should enable the creation of a library of formatter that can be used
in various projects. This library can contain basic formatters, but also
more business oriented ones such as account number formatting, etc.

5 Internationalization
In some cases it is necessary to have the parsing and validation processing
aware of locale-specific factors. The date example is again a very good
illustration of this requirement, whereby in the United States dates are of
the form mm/dd/, while in Europe dates are of the form dd/mm/. In
the context of a graphical user interface, this is an important requirement.

The java.text.Format class satisfies all the above requirements. It is a
standard Java object, so using it should be consistent with future Java
developments. Finally, J2SE already proposes some formatters for numeric
values, date, and messages.

In our context, these format classes will be used for:
- HTTP request parameter validation
- Handling of request and return buffer to and from legacy systems
- Displaying of the data elements in an HTML front-end

Eventually, beyond the use of Format classes, we intend to create a sort of
format class instance pool, whereby pre-initialized format classes are
stored for repetitive usage. This avoids the creation and initialization of
an object each time a validation/formatting has to be performed. The Struts
digester would be a great tool for initializing this pool.

Comments welcomed!

François Rey
Financial WebSuite
The Capital Markets Company
http://www.capco.com/


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2001 01:01
To: Struts List; [EMAIL PROTECTED]
Subject: Re: Data Validation


On 2/4/2001 at 11:52 PM Neal Kaiser wrote:
>Just wondering...  Where do people typically do their validation? In
the
>ActionServlet or ActionForm? Are there any pros/cons?

Validation is still rather controversial. Some people bypass the Struts
mechanism completely. 

Typically, you would start by validating the type and range of data in
ActionForm. Once that passes, you might need to do some further
"business logic" validation in the ActionServlet; for example, to check
a login from a database. 


*** REPLY SEPARATOR  ***


>Has anyone thought about adding data validation tags to the Struts
taglibs?
>
>For example, what if we could do:
>
>
>
>or something like that.
>
>Could it not generate the necessary javascript, as well as provide an
easy
>to use
>interface for detecting and reporting errors in the Action.perform()?
>
>Just wondering...  Where do people typically do their validation? In
the
>ActionServlet
>or ActionForm? Are there any pros/cons?
>
>Thanks,
>Neal



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual sender,
except where the sender specifically states th