Re: how to edit an array of records with action forms?

2002-03-06 Thread Arron Bates

If you're on a nightly build, you'll have the nested extension already 
there. It will help you make light work of iterating objects.

For a pimer and tutorial, go here...
http://www.keyboardmonkey.com/struts

And for mor implementation detail for each of the tags, the Struts site 
has the most complete info.

Arron.

Ian Tomey wrote:

>Hi all,
>
>Got an array of records and I want to put them onto the screen to edit. What is the 
>technique to go about this? (i am using the nightly 1.1 at the moment)
>
>is it create an action form that maps a single record and create a load of them? or 
>create an action form with the properties being arrays of the information?
>
>one form in total or one form per record?
>
>i take it the indexed= attribute for the html tags is going to be useful?
>
>It's not obvious how to do this and I just dont have time to expriement (deadline to 
>meet). Any help appreciated
>
>Cheers
>Ian
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: simper-NeXt

2002-03-06 Thread Arron Bates

Because NeXt is an extension of the original tags, it uses whatever the 
original tags use to get their logic happening. BeanUtils was adapted 
for DynaBeans, all the tags use BeanUtils, and so therefore, all the 
tags can use DynaBeans. Including the nested ones.

In regards to how everything fits together... a well based technology is 
a well based technolgy. From java itself all the way up to the 
construction of Struts itself. All done to a very high standard. You 
look at some of the code in java's standard API's... some of it is 
simply brilliant.

Arron.

John Menke wrote:

>>>DynaBeans/DynaClasses are supported by the latest (nightly builds) of
>>>the other "beanutils" classes, which is why the Struts tags like
>>>, , etc., all work with SimperBeans (and why
>>>I chose DynaBeans as a basis).
>>>
>
>I guess that this is what handles the "conversion" of a getProperty method
>into a get(String property) method?
>
>>>Table columns, as well as relations, are represented as dynamic
>>>properties using the DynaBean/DynaClass mechanisms.
>>>
>
>So the get methods to relate beans should be handled in similar fashion?
>
>That's great if it's the case.  I will assemble a test of Simper-NeXt today
>and see if it works.  Amazing that everything fits together like this! I
>expected it to be more difficult.
>
>
>-Original Message-
>From: Bryan Field-Elliot [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, March 06, 2002 10:29 AM
>To: Struts Users Mailing List
>Subject: RE: simper-NeXt
>
>
>Simper's representation of a database row is in the class SimperBean.
>SimperBean is a relatively shallow extension of the DynaBean (actually
>DynaBean is an interface -- BasicDynaBean is a concrete class which
>SimperBean extends) -- see the commons project "BeanUtils" for the
>source to DynaBean.
>
>Table columns, as well as relations, are represented as dynamic
>properties using the DynaBean/DynaClass mechanisms. It does NOT produce
>"get" and "set" methods for each column or relation. Instead, there is a
>single "get" method and a single "set" method, whose first parameter is
>the property name. This isn't a Simper convention, it's a DynaBean
>convention.
>
>DynaBeans/DynaClasses are supported by the latest (nightly builds) of
>the other "beanutils" classes, which is why the Struts tags like
>, , etc., all work with SimperBeans (and why
>I chose DynaBeans as a basis).
>
>With all that said, I really don't know much about the new Nesting tags
>or how they work. If they rely upon the same introspection mechanisms as
>, , etc., then they should work with Simper
>just fine. That's just a guess.
>
>Bryan
>
>
>On Wed, 2002-03-06 at 08:04, John Menke wrote:
>
>>> Just give it a bash. Run a simper model through the NeXt tags. I lay
>my
>>> money on it working as-is.
>
>Sounds great.  I will do this today.  Just trying to understand the
>internals a little better.
>
>>> So as long as the simper beans have bean property conformity (eg:
>>> getMyProperty, setMyProperty) then the beans are ready to go with
>NeXt
>>> as they are wihout mods. I'd be very surprised if it needed mods,
>>> really. You can use Castor types straight up because the properties
>are
>>> valid bean properties.
>
>I understand this it looks like Simper will create these methods
>property
>methods
>
>>> A nested bean is simply one object that is returned by the method of
>>> another.
>
>This is what was unclear to me.  I guess when you create relations
>between
>tables in Simper these get Methods to return another bean will be
>created in
>the SimperBean automatically?
>
>
>
>
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, March 06, 2002 12:47 AM
>To: Struts Users Mailing List
>Subject: Re: simper-NeXt
>
>
>Almost.
>NeXt is only working off of Bean properties, and as with all beans, it
>doesn't care as to what goes on behind those method definitions. The
>constructor is one of those details it cares not about.
>
>So as long as the simper beans have bean property conformity (eg:
>getMyProperty, setMyProperty) then the beans are ready to go with NeXt
>as they are wihout mods. I'd be very surprised if it needed mods,
>really. You can use Castor types straight up because the properties are
>valid bean properties.
>
>A nested bean is simply on

Re: NeXt question

2002-03-06 Thread Arron Bates

The real answer is... whatever makes a valid Struts form bean.

What I like is that only the top bean has restrictions. Every other 
level down doens't care in the slightest.

Arron.

John Menke wrote:

>Is it a requirement of NeXt that the outermost bean in a nested structure
>extend ActionForm?  The tutorial is structured in this manner but it does
>not appear to say this in the docs explicitly.  I'm guessing that having the
>outermost bean extend ActionForm is tied into having struts call the set
>methods of sub beans automatically.  Is this correct? Or can I use any type
>of bean (SimperBean) as the outermost bean.
>
>-john
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: simper-NeXt

2002-03-05 Thread Arron Bates

Almost.
NeXt is only working off of Bean properties, and as with all beans, it 
doesn't care as to what goes on behind those method definitions. The 
constructor is one of those details it cares not about.

So as long as the simper beans have bean property conformity (eg: 
getMyProperty, setMyProperty) then the beans are ready to go with NeXt 
as they are wihout mods. I'd be very surprised if it needed mods, 
really. You can use Castor types straight up because the properties are 
valid bean properties.

A nested bean is simply one object that is returned by the method of 
another. As each property getter method has "get" on the front of it, 
we're laughin'. At the point of changing a property, you'll need that 
"set" on the front of it, naturally. For example, to get the nesting 
level deeper in my Monkey examples, I had a "fake" nested property that 
returned "this".

eg:
public MonkeyBean getOtherMonkey() { return this; }

To the internals of BeanUtils (the part of Struts that makes it all 
happen), it's treated as an entirely different object. It makes no other 
assumptions, rightly so. The system is that explicit.

Just give it a bash. Run a simper model through the NeXt tags. I lay my 
money on it working as-is.

Arron.


John Menke wrote:

> I'm working through the Simper examples and the NeXt examples and 
> trying to
> understand how I can use both together. Here is what I have so far:
>
>
> In the NeXt you associate nested beans with a parent and children
> relationship by inserting a private member variable to the parent bean 
> the
> will create a new child bean:
>
> ie.
>
> 
>
> private BunchBean bunchBean = new BunchBean();
>
>
> This will give us a new instance of the BunchBean when this MonkeyBean is
> created. Just what we want. Now we need to provide the getter method 
> to the
> bean under the property name "pickedBunch". This will create a getter 
> which
> will look something like this example...
>
> Example...
>public BunchBean getPickedBunch() {
>  return this.bunchBean;
>
> 
>
> This enables you to make forms like this:
>
> 
>
> 
>Monkey Name: 
>Monkey Age: 
>
>
>  Bunch Size: 
>  Bunch Weight: 
>  Bunch Price: 
>
>
>
>Submit Form
>  
>
> 
>
> In order to use the NeXt with Simper it looks like the SimperBeans 
> will need
> to include methods like those above in order to establish the 
> relationship.
>
> Is this correct? If so, Simper will not work with the NeXt in it's 
> current
> form.
>
> I think if this can be coded Simper should be able to dynamically 
> update the
> contents of a database since the nested beans have their Set methods 
> called
> automatically since they are nested within the ActionForm bean?  
> (Aaron is
> this correct?)
>
> Inserts into the database will require creation of a new bean and can be
> handled by logic in the Action that will create a SimperBean with
> information obtained from the ActionForm.
>
> It says in the Simper source code comments that deletes happen
> automatically.  I'm not sure at the moment how this is going to work.  I
> think you could call the Simper delete method from an Action but not sure
> how the automatic part effects this.  Does the automatic feature of 
> deletes
> in Simper just mean that you don't have to call the writechanges() 
> method in
> Simper?
>
>
> Any comments and additions will be appreciated.  In my opinion, the
> integration of these two struts additions could be extremely useful.
>
> Bryan, (If we have to) do you think it's worth adding some code to 
> Simper to
> integrate with the NeXt?
>
> -john 




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




Re: simper-NeXt

2002-03-05 Thread Arron Bates

Almost.
NeXt is only working off of Bean properties, and as with all beans, it 
doesn't care as to what goes on behind those method definitions. The 
constructor is one of those details it cares not about.

So as long as the simper beans have bean property conformity (eg: 
getMyProperty, setMyProperty) then the beans are ready to go with NeXt 
as they are wihout mods. I'd be very surprised if it needed mods, 
really. You can use Castor types straight up because the properties are 
valid bean properties.

A nested bean is simply one object that is returned by the method of 
another. As each property getter method has "get" on the front of it, 
we're laughin'. At the point of changing a property, you'll need that 
"set" on the front of it, naturally. For example, to get the nesting 
level deeper in my Monkey examples, I had a "fake" nested property that 
returned "this".

eg:
public MonkeyBean getOtherMonkey() { return this; }

To the internals of BeanUtils (the part of Struts that makes it all 
happen), it's treated as an entirely different object. It makes no other 
assumptions, rightly so. The system is that explicit.

Just give it a bash. Run a simper model through the NeXt tags. I lay my 
money on it working as-is.

Arron.


John Menke wrote:

>I'm working through the Simper examples and the NeXt examples and trying to
>understand how I can use both together. Here is what I have so far:
>
>
>In the NeXt you associate nested beans with a parent and children
>relationship by inserting a private member variable to the parent bean the
>will create a new child bean:
>
>ie.
>
>
>
>private BunchBean bunchBean = new BunchBean();
>
>
>This will give us a new instance of the BunchBean when this MonkeyBean is
>created. Just what we want. Now we need to provide the getter method to the
>bean under the property name "pickedBunch". This will create a getter which
>will look something like this example...
>
>Example...
>public BunchBean getPickedBunch() {
>  return this.bunchBean;
>
>
>
>This enables you to make forms like this:
>
>
>
>
>Monkey Name: 
>Monkey Age: 
>
>
>  Bunch Size: 
>  Bunch Weight: 
>  Bunch Price: 
>
>
>
>Submit Form
>  
>
>
>
>In order to use the NeXt with Simper it looks like the SimperBeans will need
>to include methods like those above in order to establish the relationship.
>
>Is this correct? If so, Simper will not work with the NeXt in it's current
>form.
>
>I think if this can be coded Simper should be able to dynamically update the
>contents of a database since the nested beans have their Set methods called
>automatically since they are nested within the ActionForm bean?  (Aaron is
>this correct?)
>
>Inserts into the database will require creation of a new bean and can be
>handled by logic in the Action that will create a SimperBean with
>information obtained from the ActionForm.
>
>It says in the Simper source code comments that deletes happen
>automatically.  I'm not sure at the moment how this is going to work.  I
>think you could call the Simper delete method from an Action but not sure
>how the automatic part effects this.  Does the automatic feature of deletes
>in Simper just mean that you don't have to call the writechanges() method in
>Simper?
>
>
>Any comments and additions will be appreciated.  In my opinion, the
>integration of these two struts additions could be extremely useful.
>
>Bryan, (If we have to) do you think it's worth adding some code to Simper to
>integrate with the NeXt?
>
>-john
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: how do you enable/disable a text field based on a checkbox?

2002-03-05 Thread Arron Bates

JavaScript will be your only way, working off the checkBox's onclick 
handler. You could use the onchange handler but it's implementation is a 
little fuzzy across browsers. Use onlick, get the state of the checkbox, 
and do your thing with the other field.

Arron.

[EMAIL PROTECTED] wrote:

>With the given html tags for the struts and taglibs and such, is there an
>easy way to enable a corresponding textfield when you check the box?
>Is there an easy way to disable the corresponding textfield when you
>uncheck the checkbox as well as clear the text field.
>
>thanks,
>Theron
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Nesting Extension and persistance strategy--castor any one?

2002-03-05 Thread Arron Bates

Castor works a treat. If castor had finer grained validation mechanism, 
we could use it to validate automatically also and relieve another 
burden. I've used Castor before, but not as the model directly. But it's 
very possible. A very good system.

Castor, of course, does everything via XML Schema definition. But it's 
very complete.

Arron.


John Menke wrote:

>Rajesh,
>
>That sounds interesting.  I started looking at Castor also, but now I'm
>looking more into Simper.  Let me know how it goes maybe we can share notes.
>
>-john
>
>-Original Message-
>From: rajesh kalluri [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, March 05, 2002 11:32 AM
>To: Struts Users Mailing List
>Subject: Re: Nesting Extension and persistance strategy--castor any one?
>
>
>Hi All,
>
>I am not the expert in the field of designing OO persistence mechanisms.
>
>I am a fan of nested beans and also i have been playing with castor lately.
>
>So am thinking if we can map our monkey object schema to a db schema (I can
>hear a lot of thats easy). Then it should be a snap to marshall/unmarshall
>monkey beans  (nested in general) into XML files/ data base tables.
>
>I would start playing with it as soon as i have time.
>
>
>Regards
>Rajesh Kalluri.
>Manduca Management LLC,
>Suite 230, 5757 Blue Lagoon Dr.
>Miami, FL 33126.
>AIM: [EMAIL PROTECTED]
>Phone: 786-552-0521
>Fax: 786-552-0501
>
>- Original Message -
>From: "Arron Bates" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Monday, March 04, 2002 11:16 PM
>Subject: Re: Nesting Extension and persistance strategy
>
>
>>>
>>>I like beans managing dirty state becuause I could possibly have one
>>>method
>>>that can handle several different structures if it's designed right.
>>>
>>>Maybe this:
>>>
>>>Have all DataBeans implement an interface lets day DirtyInterface that
>>>defines
>>>2 methods:
>>>
>>>public String getDirtyAttribute() and
>>>public void callJDBC(String dirtyAttribute)
>>>
>>>the dirtyAttribute class member could be one of several values:
>>>
>>>insert
>>>update
>>>delete
>>>(select)
>>>
>>>callJDBCbean(String dirtyAttribute) would call a JDBCbean
>>>corresponding to
>>>the databean,
>>>not sure how to define this, maybe in a way similar to the mapping of
>>>Actions?
>>>
>>>So then in the Action associated with the ActionForm we could pass the
>>>ActionForm into a Method that will call getDirtyAttribute and
>>>callJDBCbean
>>>for each bean that is nested within the ActionForm.
>>>
>>>Having trouble thinking of way to iterate through the beans, but I think
>>>it's possible.
>>>
>>I think that to get it more in line with the stupid-model-paradigm (SMP?
>>:) your beans could manage their dirty state, but the actual persistence
>>management be handled by a separate object, that takes the bean types in
>>overloaded methods.
>>eg:
>>persistDirtyBean(Organisation org) {...}
>>persistDirtyBean(Team team) {...}
>>persistDirtyBean(Investor investor) {...}
>>persistDirtyBean(Portfolio portfolio) {...}
>>persistDirtyBean(Stock stock) {...}
>>
>>Then you could just throw whatever bean at it you needed. The class
>>itself could even iterate the tree itself, in that the Organisation
>>version of the PersistDirtyBean would get Team objects, and then from
>>this method could call the Team persist method for whatever team. Or you
>>can, in just as correct a manner, use it ad-hoc just throwing whatever
>>object. Means that the persist methods aren't living with their related
>>Object, so some OO guru may say it's not defending the faith.
>>
>>There's just so many ways you can attack this. But I think that you're
>>in the right frame of mind to take it on at least. :)
>>
>>>>>How complex are the types/structure of your hierarchy?...
>>>>>
>>>Pretty simple.  Actually it almost maps exactly to your example
>>>
>>>Organization
>>>Team
>>>Investor
>>>Portfolio
>>>Stock
>>>
>>Simple until you have to persist the thing. :)
>>My definition of simple is when making a table you have a bean with a
>>collection of one type of object, that can be retrieved and updated with
>>one query.
>>
>>Oh, I miss those days when people thought that just seeing data was
>>special...
>>...and that it was on the "Information Super-Highway"... there's a term
>>that brings on flash-backs.
>>
>>
>>Arron.
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: is there drawdown select box in struts?

2002-03-05 Thread Arron Bates

Remove the size="10" and watch what happens... :)

The size directly maps to Html, where you're telling it how many rows 
you want it to span. Has nothing to do with how many options you have, 
that part will look after itself.

Arron.

Struts Newsgroup (@Basebeans.com) wrote:

>Subject: Re: is there drawdown select box in struts?
>From: "zb cong" <[EMAIL PROTECTED]>
> ===
>thanks for your answer
>
>see my code
>
> 
>Single 0
>Single 1
>Single 2
>Single 3
>Single 4
>Single 5
>Single 6
>Single 7
>Single 8
>Single 9
>Single 9
>Single 9
>Single 9
>  
>
>it give me a single select "list" box,but i want a single select "dropdown"
>box,could you help me to modify my code?
>thank you again
>
>"Arron Bates" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED].;
>
>>You do mean "dropdown" don't you?...
>>
>>The  tag will do both lists and single select drop down
>>boxes, in the same way that the Html select tag does both.
>>
>>Arron.
>>
>>Struts Newsgroup (@Basebeans.com) wrote:
>>
>>>Subject: is there drawdown select box in struts?
>>>From: "zb cong" <[EMAIL PROTECTED]>
>>>===
>>>hello
>>>
>>>i find that the "" is a list select box,i wanna "drawdown"
>>>select box?
>>>
>>>how can i do?
>>>thank you very much!
>>>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
><mailto:[EMAIL PROTECTED]>
>
>>>For additional commands, e-mail:
>>>
><mailto:[EMAIL PROTECTED]>
>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Nesting Extension and persistance strategy

2002-03-05 Thread Arron Bates

John Menke wrote:

>I am planning to use the Nesting Extension...
>
sweet  :)

>The MonkeyStruts example uses one ActionForm bean on the outermost level
>that links to other beans recursively in a parent child heirarchy.  It looks
>like each child bean in the hierarchy is instantiated from methods called by
>it's parents class.
>
MonkeyStruts example was made only to be just that, an example. To make 
it easier to see where things are built, and move on to more important 
considerations.

>I suggest the following for persistance...
>
[ ... ]

>Is there a better way of doing this or am I on the right track?
>

No, you're pretty much on the ball really. The only thing that people 
pushing "best practices" will say is to make sure that you externalize 
the persistence management from the bean model itself. That said, it can 
also make life really easy if you drive it directly from within the bean 
model itself (Who said that!? :)

In practice, it will really depend on the nature of your data structure. 
If it's list style, you'd be mad not to simply drive it from a system 
that will query the DB loop through populating objects putting them in a 
list. But if it's a complex structure of different nested types (and 
lets face it, the nested tags make this possible now more than ever), 
you could drive it exactly as you've described having the beans manage 
their dirty state and have a one-to-one level mapping from the 
persistence mechanism to nested bean (ie: have each nested bean know how 
it's to be stored). There are various ways to take this back to the MVC 
paradigm keeping the model totally separate, using patterns etc.

Only to say that there's not one recommended system, as it will vary 
from requirement to requirement. Some persistence mechanisms, like XML 
marshaling, will get you from persistent storage to nested java objects, 
back to storage almost for free (although such systems don't have the 
brute force performance of a DB query). Where as a table structure page 
will be almost the typical top-down list approach. To the ultra simple, 
I've made a tiny web app that serializes the entire model to disk. The 
data in it was shared to all users, so there wasn't any 
concurrency/performance issues.

The nested tags can just be a simpler alternative to the usual Struts 
tags, taking the exact same consideration as a typical Struts app. 
Horses for courses I'm afraid.

How complex are the types/structure of your hierarchy?...


Arron.



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




Re: Nesting Extension and persistance strategy

2002-03-05 Thread Arron Bates

>
>
>I like beans managing dirty state becuause I could possibly have one method
>that can handle several different structures if it's designed right.
>
>Maybe this:
>
>Have all DataBeans implement an interface lets day DirtyInterface that
>defines
>2 methods:
>
>public String getDirtyAttribute() and
>public void callJDBC(String dirtyAttribute)
>
>the dirtyAttribute class member could be one of several values:
>
>insert
>update
>delete
>(select)
>
>callJDBCbean(String dirtyAttribute) would call a JDBCbean corresponding to
>the databean,
>not sure how to define this, maybe in a way similar to the mapping of
>Actions?
>
>So then in the Action associated with the ActionForm we could pass the
>ActionForm into a Method that will call getDirtyAttribute and callJDBCbean
>for each bean that is nested within the ActionForm.
>
>Having trouble thinking of way to iterate through the beans, but I think
>it's possible.
>

I think that to get it more in line with the stupid-model-paradigm (SMP? 
:) your beans could manage their dirty state, but the actual persistence 
management be handled by a separate object, that takes the bean types in 
overloaded methods.
eg:
persistDirtyBean(Organisation org) {...}
persistDirtyBean(Team team) {...}
persistDirtyBean(Investor investor) {...}
persistDirtyBean(Portfolio portfolio) {...}
persistDirtyBean(Stock stock) {...}

Then you could just throw whatever bean at it you needed. The class 
itself could even iterate the tree itself, in that the Organisation 
version of the PersistDirtyBean would get Team objects, and then from 
this method could call the Team persist method for whatever team. Or you 
can, in just as correct a manner, use it ad-hoc just throwing whatever 
object. Means that the persist methods aren't living with their related 
Object, so some OO guru may say it's not defending the faith.

There's just so many ways you can attack this. But I think that you're 
in the right frame of mind to take it on at least. :)

>>>How complex are the types/structure of your hierarchy?...
>>>
>Pretty simple.  Actually it almost maps exactly to your example
>
>Organization
>Team
>Investor
>Portfolio
>Stock
>

Simple until you have to persist the thing. :)
My definition of simple is when making a table you have a bean with a 
collection of one type of object, that can be retrieved and updated with 
one query.

Oh, I miss those days when people thought that just seeing data was 
special...
...and that it was on the "Information Super-Highway"... there's a term 
that brings on flash-backs.


Arron.



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




Re: Nesting Extension and persistance strategy

2002-03-05 Thread Arron Bates

Well, yeah. That'd do the trick too. Probably in a fashion that would be 
manageable, clean, and garner the respect of OO gurus, developers and 
peers alike. Very apt solution.

You can notify the observer from inside your setters rather than query 
the submit button. Mainly because you will have to do some checking to 
see if the data did change or if it's just being reset to the same 
thing. If you show a form, not change anything and submit it. The data 
may as well be totally different, as the bean properties will be set in 
each instance anyways. So in your setter you'll have to do comparisons 
on the incoming data, may as well just notify the observer while you're 
there.

Note: Don't commit or actually make changes as soon as a change is made. 
Otherwise you'll have an updates firing for every property, for every 
bean. And that would be bad. :) Just note down the changed beans, and 
kick off the commit from the observer from within your action. Then you 
know that all the bean processing is finished, and you can go ahead and 
mess with your bean states.

But to quote Ghostbusters... "yes, have some"
:)

Arron.

John Menke wrote:

>Aaron,
>
>what do you think of implementing the Observable interface with the
>DataBeans?  This could help with detecting updates.  (Inserts and Deletes
>are easier because you can determine the action via querying the submit
>button).
>
>-john
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Nesting Extension and persistance strategy

2002-03-05 Thread Arron Bates

I don't see any reason as to why the nested tags wouldn't work with simper.

The tags are just that. tags. They will interpret any bean they get 
their hands on when the JSP gets evaluated. So simper and NeXt could 
possibly be perfect buddies. The tags only add to the additional struts 
tags so that they relate to each other, rather then them all be an 
island that have to be managed separately. Struts already had nested 
beans, it was just that marking it up was kind of crappy, and actually 
brought limitation to a very flexible ability. Enough of that rant...

So if simper works against the current Struts tags, "stacks-on" for the 
nested version. :)

Arron.

John Menke wrote:

>Aaron,
>
>I think this is the way to go.  Notify the observer from within the setter
>making sure the data has changed.  I think I can make an Observer class that
>will store a collection of objects that have changed.  Then I can query this
>collection in the Action and perform the updates.  Maybe I should look
>deeper into Simper to see how the "dirtybeans" work.  It would be great if
>Simper and Nested Tags worked together.  You could have the best of both
>worlds.  Dynamic persistance and great flexibility in the view.
>
>-john
>
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Monday, March 04, 2002 11:17 PM
>To: Struts Users Mailing List
>Subject: Re: Nesting Extension and persistance strategy
>
>
>Well, yeah. That'd do the trick too. Probably in a fashion that would be
>manageable, clean, and garner the respect of OO gurus, developers and
>peers alike. Very apt solution.
>
>You can notify the observer from inside your setters rather than query
>the submit button. Mainly because you will have to do some checking to
>see if the data did change or if it's just being reset to the same
>thing. If you show a form, not change anything and submit it. The data
>may as well be totally different, as the bean properties will be set in
>each instance anyways. So in your setter you'll have to do comparisons
>on the incoming data, may as well just notify the observer while you're
>there.
>
>Note: Don't commit or actually make changes as soon as a change is made.
>Otherwise you'll have an updates firing for every property, for every
>bean. And that would be bad. :) Just note down the changed beans, and
>kick off the commit from the observer from within your action. Then you
>know that all the bean processing is finished, and you can go ahead and
>mess with your bean states.
>
>But to quote Ghostbusters... "yes, have some"
>:)
>
>Arron.
>
>John Menke wrote:
>
>>Aaron,
>>
>>what do you think of implementing the Observable interface with the
>>DataBeans? This could help with detecting updates. (Inserts and Deletes
>>are easier because you can determine the action via querying the submit
>>button).
>>
>>-john
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>
>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Nesting Extension and persistance strategy

2002-03-04 Thread Arron Bates

Mutually exclusive domains of operation.
I don't see any reason as to why the nested tags wouldn't work with simper.

The tags are just that. tags. They will interpret any bean they get 
their hands on when the JSP gets evaluated. So simper and NeXt could 
possibly be perfect buddies. The tags only add to the additional struts 
tags so that they relate to each other, rather then them all be an 
island that have to be managed separately. Struts already had nested 
beans, it was just that marking it up was kind of crappy, and actually 
brought limitation to a very flexible ability. Enough of that rant...

So if simper works against the current Struts tags, "stacks-on" for the 
nested version. :)

Arron.

John Menke wrote:

> Aaron,
>
> I think this is the way to go. Notify the observer from within the setter
> making sure the data has changed. I think I can make an Observer class 
> that
> will store a collection of objects that have changed. Then I can query 
> this
> collection in the Action and perform the updates. Maybe I should look
> deeper into Simper to see how the "dirtybeans" work. It would be great if
> Simper and Nested Tags worked together. You could have the best of both
> worlds. Dynamic persistance and great flexibility in the view.
>
> -john
>
>
> -Original Message-
> From: Arron Bates [ mailto:[EMAIL PROTECTED] ]
> Sent: Monday, March 04, 2002 11:17 PM
> To: Struts Users Mailing List
> Subject: Re: Nesting Extension and persistance strategy
>
>
> Well, yeah. That'd do the trick too. Probably in a fashion that would be
> manageable, clean, and garner the respect of OO gurus, developers and
> peers alike. Very apt solution.
>
> You can notify the observer from inside your setters rather than query
> the submit button. Mainly because you will have to do some checking to
> see if the data did change or if it's just being reset to the same
> thing. If you show a form, not change anything and submit it. The data
> may as well be totally different, as the bean properties will be set in
> each instance anyways. So in your setter you'll have to do comparisons
> on the incoming data, may as well just notify the observer while you're
> there.
>
> Note: Don't commit or actually make changes as soon as a change is made.
> Otherwise you'll have an updates firing for every property, for every
> bean. And that would be bad. :) Just note down the changed beans, and
> kick off the commit from the observer from within your action. Then you
> know that all the bean processing is finished, and you can go ahead and
> mess with your bean states.
>
> But to quote Ghostbusters... "yes, have some"
> :)
>
> Arron.
>
> John Menke wrote:
>
>> Aaron,
>>
>> what do you think of implementing the Observable interface with the
>> DataBeans? This could help with detecting updates. (Inserts and Deletes
>> are easier because you can determine the action via querying the submit
>> button).
>>
>> -john
>>
>>
>> -- 
>> To unsubscribe, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>>
>
>
>
>
> -- 
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>




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




Re: Nesting Extension and persistance strategy

2002-03-04 Thread Arron Bates

>
>
> I like beans managing dirty state becuause I could possibly have one 
> method
> that can handle several different structures if it's designed right.
>
> Maybe this:
>
> Have all DataBeans implement an interface lets day DirtyInterface that
> defines
> 2 methods:
>
> public String getDirtyAttribute() and
> public void callJDBC(String dirtyAttribute)
>
> the dirtyAttribute class member could be one of several values:
>
> insert
> update
> delete
> (select)
>
> callJDBCbean(String dirtyAttribute) would call a JDBCbean 
> corresponding to
> the databean,
> not sure how to define this, maybe in a way similar to the mapping of
> Actions?
>
> So then in the Action associated with the ActionForm we could pass the
> ActionForm into a Method that will call getDirtyAttribute and 
> callJDBCbean
> for each bean that is nested within the ActionForm.
>
> Having trouble thinking of way to iterate through the beans, but I think
> it's possible.
>

I think that to get it more in line with the stupid-model-paradigm (SMP? 
:) your beans could manage their dirty state, but the actual persistence 
management be handled by a separate object, that takes the bean types in 
overloaded methods.
eg:
persistDirtyBean(Organisation org) {...}
persistDirtyBean(Team team) {...}
persistDirtyBean(Investor investor) {...}
persistDirtyBean(Portfolio portfolio) {...}
persistDirtyBean(Stock stock) {...}

Then you could just throw whatever bean at it you needed. The class 
itself could even iterate the tree itself, in that the Organisation 
version of the PersistDirtyBean would get Team objects, and then from 
this method could call the Team persist method for whatever team. Or you 
can, in just as correct a manner, use it ad-hoc just throwing whatever 
object. Means that the persist methods aren't living with their related 
Object, so some OO guru may say it's not defending the faith.

There's just so many ways you can attack this. But I think that you're 
in the right frame of mind to take it on at least. :)

>>> How complex are the types/structure of your hierarchy?...
>>>
> Pretty simple.  Actually it almost maps exactly to your example
>
> Organization
> Team
> Investor
> Portfolio
> Stock
>

Simple until you have to persist the thing. :)
My definition of simple is when making a table you have a bean with a 
collection of one type of object, that can be retrieved and updated with 
one query.

Oh, I miss those days when people thought that just seeing data was 
special...
...and that it was on the "Information Super-Highway"... there's a term 
that brings on flash-backs.


Arron.




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




Re: Nesting Extension and persistance strategy

2002-03-04 Thread Arron Bates

Well, yeah. That'd do the trick too. Probably in a fashion that would be 
manageable, clean, and garner the respect of OO gurus, developers and 
peers alike. Very apt solution.

You can notify the observer from inside your setters rather than query 
the submit button. Mainly because you will have to do some checking to 
see if the data did change or if it's just being reset to the same 
thing. If you show a form, not change anything and submit it. The data 
may as well be totally different, as the bean properties will be set in 
each instance anyways. So in your setter you'll have to do comparisons 
on the incoming data, may as well just notify the observer while you're 
there.

Note: Don't commit or actually make changes as soon as a change is made. 
Otherwise you'll have an updates firing for every property, for every 
bean. And that would be bad. :) Just note down the changed beans, and 
kick off the commit from the observer from within your action. Then you 
know that all the bean processing is finished, and you can go ahead and 
mess with your bean states.

But to quote Ghostbusters... "yes, have some"
:)

Arron.

John Menke wrote:

> Aaron,
>
> what do you think of implementing the Observable interface with the
> DataBeans? This could help with detecting updates. (Inserts and Deletes
> are easier because you can determine the action via querying the submit
> button).
>
> -john
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>




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




Re: Nesting Extension and persistance strategy

2002-03-04 Thread Arron Bates

John Menke wrote:

> I am planning to use the Nesting Extension...
>
sweet  :)

> The MonkeyStruts example uses one ActionForm bean on the outermost level
> that links to other beans recursively in a parent child heirarchy.  It 
> looks
> like each child bean in the hierarchy is instantiated from methods 
> called by
> it's parents class.
>
MonkeyStruts example was made only to be just that, an example. To make 
it easier to see where things are built, and move on to more important 
considerations.

> I suggest the following for persistance...
>
[ ... ]

> Is there a better way of doing this or am I on the right track?
>

No, you're pretty much on the ball really. The only thing that people 
pushing "best practices" will say is to make sure that you externalize 
the persistence management from the bean model itself. That said, it can 
also make life really easy if you drive it directly from within the bean 
model itself (Who said that!? :)

In practice, it will really depend on the nature of your data structure. 
If it's list style, you'd be mad not to simply drive it from a system 
that will query the DB loop through populating objects putting them in a 
list. But if it's a complex structure of different nested types (and 
lets face it, the nested tags make this possible now more than ever), 
you could drive it exactly as you've described having the beans manage 
their dirty state and have a one-to-one level mapping from the 
persistence mechanism to nested bean (ie: have each nested bean know how 
it's to be stored). There are various ways to take this back to the MVC 
paradigm keeping the model totally separate, using patterns etc.

Only to say that there's not one recommended system, as it will vary 
from requirement to requirement. Some persistence mechanisms, like XML 
marshaling, will get you from persistent storage to nested java objects, 
back to storage almost for free (although such systems don't have the 
brute force performance of a DB query). Where as a table structure page 
will be almost the typical top-down list approach. To the ultra simple, 
I've made a tiny web app that serializes the entire model to disk. The 
data in it was shared to all users, so there wasn't any 
concurrency/performance issues.

The nested tags can just be a simpler alternative to the usual Struts 
tags, taking the exact same consideration as a typical Struts app. 
Horses for courses I'm afraid.

How complex are the types/structure of your hierarchy?...


Arron.



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




Re: File Protection

2002-03-03 Thread Arron Bates

Most web servers should have a mechanism to protect your files, but if 
you had to go via your own authentication logic, you can make the 
request go through a Struts Action, set the content type etc, and stream 
it out from there.

Arron.

SUPRIYA MISRA wrote:

> I am creating csv file (from oracle) that can be downloaded by only 
> authorized people. Where is the best place to put this txt file. It 
> contains confidential data. NO FTP is allowed as a policy.
>
>
>
>
> _
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
>
>
> -- 
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



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




Re: use of nested:iterate and nested:nest tags

2002-02-28 Thread Arron Bates

No stress.
:)

CyberZombie wrote:

> Heh...I didn't reply as I saw nothing wrong with it and didn't count 
> myself advanced enough in the ins-and-outs of nested to guess outside 
> of the given scope.



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




Re: is there drawdown select box in struts?

2002-02-28 Thread Arron Bates

You do mean "dropdown" don't you?...

The  tag will do both lists and single select drop down 
boxes, in the same way that the Html select tag does both.

Arron.

Struts Newsgroup (@Basebeans.com) wrote:

>Subject: is there drawdown select box in struts?
>From: "zb cong" <[EMAIL PROTECTED]>
> ===
>hello
>
>i find that the "" is a list select box,i wanna "drawdown"
>select box?
>
>how can i do?
>thank you very much!
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: use of nested:iterate and nested:nest tags

2002-02-28 Thread Arron Bates

I was hoping that other people would start helping with the nested tags, 
but anyways.

Rest assured, your markup is fine (At least the part you provided :).
It's easier to tell with nested tags. Less detail to worry about ;)

Are there any errors, or is it just that the bean property isn't 
updating on the server?... Throw some System.out.println() messages into 
the bean's setter method to double check.
The "name" text field updates fine?...

Because this part of the markup is perfect, the problem would have to be 
with how the bean itself is managed. Any clean-up code may be destroying 
the bean, or possibly the bean may be bouncing in and out of scope.

Try the above and get back to us.

Arron.


Sriram Nookala wrote:

>I have the following code in my jsp within a  tag:
>
>Here attributeDefintionList is a collection of AttributeDefintion beans.
>AttributeDefinition has a property type which itself is an AttributeType bean with a 
>property store.
>The code I have doesn't seem to setting and getting store for AttributeType.
>What am I missing here?
>thanks,
>sriram
>
> 
>
>
>  
>
>
> 
>   
> 
>
>
>
>
>



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




Re: [offtopic] frames

2002-02-27 Thread Arron Bates
For.
If you need to link directly to something then you can get a helper
frame that will do just that for you.

Frames will give you a return for effort. They do require a little more
effort, but waiting at the end is an efficient user experience that is
potentially faster and more usable.

Like always, it's a trade-off.

But I have to say, is that if anyone complains about frames, it's
probably because they haven't done any _real_ work with them in a large
application, and so don't know how to take advantage of them (I'm
talking more than just little menus on the left). So it means that it
will all end up in a pile of poop along with all the complaints of
making someone do what they don;t want to do. So therefore in your
instance, you should probably avoid them.


Arron.


Tingleff, Sam wrote:

>Against.  Can't link from outside to a specific page.  I know, I know...
>"You're not supposed to, it's an _application_."  But links are the great
>advantage of the web.  Take that away and what do you have?
>
>
>-Original Message-
>From: Mike Dewhirst [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, February 27, 2002 12:56 PM
>To: 'Struts Users Mailing List'
>Subject: [offtopic] frames
>
>
>just after your (everybody on this list) professional opinion regarding
>frames.
>
>If you could reply to me personally and not to the list, and just say "for"
>or "against" and if you can also write why, I would be very greatful.
>
>We have a slight dispute at work regarding this, and decided to solve it via
>voting.
>
>Sorry for the trouble and many thanks in advance.
>
>Mike Dewhirst
>
>++
>
>
>=**
>
>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.
>
>**=
>
>
>
>***
>
>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.
>
>***
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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


Re: indexed properties

2002-02-27 Thread Arron Bates

yup.

Arron

Maris Orbidans wrote:

>hello
>
>   Do I have to use Nightly Build to get subj. ?
>
>   1.0.2 says 
>
>"Lemums1.jsp": Attribute indexed invalid according to the specified TLD
>at line 194, column 5
>
>
>
>
>
>Searched mail archive but didnt find any useful.
>
>
>Maris Orbidans
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: help with logic:iterate

2002-02-26 Thread Arron Bates

No scriptlets needed for listed beans coming out of iterate tags.
Nested tag versions do it all intuitively for free without _any_ scripting.

Arron.


[EMAIL PROTECTED] wrote:

>Hi
>
>Maybe I completely lost the context, but as far as I can see, you haven't 
>wrapped the  within a  tag, right? If you just want to 
>output text to the HTML page you're generating use name="columnName"> instead.
>
>Using  for user-input within an iterator is a completely different 
>story which includes indexed properties and scriptlets.
>
>Regards,
>Klaus Bucka-Lassen
>aragost, Switzerland
>
>
>-Original Message-
>From: struts-user-digest-help
>[mailto:[EMAIL PROTECTED]]
>Sent: Montag, 25. Februar 2002 17:32
>To: struts-user
>Cc: srinookala
>Subject: help with logic:iterate
>
>
>I have the following snippet of code in my jsp:
>
> property="columnNameList">
>
>
>
>Column Name
>
>Type
>
>
>
>
>
> 
>
>
>
>
>I get the error "No getter method for property columnName of bean 
>org.apache.struts.taglib.html.BEAN".
>
>columnNameList is a collection of Strings. I can't figure out what I have to 
>set the name and property attributes of html:text in this case.
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: help with logic:iterate

2002-02-25 Thread Arron Bates

If you model it the other way (ie: a collections of objects that 
individual properties for each column. eg: ResultSet style) it will be 
much easier. Then you can point the iterate tag's property at the 
collection, and then use the nested text tags to show each of the 
properties within each bean.

Makes like _much_ easier to manage.

Arron.

Sriram Nookala wrote:

>The following worked for me:
>
>
> 
>
>  
>
>
>
>However if I have another String collection called columnTypeList which has
>the same length as the columnNameList and which also I'd like to populate
>and display with text boxes, how would I implement that. I'd put my question
>as how would I loop thru another collection along with the collection
>mentioned in the nested:iterate tag?
>- Original Message -
>From: "Arron Bates" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Monday, February 25, 2002 5:59 PM
>Subject: Re: help with logic:iterate
>
>
>>You're basically using the markup of the nested tags. If you have the
>>nightly build change your iterate tag to...
>>
>>
>>
>>...and your text tag to
>>
>>
>>...and of course don't forget to close the iterate tag with the
>>
>
>
>>
>>If you're not on the nightly build, you can get the download from here...
>>http://www.keyboardmonkey.com/struts
>>
>>It simply makes quick work of iterating and nesting beans as you are here.
>>
>>
>>Arron.
>>
>>
>>Sriram Nookala wrote:
>>
>>>I have the following snippet of code in my jsp:
>>>
>>>>>property="columnNameList">
>>>
>>>
>>>   
>>>   Column Name
>>>   
>>>   Type
>>>   
>>>   
>>>   
>>>   
>>>   
>>>    
>>>   
>>>   
>>>
>>>
>>>I get the error "No getter method for property columnName of bean
>>>
>org.apache.struts.taglib.html.BEAN".
>
>>>columnNameList is a collection of Strings. I can't figure out what I have
>>>
>to set the name and property attributes of html:text in this case.
>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: MORE help with logic:iterate

2002-02-25 Thread Arron Bates

In the nightly build, the nested tags will make easy work of this for 
you, simply swapping the tag header name a little to the following...




(no, you don't have to mess around with the id's and all that. Quite easy)

To get it working on your 1.02 build gor here and get the 1.0 jar...
http://www.keyboardmonkey.com/struts

And it will be waiting for you in the next release of Struts when you 
upgrade (or you can just keep using the separate jar :)
The above link also has a tutorial if you get a little stuck about any 
of it.

Arron.

Saeid Zoonematkermani wrote:

> Hello all;
>
> I am sorry to bring this up again but I have looked at the docs and 
> the archives and I think I am following the instruction found in these 
> but I still can't get the iterate tag to work correctly. So I wanted 
> to post this question and see if I understand the methodology and 
> hopefully figure out what is wrong. I using struts-1.0.2.
>
> Let's say that I want to display a list of students. From the link 
> (Display Students) on page 1, I go to DisplayStudentsAction which goes 
> to the database and gets the list of students. I have a StudentBean 
> with 2 properties; name and id. The action gets the result set from 
> the database, populates one bean at a time and adds them to a vector. 
> At the end, I have a vector of StudentBeans. I put the vector in a 
> session attribute called student_list and forward to page 2.
>
> On page 2, I try to use the iterate tag to display a table of students 
> and I have tried all variations of id, name, and property I can think 
> of and some kind of error always shows up. Snippet of the JSP:
>
> 
> 
> NAME
> ID
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> Some of the things I have done which were unsuccessful:
> - Added
> 
> or
>  type="packageName.StudentBean"/>
> to the top of the JSP and still no use...
>
> The error I am getting most of the time is:
> javax.servlet.ServletException: bean student not found within scope
>
> Any help would be appreciated. I have read in the emails that nested 
> tags might be the way to go but I need to stay with an officially 
> released version of struts.
>
> Thanks in advance,
>
> - Saeid
>
>
>
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



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




Re: help with logic:iterate

2002-02-25 Thread Arron Bates

You're basically using the markup of the nested tags. If you have the 
nightly build change your iterate tag to...



...and your text tag to


...and of course don't forget to close the iterate tag with the 


If you're not on the nightly build, you can get the download from here...
http://www.keyboardmonkey.com/struts

It simply makes quick work of iterating and nesting beans as you are here.


Arron.


Sriram Nookala wrote:

>I have the following snippet of code in my jsp:
>
> property="columnNameList">
>
>
>
>Column Name
>
>Type
>
>
>
>
>
> 
>
>
>
>
>I get the error "No getter method for property columnName of bean 
>org.apache.struts.taglib.html.BEAN".
>
>columnNameList is a collection of Strings. I can't figure out what I have to set the 
>name and property attributes of html:text in this case.
>



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




Re: Indexed Properties

2002-02-22 Thread Arron Bates

Sridhar,

I've had to make one such application of equally nasty size. To get the 
job done the nested tags were made. They made the truly daunting task a 
walk in the park.
They're in the nightly build, or if you're confined to an earlier 
release of Struts you can get them as a separate jar here...

http://www.keyboardmonkey.com/struts

Link above will also provide a primer, tutorial, and some advanced 
tricks. The latest docco is on the nightly build part of the struts site 
documentation.

Arron.

Sridhar M wrote:

>Hi,
>  I have a requirement wherein my HTML Form contains
>around 100 textfields. I want to use struts to handle
>this form automatically. But the problem is that I
>can't define 100 setter and getter methods.I tried
>using indexed properties with form beans but did not
>succeed. 
>
>Does Struts support the indexed properties concept
>defined by Javabeans. If so how to implement it.
>
>Thanks in advance,
>Sridhar
>
>__
>Do You Yahoo!?
>Yahoo! Sports - Coverage of the 2002 Olympic Games
>http://sports.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: EJB = bad = MS.net

2002-02-21 Thread Arron Bates

Yes, opions are opinions. So let every one get their own opinion about 
EJB's, and keep the Struts mailing  list for discussing Struts opinions.

The last thing the mailing list needs is holy wars about off-topic 
ranted opinions.
Keep the Struts mailing list about Struts.

Thanks.

Arron.


Struts Newsgroup (@Basebeans.com) wrote:

>Subject: Re: EJB = bad = MS.net
>From: Vic Cekvenich <[EMAIL PROTECTED]>
> ===
>more flame
>I just agreed with what was on the home page of Jakarta.
>EJB / smejb.
>I am not talking about "hello world" ejbs.
>Those are features you list. To many features is sort of like building a 
>submarine that is also a law mower. A distributed database?
>Nice features theoretically. In practice KISS.
>
>Elegant is more flexible, complex is just complex.
>
>We can all have a different opinion. I think the CW is use EJB 
>sometimes, not all the time. I would use it less, you would use it more.
>
>
>(Every one of my class reviews by every students is posted publicly at 
>news.basebeans.com)
>
>
>Cakalic, James wrote:
>
>>Hmm. And this guy claims to be training other developers using Struts. If
>>this is the kind of ranting that goes on in his book then its no longer a
>>wonder to me why people have blasted it so mercilessly.
>>
>>Ever tried to do a distributed transaction across multiple database
>>connections? Hard enough without substantial design even when they are all
>>targeting the same physical database. Now try a distributed database. What
>>if your enterprise data is coming from multiple sources? Or you want to
>>involve messaging in the transaction? As for security, you can take it or
>>leave it in the EJB model. But wouldn't be a good idea to design a single
>>access point for such a resource to encapsulate the security policy? And
>>wouldn't it be good for that policy to be declarative? And wouldn't you like
>>the security credentials to be automatically propogated by the ORB? And
>>wouldn't you like the roles to be retrieved from the same mechanism used to
>>authenticate the user in the first place? And why would you write all that
>>when it already exists?
>>
>>Granted, excessive use of EJB technology just because it is in your pocket
>>is not a good design choice. But claiming it is always a bad choice
>>regardless of circumstances is just as bad if not worse IMHO. Disputing the
>>pros/cons of EJB and related technologies with someone who clearly does not
>>appreciate the systemic issues the technologies are attempting to address is
>>sorta like debating the benefits of MVC with one of those died-in-the-wool,
>>you'll-never-change-my-mind, always-choose-the-most-expedient-route Model 1
>>programmers we've all run up against. They're so indoctrinated with their
>>own BS that they just can't see anything else.
>>
>>Jim Cakalic
>>
>>
>>>-Original Message-
>>>From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
>>>Sent: Wednesday, February 20, 2002 12:25 PM
>>>To: [EMAIL PROTECTED]
>>>Subject: Re: EJB = bad = MS.net
>>>
>>>
>>>Subject: Re: EJB = bad = MS.net
>>>From: Vic Cekvenich <[EMAIL PROTECTED]>
>>>===
>>>
>>>Transaction: DBs have it; or you can have a Java Bean, that has 2 
>>>JavaBeans in it, and all have a "commit()" method. You use EJB for a 
>>>commit()?
>>>Security? :
>>>-Menu based based on a role (using Struts-menu), some items 
>>>are disabled 
>>>based on your role.
>>>-JAAS JDBC Realms (I also get groupID)
>>>-Based groupID some rows retrieved / selected are editable, 
>>>some RO and 
>>>some invisible on your selects. It's called row based security.
>>>- Status based, based on a status of a row, some fileds become RO.
>>>
>>>EJBs give you 0 useful security.
>>>
>>>EJBs are also very slow to develop, and they distract developers to 
>>>develop technology and not solve a business problems. They 
>>>are also  
>>>slow to execute, thus they are only suitable for small 
>>>applications with 
>>>low volume (and for organizations where a profit margin is 
>>>not important 
>>>or on going cost of operations is not important).
>>>THere are some with EJB and and some resumes with EJBs are by 
>>>people who 
>>>have written a laboratory "hello world" ejb and never 
>>>actually used them 
>>>in production deployed where there is volume.
>>>
>>>"Custo

Re: My problems with Struts...

2002-02-20 Thread Arron Bates

Looking at a Struts app, the code that is outside of Struts itself 
you'll find is only the parts of the app that the Struts developers 
couldn't do for you, all split into nice little managable nuggets.

Business and controlling logic being fired out of the Struts actions, 
and the views to match the models defined by your form beans. Quite tidy.

In reply to the array issues. This is all part of managing your model. 
Arrays and beans are populated according to your business logic, and the 
JSP view presents it. If you have to be ready for a zero length array, 
then you have to handle it in the view markup.

As for the indexed properties... there's no other way to single out a 
reference in a list. More often than not it wont even be a factor. I've 
also written an app where all validation is client-side in JavaScript. 
It's just that the name of the field is specified for you, rather than 
picking names yourself. The truly awesome upshot of this is that you 
don't have to write any server side population logic yourself.

Mid last year I was overhearing people going on about tag libraries and 
so forth and was thinking about why you'd ever want write another tag 
that actually writes out a tag and all such stuff. Moved onto Struts and 
well, I'm not going back. Allows you to write apps faster and cleaner, 
as well as making them easier to manage.

As for who's using it... well, there's the resources link on the struts 
site that lists some. I've been working for Zurich Financial Services 
for 7 months (I'm sure there's teams using Struts with lower numbers in 
the global fortune500 than 97. A developer on a project from Ford gave 
feedback on the nested tags the other day and they're 4th...) and all 
apps written last year and from here in will be Struts powered. And they 
were early adopters. Struts has become much more powerful since then. In 
fact, there's now solutions in Struts itself which covers all the custom 
extensions they felt they had to write themselves. It's becomming more 
and more complete as the project goes on.

Last spiel... the nested tag examples (MonkeyStruts) are only arranged 
to show their ability, not to exemplify the model management itself. Ted 
Husted has a great page of recommended methodologies which will spiel on 
about how to go about the best way to code the MVC paradigm.
Because you picked on my monkey example, I just had to make comment. :)

Well, that's enough of a spiel.

Arron.

Kothapalli Basavaiah Choudary wrote:

>Hi, 
>I'm a newbie to Struts and trying to fit it into an application that's
>modeled after Blueprints. I feel frustrated at many places...It could
>be just that I don't understand Struts properly yet.I feel like just 
>using the classes that I like and leaving those features I don't prefer.
>
>I agree that it provides a nice working framework, but I find too many
>limitations...
>
>1.Struts automatically read your form data into request/session scope
>as specified in struts-config.xml.
>
>My problems with this are
>   I need to transform the data types other than Strings.
>   And it gets funny when using arrays...
>   If you have a 'String[] str', you don't have to initialize it in
>your form bean.
>   But if you have an object array like 'Monkey[] monkeys', you
>need to initilize
>   it in the form bean, or else it throws NullPointerException.
>   How am I supposed to know the number of 'monkeys' the user wants
>to
>   key in?
>   
>   One more thing is, for 'String[] str', the HTML parameter names
>   should be just 'str'. All the parameters with the same name will
>   be read into 'str[]'.
>   But with 'Monkey[] monkeys', the parameter names should have the
>index
>   like 'monkey[0].name','monkey[1].name' etc. 
>   Why is it so? And this indexed naming makes the javascript
>difficult
>   to code and read.
>   
>With such problems with transformation and nested bean arrays, I feel
>like
>reading the HTML data on my own. I fail to see how this feature adds
>much
>value.
>
>2.Provides form validation. 
>
>This is a good feature to have, but anyway, generally we push as much
>validation as we can into Javascript and if there are any real business
>validation to be done, I'd prefer doing it in  business tier rather
>than in Form bean.
>
>Again it adds value, but in a large application, I don't feel it is
>that much.
>
>3.Internationalization - again good, but it's not that difficult to
>implement on our own.
>
>4.Tag libraries - I never really used tag libraries in JSPs, so cannot
>comment on the usefulness 

Re: Stumped with nested iterator and nested link

2002-02-19 Thread Arron Bates

There was an inconsistency as to how the options were handled in the 
basic link tag's logic which broke the nested extension thereof.
This has been fixed up to be done in a more pessimistic fashion, and now 
available in the jars on my site ( http://www.keyboardmonkey.com/struts 
), or the next nightly build.

To mark it up as you'll need it...
my link thang

my link thang

The first will leave the name of the parameter as the value of paramId 
and take the value from the nested bean property specified 
"paramProperty". The second version, the proeprty value relates to a 
bean property that will refer to a java.util.Map collection that will 
place the key and value pairs into the URL.

Hopefully this will solve the issue. You will need to get new version of 
the tag though. Probably the quickest way is from my site.


Arron.


CyberZombie wrote:

> Arron Bates wrote:
>
>> [ ...cut... ]
>>
>> The nested tags as of mid Jan (nightly build and separate jars) are 
>> able to reference the current parent directly using the "this/" or 
>> "./" properties (same thing, just allowing for different tastes). Any 
>> property with "/" on the end will be treated as a parent reference. 
>> If you use anything else eg "somethingElse/" it will also be treated 
>> as a relative reference and step back through the last parent and 
>> reference the parent object before it.
>>
>> This allows you to write out the String value of the current parent 
>> object, and various other uses like being able to write out a 
>> collection of Strings etc.
>
>
> I guess I just am having a "lack-of-understanding" problem with 
> regards to nested:link then.  When I use the "this/", I still can't 
> get the HREF to be correctly generated.  Given the following:
>
>
>
>
>
>
>
> What is the proper combination (or incantation) of attributes that 
> will append to the page link the query "?transactionKey=1001" (or 
> whatever the current iteration value for 
> transaction.getTransactionKey() is)?
>
>>> Note:  Manipulating the Collection as an Array (IMHO) is not a good 
>>> solution -- and the nested iterator is already pointing at the 
>>> current transaction. 
>>
>>
>>
>> What do you mean by this exactly?...
>
>
> Not really sure any more -- yesterday was a LONG day (as today will be 
> as well...)
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Displaying recursively defined bean...

2002-02-19 Thread Arron Bates

Why "must" you use a dynamic include?... This came up before and you 
still haven't told me.

The only limitation of the nested tags is that it will be defined by a 
finite amount of levels (however many you markup). I've done this 
myself, it's just that you have to arbitrarily say 12 levels or 
something. But it's very easy to do.

Only true recursion will be done with the scripting, or in the creation 
of your own tag or finding someone elses. Struts doesn't have one.


Arron.

Alex Paransky wrote:

>I need to display a recursively defined data structure bean.
>
>I have a bean which looks like this:
>
>public class Message implements java.io.Serializable {
>  private String header, body, from;
>  private Collection replies;
>
>  public Collection getReplies() {return collection;}
>  public String getHeader() {return header;}
>  ...
>}
>
>As you have guessed, the replies is a collection containing a Message type
>again.
>
>So, what I want to do is start at the top message (root), and navigate down
>through the replies.  For each reply, I need to "recurse" into that reply
>and do the same thing.  How can this be done with JSP, or Struts?  I was
>thinking of using the "nested" extension, but that does not work with a
>dynamic 
>The other option is to use the pageContext as a stack for the current item,
>and pass the new Message root in a request, something like this:
>
>showTree.jsp:
>1. Read the root Message
>2. Place root message into Request with name of "message"
>3. 
>display.jsp:
>1. Assume there exists an object in request called "message" of type Message
>2. Display the details of the message
>3. Iterate over message.getReplies()
>4. For each object in the iteration
>   a. Put the object into request with the name of "message"
>   b. 
>Has any one done recursive displays using JSP?
>
>Thanks.
>-AP_
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Stumped with nested iterator and nested link

2002-02-18 Thread Arron Bates

CyberZombie wrote:

> I have a Collection...

[ ...cut... ]

The nested tags as of mid Jan (nightly build and separate jars) are able 
to reference the current parent directly using the "this/" or "./" 
properties (same thing, just allowing for different tastes). Any 
property with "/" on the end will be treated as a parent reference. If 
you use anything else eg "somethingElse/" it will also be treated as a 
relative reference and step back through the last parent and reference 
the parent object before it.

This allows you to write out the String value of the current parent 
object, and various other uses like being able to write out a collection 
of Strings etc.

> Note:  Manipulating the Collection as an Array (IMHO) is not a good 
> solution -- and the nested iterator is already pointing at the current 
> transaction. 

What do you mean by this exactly?...


Arron.


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




Re: Using Struts with mid-large size teams

2002-02-18 Thread Arron Bates

Look into the what the nightly build can do for you. The one thing that 
may help out is the sub-app ability allowing multiple config.xml and 
resource files for each sub-section of your app. I haven't used this 
myself, but to some extent it's why it was created.

Arron.

Robb Nedwick wrote:

>We're about to start a project in which we may be using Struts and the
>Validator extension, and I was wondering about any experiences (good and
>bad) or problems others have had with mid-large size teams when using
>Struts.  The team that will be starting the project will be over 10 people
>(not sure how many more at this point, but probably 10-15 or so).  Most
>people are already experienced with Java/JSP/EJB and we have an established
>architecture for our business tier that is working very well for us.
>
>Struts is being evaluated to help clean up the architecture of our
>presentation tier (we have some "MVC-like" concepts in our current code, but
>Struts seems like a better setup overall right now).  Anyway, I was
>wondering what people's experiences were with this size team.
>
>Some potential problems that strike me right away revolve around the fact
>that there's only 1 struts-config.xml and validation.xml file that all the
>developers will be editing and that this will cause a lot of conflicts for
>that file.  I know there's a patch to allow for multiple struts-config
>files, but haven't found a similar patch for the validation.xml file.  Also,
>the fact that Struts seems to support only a single resource file for I18N
>text seems like it will also cause us problems.
>
>What other problems or good experiences have people run into?  We're getting
>ready to get started soon, and I'm trying to get as much info as I can for
>justifying the move to Struts and to help me with the prototype I've been
>working on for educating the development staff.
>
>Thanks for any answers,
>
>Robb Nedwick
>[EMAIL PROTECTED]
>
>
>_
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Fill a list of textboxes ...

2002-02-18 Thread Arron Bates

It's because you're trying to use the non-nesting tags in a nested 
manner. Basically the text tags don't know that they're inside the 
iterate tags.

If you're running the nightly build, change the  to 
 and the  to . If you're not 
on the nightly build, get the tags in separate jar form from here...
http://www.keyboardmonkey.com/struts and do the same.

Only other way is indexed tags, but you're already trying to logically 
nest, so keep nestin'.
 
The nested tags are the exact fit to what you expected from the tags.

Arron.

[EMAIL PROTECTED] wrote:

>Here is my problem : 
>
>I have a from with an according form class :
>public class OrderForm extends ActionFrom
>{
>private String name; // name of the person that is ordering
>private ArrayList orderItems; // list of ordered items.
>
>// getters and setters ...
>}
>
>Each order item is a bean like this :
>public class ProductBean
>{
>private String productName; // the name of the product
>private int number; // how many of this product do you want 
>
>// getters and setters ..
>}
>
>I have a form on a jsp that diplayes a textbox for the name of the person that 
>wants to order, and a textbox for each product so you can enter a number .
>The problem is that these numbers are not stored  in the according ProductBeans.
>
>Here is my form. ( processOrder uses an OrderFrom 
>
>
>
>
>
>
>
>
>
>
>
>
>If I click the submit button, my action is called.  The name is on the 
>OrderForm, but there is not 1 number filled out !!
>
>How is this possible and how do I need to handle this problem .
>
>Thanks !
>Geert
>
>
>



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




Re: FOP and strus (IE problem)

2002-02-17 Thread Arron Bates

Oh, what a world of pain.
IE in this regard is a pile of *@!# and NS is the absolute honey  :)

This is off-struts, but I know the pain you go through to get IE going 
properly.

Here's what I had to do to get it running reliably...


// START CODE --==>>

// set the response type
response.setContentType("application/pdf");
// set the content details
response.setHeader("Content-Disposition", "inline; 
filename=ConfirmationLetter.pdf; ");

// creating a temporary output stream
ByteArrayOutputStream bout = new ByteArrayOutputStream();

// this class takes teh xml document and runs it through the FOP process
// and pumps it into the output stream created.
OnlineSalesPDFGenerator pdf = new OnlineSalesPDFGenerator(xmlDoc);
pdf.run(form,request,bout);

byte[] content = bout.toByteArray();

// set the exact content length from our temp output stream
response.setContentLength(content.length);

// write the content
response.getOutputStream().write(content);

// flush the stream
response.getOutputStream().flush();

// <<==-- END CODE


I went through a lot of pain to get all the alternatives people were 
doing to get this. Important parts are...
a) The response type.
b) The Content-Disposition details. This sets filenames and stuff for 
the file saving dialog boxes etc.
c) Setting the exact content length. Made possible by writing to the 
ByteArrayOutputStream and getting its resulting size.

And if you're pessimistic (most likely you are by now :), make sure you 
flush and close the output stream, and you can also throw in what Gregor 
says below with your URL. After the above though, you shouldn't have any 
problems.

Hopefully this will get you where you need to be.


Arron.


Gregor Rayman wrote:

>"John Ng" <[EMAIL PROTECTED]> wrote:
>
>>Hi, The following is a piece of the code that I write
>>in the perform method of an ActionForm to generate the
>>PDF.  However, it works fine in netscape, but NOT IE. 
>>Can someone help me with this?
>>
>>Thanks!
>>John 
>>
>
>Try adding "?.pdf" to the url.
>
>--
>gR
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>






Re: Mapped properties - How To

2002-02-16 Thread Arron Bates

Sorry to say, it's not going to work. There's a bug in the PropertyUtils 
class that makes it happen.
You could do some collection tricks and get it coming out in an Array, 
and that would work, but not the mapped property.

Arron.

Erik Tennant wrote:

> The mapped property feature is extremely useful, although somewhat 
> elusive. I've been struggling to get this feature to work, and after 
> spending more time than I would care to admit trying to figure it out, 
> I thought I would share a simple how-to on the matter since I ran 
> across several messages in the archives from people who had similar 
> challenges.
>
> First, I grabbed a nightly build of struts (Feb 15, 2002).
>
> Second, I added an input tag similar to this in my .jsp page:
> 
>
> Third, I added the following two methods to my form bean (note: it's 
> important to have the get method, even if you don't plan to use it):
> public Object getItem(String key) {
>
> }
>
> public void setItem(String key, Object value) {
>
> }
>
>
> -Erik
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



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




Re: iterate tag with nested collections?

2002-02-12 Thread Arron Bates

You can get the basic iterate tag to "view" the data, but it wont update 
within a form.

Go here...
http://www.keyboardmonkey.com/struts

...there's a turorial and examples that will take you through the system 
and get you nesting lists in no time.
The tags this page is on about is in the Struts nightly build, so it 
will be in the next release of struts.
100's of people use it for just this problem (it's also the main reason 
why it was made!).

Arron.

MacKellar, Kimberly wrote:

>If I understand your structure correctly, something like the following
>should work
>
>property="report.Level1" >
>
>   
>
>  
>Insured Name:  property="insuredName"/>
>   
> 
>
>
>
>Kim MacKellar
>
>
>-Original Message-
>From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 12, 2002 3:31 PM
>To: Struts-User@Jakarta. Apache. Org (E-mail)
>Subject: iterate tag with nested collections?
>
>
>Hi,
>
>I am trying to add a multi-level report to a struts application.
>So the report structure will be like this:
>
>Top Level Details
>Level 1 Details .
>   Level 2 Details..
>   Level 2 Details..
>   Level 2 Details..
>   Level 2 Details..
>Level 1 Details .
>   Level 2 Details..
>   Level 2 Details..
>Level 1 Details .
>   Level 2 Details..
>   Level 2 Details..
>   Level 2 Details..
>   Level 2 Details..
>Level 1 Details .
>   Level 2 Details..
>   Level 2 Details..
>
>
>I have set up my Value objects like so:
>
>ReportVo (top level)
>inside the ReportVo I have a collection of Level1Vo value objects
>inside each instance of Level1Vo I have a collection of Level2Vo value
>objects. 
>
>This info is passed into my struts jsp page.
>I am able to show attributes in the top level (ReportVo) and the 1st level
>(Level1Vo) value objects just fine.
>My problem now is to get the Level2Vo value object attributes to show up.
>
>
>Here's a hacked sample of the jsp.  What I am trying to figure out is how to
>get the nested iterate tag to work.  Each Level1 value object contains a
>collection of Level 2 objects.
>
>
>name="newBusinessActivityForm"
>type="com.worldinsure.admintool.report.struts.NewBusinessActivityForm"  > 
>
>Top Level:
>Total Number of Submitted Applications:  name="newBusinessActivityForm" property="report.submittedCount"  />
>Total Face Amount: property="report.faceAmtTotal"  />
>
>
>1st Level
>
>property="report.Level1" >
>
>   
>
>  property="report.Level1.Level2" >
>Insured Name:  property="insuredName"/>
>   
> 
> 
>
>
>
>Any thoughts on if this could work using struts tags or do I need to resort
>to java code?
>
>Thanks,
>Michelle
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: iterate tag usage

2002-02-12 Thread Arron Bates

Mark,

You're absolutely correct.

As for the "you can't use Object[]" stuff read the code.
Primitive arrays are perfectly fine, and most likely faster again than 
ArrayLists.

Arron.


Galbreath, Mark wrote:

>You should type with interfaces, not classes:
>
>private List vector;
>
>And unless you need synchronization, a ListArray is about 25 percent faster
>than a Vector.
>
>:-)
>
>Mark
>
>-Original Message-
>From: Moritz Petersen [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, February 12, 2002 3:33 PM
>To: Struts Users Mailing List
>Subject: RE: iterate tag usage
>
>
>Hehe, nope. ;-)
>
>Look: the return value of the getXYZ() method must be a
>java.util.Collection, Iterator etc. but _not_ an array. By the way: your
>code would not even compile.
>
>private Vector listVector;
>// A Vector implements the Collection interface. That is good.
>
>public Vector getListVector()
>// This works. "Vector".
>
>Have fun!
>
>Moritz.
>
>P.S.: What the hell is "VectorString"?
>
>>Thanks for your info! Do you think the following will work?
>>
>>
>>
>>
>>
>>   private Vector listVector;
>>
>>   public VectorString[] getListVector()
>>   {
>>  return listVector;
>>   }
>>
>>Thank you again!
>>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>




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




Re: I'missing something...

2002-02-12 Thread Arron Bates

Faux pas of the online docco I'm afraid. You can only get it with a 
nightly build, and then you have other options to help you with collections.

Arron.

Emiliano Albiani wrote:

>Browsing the online Strut's documentation I can see the attribute
>"indexed" between the attributes of the "text" Tag of the HTML Tag library.
>
>I downloaded Struts1.0.2 but the documentation seems to be not the same as the online 
>one and I can't also use this attribute in my jsp pages.
>
>Am I missing something?
>
>Thanks in advance.
>
>Emiliano. 
>



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




Re: help: <%>.. how do i convince them to learn JSP?

2002-02-12 Thread Arron Bates

Just finished rolling a "100 input elements on a page" app. Performance 
is not an issue. Once the JSP is compiled to its class, it just hums 
along very happily.

Arron.

Bob Williams wrote:

>I have no problem being convinced that tags should be used for generating
>complex items on a web page.  The one concern I do have, relative to using
>tags, is the extra processing required to generate simple things.  I have
>seen pages in industrial environments where the page may have 50-100
>elements displayed (and no this is not a problem with the design this is a
>real application requirement!).  Using a tag to generate labels and text
>input boxes seems like it would add a significant compute load on a server
>that is servicing 100's of people.  The same situation applies when you are
>dealing with pages with fewer elements, but are being served up to 1000's or
>10,000's of users.
>
>Does anyone have experience about computing resources required by tags in
>these types of scenarios?
>
>bob
>- Original Message -
>From: "Sarah Farrell" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Monday, February 11, 2002 9:48 PM
>Subject: Re: help: <%>.. how do i convince them to learn JSP?
>
>
>>Michael,
>>
>>Here's the best one I could find.
>>
>http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/
>
>>web_tier/qanda/index.html
>>
>>There are some other ones on java.sun.com if you search for "JSP
>>
>presentation
>
>>logic separate".
>>
>>Here's another one:
>>http://java.sun.com/products/jsp/
>>
>>
>>
>>P.S. Please don't cross-post to multiple jakarta lists.
>>
>>
>>
>>At 07:34 PM 2/11/2002 -0800, you wrote:
>>
>>>long before server pages or servlets existed i was
>>>writing these C++ template based systems with CGI
>>>so i could do my best to separate content generation from programming
>>>logic...
>>>
>>>i'm a consultant and this company made me lead on my first JSP/Servlet
>>>
>based
>
>>>project,
>>>i was really excited to get involved with JSP tag libraries.
>>>
>>>but when i got into the code base IT'S ALL .jsp files with
>>>TONS of Java scriptlets!  it's nasty.  if/else blocks several hundred
>>>
>lines
>
>>>long.
>>>the developer i took this over from
>>>thinks there is no reason to do it any other way.  tags?  why use tags?
>>>
>>>i am asking for input/references on why you want to keep the scriptlets
>>>
><%>
>
>>>
>>>out of the JSP files.  every time i try to make a point-- maybe
>>>i'm just not being eloquent enough...
>>>
>>>on another note: is it really model 2 if a JSP is processing the request?
>>>i don't think it is, even if your entire JSP is just some java code
>>>wrapped with a scriptlet tag..  (yuk).
>>>
>>>thanks for input.
>>>--Michael
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
><mailto:[EMAIL PROTECTED]>
>
>>>For additional commands, e-mail:
>>>
><mailto:[EMAIL PROTECTED]>
>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Forms and Collections

2002-02-12 Thread Arron Bates

Could it be that the reset method in the form is killing the collection?...
If it's displaying properly, then by all rights it should be updating 
properly back on the server.

Arron.

Kenneth Aastrøm wrote:

>Hi,
>
>I have an ActionForm with the usual ints and Strings, and a Collection containing my 
>own beans. After a lot of fiddling (and the latest nightly), I've now managed to 
>display the contents of the Collection in my form as textfields, using:
>
>
>
>
>After submitting the form, I can easily get the single-value fields from the form ... 
>but the collection is now empty. 
>How do I go about making the form update the collection after a submit (without 
>parsing the request-object myself) ?
>
>Kenneth Aa.
> 
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: commons - BeanUtils ; mapping and setFoo getFoo how to ?

2002-02-12 Thread Arron Bates

In all truth I don't know. I got far enough to find out where the issue 
happes. I got it to work via a hack to the PropertyUtils class. I'd 
honestly try to use collection manipulation to get it into a List or 
something, unless you want my hack. No garauntees however. :)

There's a whole class there meant to handle mapped properties, but my 
hack doesn't use it. So I have to get some time to go back and find out 
how it's used etc.

I tried to bring it up in the respective developer lists, but no 
answers. I was hoping that someone closer to the creation of it could do 
it, but no luck (dammit :). So we have to hack it ourselves.

Arron.

Arik Levin ( Tikal ) wrote:

>Now u are telling me I have tried it until my blood is out of my
>kishke...
>
>So tell me, I'm using InvocationHandler to invoke my methods, is there a way
>at the night build of struts or other interesting way I should know?
>
>Thanx man!
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, February 12, 2002 12:20 AM
>To: Struts Users Mailing List
>Subject: Re: commons - BeanUtils ; mapping and setFoo getFoo how to ?
>
>I don't think that the mapped properties are working. I went to add the 
>ability to the  tag the other day and tested the bean 
>utils directly before I did so and it doesn't work.
>
>I found the problem though, but haven't had time to fix it properly and 
>put in a patch.
>
>Arron.
>
>
>Arik Levin ( Tikal ) wrote:
>
>>Does anybody here have a tutorial or a sample for the commons BeanUtils ?
>>
>>I'm trying to map setter and getter method and invoke them. Using
>><http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanuti
>>
>l
>
>>s/MappedPropertyDescriptor.html> MappedPropertyDescriptor . I don't know
>>
>how
>
>>to work this thing.
>>
>>Thanx.
>>
>>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>



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




Re: Questions regarding the usage of nested tags...

2002-02-11 Thread Arron Bates
e  tag 
at point of inclusion and name the bean at that level. Then in your 
included page you can use the  tag to pick up on the name 
of the bean you just defined, and from there continue nesting as if you 
were all in the same page. Note that this would only be for viewing 
details, and not updating values in the child page. For that I'd simply 
recommend using the static include directive. It has all the development 
time advantages, only it gets compiled into the main page at compile time.

The tags only need the root tag to point to a bean that the tags can get 
at. From there it's just property management.

As for "..since the type of the object is not known...", how does this 
apply?...
You have to rely on the property layout to your object model to markup 
any tags in the first place.
The nested tags are the same as the originals, as long as the properties 
match up to the right object, you're golden. One advantage nesting has 
over original tags in this capacity is that the natural composition of 
the data model and accessor properties will handle all this and select 
the right object for you. Sweet.


Hope that this has cleared some nagging thoughts. Possibly made a few, 
but that's what you get for creating something for a group of autonomous 
thinkers :)

The nested tags took the path of least resistance which also happen to 
be the cleanest result. When the tags were first made, it was after 
consultation with the struts-dev list and its contributors as to how I 
went about it. So even though it started out separate to Struts, it was 
made as if it was a part of it.


Arron.


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




Re: struts-nested defining a root

2002-02-10 Thread Arron Bates

I didn't realise that this was posted on the user list as well. For the 
benefit of any readers...

 requires only the name of a bean which is in scope. For 
example I use...



...


Reason is, is that I wasn't going to reinvent the bean-scoping wheel to 
include it all in the root tag, especially when much smarter people have 
already done it for me. :)


Arron.


CyberZombie wrote:

> I have an action that creates a form and forwards that to a 
> display-only page. After struggling many hours trying NOT to use an 
> , I gave up. Issues:
>
> 1.  needs more than just name. It should include full 
> scope/property semantics.
> 2. ,  et.al. don't like 
> scope/name/property in the absence of a defined root.
>
> Possible fixes:
>
> 1. Provide a master 'root' that lives one level above the form 
> defination. As  entries appear, make them peers of 
> the form.
> 2. Implement a root stack Nesting off of an arbitrary bean pushes the 
> root onto the stack and defines a new root.
>
>
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
>
>



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




Re: performance over iterate

2002-02-10 Thread Arron Bates

Alberto,

I've found that the viewable performance is also in the time it takes 
for the browser to render the Html.
NS6 & IE6 it usually isn't that bad, but use NS4 and you'll see it. I 
ran the Monkey example in NS4 and it almost killed it. :)
It did render, but it took a while.

But, I then re-wrote it to use a single table, and it became lightning 
fast on all browsers including NS4.

It's great to logically represent nested levels in an extra table, but 
sometimes it's easy to get carried away.
If you spend a little extra time to get the colspan's and such right to 
make it all a single table, you'll get a lot of render speed back for 
your effort. Even if there's more markup, the browser is happier.

To confirm the speed of the iterating itself, replace the table markup 
with nonsense font tags, spaces or whatever and see how long it takes to 
produce the page. If it's quick, then there's a rendering problem.

As an extra point... you could try removing the  tags 
and initialise the collections variables as zero length collections. As 
if there's nothing in the collection, the iterate tag will simply skip 
it on it's own. This is just to save the overhead of the extra tag 
evaluation on each step within each iteration.

Hopefully somewhere in all this you can get back some speed to your page.
If not, please get back to us.


Arron.

Alberto Bolchini wrote:

>hi all.
> 
>I'm using a nightly build with the nested extension tags.
> 
>I expose to the View (jsp) a Component bean (GoF Composite pattern) and
>I need to have a 4 level iteration over the Component's children. These
>can be Composite (and thus _have_ children) or Leaf (and thus have no
>children).
> 
>I have used the nested extension to iterate over the collections with
>something that looks like the following:
>
>
> 
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>   
>
> 
>Well. Those four iterations, take a very long time to perform. 
> 
>Is there a better way to perform the task?
> 
>Thanx.
>alberto.
>



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




Re: Question on Nesting iterate tags

2002-02-08 Thread Arron Bates

This appears to be kind of confusing. What you have marked up will loop 
through the second array for each iteration of the first array.

Is this what you're after?...

It's kind of hard to see what it is that you're trying to achieve. Is 
the second array meant to be relative the the first or not?...

Either way, to nest iterators I recommend the nested extension.
http://www.keyboardmonkey.com/struts

To learn about it, go there, to download it also unless you're on a 
nightly build after the middle of January.


Arron.



Aamir Saalam wrote:

>I am *not* sure if i am addressing this question in specific.
>
>Here's an example of Nested logic:iterate tag's:
>
>
><%
>  String[] array1 = {"A1", "A2", "A3"};
>  String[] array2 = {"B1", "B2", "B3"};
>  pageContext.setAttribute("Array1", array1, PageContext.PAGE_SCOPE);
>  pageContext.setAttribute("Array2", array2, PageContext.PAGE_SCOPE);
>%>
>
>
>  
> 
> 
>  
>
>
>
>--aamir
>
>-Original Message-
>From: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]]
>Sent: Friday, February 08, 2002 11:16 AM
>To: [EMAIL PROTECTED]
>Subject: Question on Nesting iterate tags
>
>
>How do you nest two iterate tags
>
>
>property="actHourArray">  .
>   
>   type="fal.LocationHrs"   property="actHour.selected">
>   
>
>
>Both Collections are Arrays.
>Array 1 contains a bunch of Strings and and Array 2. Array 2 contains a 
>bunch of Strings. I will have to use text boxes to update for which i plan 
>to use the indexed tags.
>
>Any Help would be appreciated. Any links alsp would be helpful
>
>Thanks
>
>_
>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Logic:iterate

2002-02-05 Thread Arron Bates

Try the nested extension. All relevant tags can nest properly, amongst 
iterate tags or otherwise.

It's in the nightly build, or you can go here for a version for Struts 
1.0/1.01. Also has some docco, tutorial etc...
http://www.keyboardmonkey.com/struts


Arron.

Marcelo Caldas wrote:

>Hi,
> 
>I have a  tag, where I'm trying to create indexed  . this 
>part if fine... My problem is that the labels for each field are also part of my bean 
>being iterated (internationalization and type of  I'm asking the user... just 
>in case you're wandering). But, I just realized that  does not accept the 
>indexed="true" attribute...
>
>Any Ideas how to overcome this limitation?
>
>Regards,
>Marcelo.
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: is indexed="true" working on Struts 1.0?

2002-02-03 Thread Arron Bates

If you're willing to get the nightly build, you may as well use the 
nested extension that comes with it. The iterations are easier and just 
generally better for what it sounds like you're trying to do.

Arron.


[EMAIL PROTECTED] wrote:

>Thank you.
>Can I use part of the nightly code for indexed form objects? What files
>should be replaced? I don't want my stuff to be messed up too much. It's a
>working application and it's working, at least.
>
>Now what I did to keep the array objects is that I used a hashtable in
>Action to kepp it in the session and asign each form a form id and put it
>into the hashtable with the array of object "user". It's ugly.  and I can't
>change multiple user's name or password at once. I can only do delete one
>and add one.
>I want to keep the array of users in the Form, and hopefully editable.
>
>Yunming
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Friday, February 01, 2002 12:52 PM
>To: Struts Users Mailing List
>Subject: Re: is indexed="true" working on Struts 1.0?
>
>
>
>
>no.  nightly build required til 1.1 released.
>
>Dave
>
>
>
>
>[EMAIL PROTECTED] on 02/01/2002 10:19:35 AM
>
>Please respond to "Struts Users Mailing List"
>  <[EMAIL PROTECTED]>
>
>To:   [EMAIL PROTECTED]
>cc:(bcc: David Hay/Lex/Lexmark)
>Subject:  is indexed="true" working on Struts 1.0?
>
>
>
>I have an array of object in myForm, say, users. Each user has a name, a
>password ...
>I want to put these fields as indexed="true"/> and can be submited.
>Is there any way to do so with Struts 1.0? or I have to use Struts 1.0.1?
>
>I tried it on Struts 1.0 and got an error:
>
>editUser.jsp(236,5) Attribute indexed invalid according to the specified
>TLD
>
>Thank you for any help.
>
>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>



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




Re: is indexed="true" working on Struts 1.0?

2002-02-03 Thread Arron Bates

I'm quite certain the indexed option in the tags is only available in 
the nightly build.

Arron.


[EMAIL PROTECTED] wrote:

>I have an array of object in myForm, say, users. Each user has a name, a
>password ...
>I want to put these fields as indexed="true"/> and can be submited.
>Is there any way to do so with Struts 1.0? or I have to use Struts 1.0.1?
>
>I tried it on Struts 1.0 and got an error:
>
>editUser.jsp(236,5) Attribute indexed invalid according to the specified
>TLD
>
>Thank you for any help.
>



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




Re: nested iterate

2002-02-03 Thread Arron Bates

Tried the  tag and the rest of the nested library?

It comes in the nightly build, or you can get it separately here (along 
with tutorial and such on how to use it)...
http://www.keyboardmonkey.com/struts


Arron.



Philippe Hodapp / 1genia wrote:

>I have some problems to use an iterate tag in an iterate tag.
>I have tried to use the define tag but it don't work too.
>I have the message : Cannot create iterator for this collection
>
>Here's the code :
>scope="session" >
>property="noArticle" />">
>   
>   
>
>   property="picturesContainer">
>   
>   
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: how to use strus HTML tags when i have a collection of items to be displayed

2002-01-30 Thread Arron Bates

My pleasure.

Arron.

srinivas wrote:

>hi arron,
>
>it worked. thank you very very much.
>
>regards,
>srinivas
>


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




Re: how to use strus HTML tags when i have a collection of items to be displayed

2002-01-30 Thread Arron Bates

Did you download a new version of the nested extension?...

It was only added on the 23rd of January. I'm quite certain this is the 
reason for this error.
It's trying to step back through the parent tag and tries to append an 
empty property, hence the dot on the end.


Arron.

srinivas wrote:

>Hi Arron,
>
>I used the "./" and "this/" as the property name and i get an error:
>No getter method for property shares1[0].computer[1].options. of bean
>serviceForm
>
>now it tries to append a "." to the property.
>
>If necessary i can mail u all the source files.
>
>regards,
>srinivas
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 31, 2002 1:08 AM
>To: Struts Users Mailing List
>Cc: srinivas
>Subject: Re: how to use strus HTML tags when i have a collection of
>items to be displayed
>
>
>Srinivas,
>
>This has come up a little while ago and I've added to the nested
>extension to allow for it. The problem is, is that if you have other
>nested tags inside an iterate tag or similar, they will work on a
>property returned from that object from the list etc. What was needed
>was to access the object itself. This was just not possible in the
>original tags or otherwise.
>
>To allow this I've added the ability to access the current object from a
>parent. Using "./" or "this/" as the child tag's property, you will
>access the parent object itself. So if it's a string, you can write it
>out, make it an input field etc.
>
>For example...
>
>
>
>...will loop through an array of Strings and make text inputs for them.
>
>There is one specific detail to get this working properly. In your bean,
>you have to provide the more literal form of indexed setter property,
>rather than the collection form used for the getter.
>Example where I'm setting the value back to my ArrayList...
>
>public void setStringList(int index, String str) {
>myList.set(index, str);
>}
>
>
>My getter remains unchanged as the collection form...
>
>public ArrayList getStringList() {
>return myList;
>}
>
>This is all because the system which sets it wont be pulling out the
>collection, making the modifications, and then returning it altered. It
>will leave everything up to you. This is still good however.
>
>This functionality is in the nightly build from the 23rd of Jan, or you
>can download an updated jar from the site.
>http://www.keyboardmonkey.com/struts
>
>As a small disclaimer, the ArrayList getter shown above is only possible
>with a nightly build. Users of Struts 1.0/1.01 will need to return an
>Object array as in "arrayList.toArray()".
>
>Hope this does what you're after.
>
>
>Arron.
>
>
>srinivas wrote:
>
>>hi Arron,
>>
>>Thank you very much for the advice. It fits to our problem but i am faced
>>with another one.
>>
>>I d'ont no how to generate input fields(text or select) when the bean
>>return's an array of Strings.
>>I did not get the idea how i can iterate through the array of Strings and
>>generate an input field
>>with value equal to the contents of the String.
>>
>>i d'ont have control over the action beans as they are generated from XML
>>Schema. I use castor source generation to
>>generate a java class out of XML schema and then use it in ActionForm.
>>
>>Thank u once again.
>>
>>Srinivas
>>-Original Message-
>>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, January 28, 2002 5:43 AM
>>To: Struts Users Mailing List
>>Subject: Re: how to use strus HTML tags when i have a collection of
>>items to be displayed
>>
>>
>>The nested extension.
>>
>>Go here to learn how...
>>http://www.keyboardmonkey.com/struts
>>
>>It's in the nightly build or you can pick up the library from the page
>>above. Will be in Struts 1.1
>>
>>
>>Arron.
>>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Two dimentional Array problem

2002-01-30 Thread Arron Bates

I don't think that there is one. Or at least in Struts.
The two dimensional array bean property is not a part of the bean spec.

You could probably hack the iterate tag and write it yourself, it will 
have all the logic there to show you how to do the looping etc.


Arron.

manjunatha honnappa wrote:

>Hi
>  Struts form class which returns the two dimentional
>array, Could any one tell me the tag librarry to
>render the values.
>
>public Object[][] getCellValues()
>
>
>thanks 
>manju
>
>__
>Do You Yahoo!?
>Great stuff seeking new owners in Yahoo! Auctions! 
>http://auctions.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: how to use strus HTML tags when i have a collection of items to be displayed

2002-01-30 Thread Arron Bates

Srinivas,

This has come up a little while ago and I've added to the nested 
extension to allow for it. The problem is, is that if you have other 
nested tags inside an iterate tag or similar, they will work on a 
property returned from that object from the list etc. What was needed 
was to access the object itself. This was just not possible in the 
original tags or otherwise.

To allow this I've added the ability to access the current object from a 
parent. Using "./" or "this/" as the child tag's property, you will 
access the parent object itself. So if it's a string, you can write it 
out, make it an input field etc.

For example...



...will loop through an array of Strings and make text inputs for them.

There is one specific detail to get this working properly. In your bean, 
you have to provide the more literal form of indexed setter property, 
rather than the collection form used for the getter.
Example where I'm setting the value back to my ArrayList...

public void setStringList(int index, String str) {
myList.set(index, str);
}


My getter remains unchanged as the collection form...

public ArrayList getStringList() {
return myList;
}

This is all because the system which sets it wont be pulling out the 
collection, making the modifications, and then returning it altered. It 
will leave everything up to you. This is still good however.

This functionality is in the nightly build from the 23rd of Jan, or you 
can download an updated jar from the site.
http://www.keyboardmonkey.com/struts

As a small disclaimer, the ArrayList getter shown above is only possible 
with a nightly build. Users of Struts 1.0/1.01 will need to return an 
Object array as in "arrayList.toArray()".

Hope this does what you're after.


Arron.


srinivas wrote:

>hi Arron,
>
>Thank you very much for the advice. It fits to our problem but i am faced
>with another one.
>
>I d'ont no how to generate input fields(text or select) when the bean
>return's an array of Strings.
>I did not get the idea how i can iterate through the array of Strings and
>generate an input field
>with value equal to the contents of the String.
>
>i d'ont have control over the action beans as they are generated from XML
>Schema. I use castor source generation to
>generate a java class out of XML schema and then use it in ActionForm.
>
>Thank u once again.
>
>Srinivas
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 28, 2002 5:43 AM
>To: Struts Users Mailing List
>Subject: Re: how to use strus HTML tags when i have a collection of
>items to be displayed
>
>
>The nested extension.
>
>Go here to learn how...
>http://www.keyboardmonkey.com/struts
>
>It's in the nightly build or you can pick up the library from the page
>above. Will be in Struts 1.1
>
>
>Arron.
>


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




Re: how to use strus HTML tags when i have a collection of items to be displayed

2002-01-27 Thread Arron Bates

The nested extension.

Go here to learn how...
http://www.keyboardmonkey.com/struts

It's in the nightly build or you can pick up the library from the page 
above. Will be in Struts 1.1


Arron.

srinivas vanapalli wrote:

>hi all,
>
>i have a collection (Vector) in a Form Bean. The items in the Vector are all
>Beans of the same type.
>
>I have to display these items in the HTML. The problem is that i d'ont know
>how to display each item(bean) in JSP using strutshtml tag lib. I want the
>struts form to automatically fill the bean when the form is submitted.
>
>thank's in advance,
>
>regards,
>srinivas
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Help with table with edit buttons

2002-01-26 Thread Arron Bates

I did have a mail with a whole spiel as to how to go about it, but then 
thought that it wouldn't take long and be more of help if there was a 
"scratch-n-sniff" example you could go through also, so the solution is 
attached (requires everything needed to run Struts and the nested 
extension in the /WEB-INF/lib dir. Nightly build has it all, or older 
Struts with the nested extension's jar ( 
http://www.keyboardmonkey.com/struts )).

How it goes about it...
...in the list, the rows are marked up from separate objects in a list 
and each has a submit button.
When one is clicked, because of the underlying nested property, the 
individual objects' setter for the submit button will be called when the 
form goes back to the struts servlet. From this setter it tells the root 
bean that it's now to go to edit mode and set a standard property 
("editingObject") in the root bean to return the object to be edited. 
Then the action goes to the edit page which edits any object under the 
"editingObject" property. Submit this form and it will update bean, the 
action will set everything back, and there you have it.

When you consider this is the sum total of the entire process it's 
really quite simple. And no hidden input fields or javascripts.

If you're not running the nightly build, get the nested extension from 
here...
http://www.keyboardmonkey.com/struts

Another example using "edit view" style functionality...
http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp

For all the info you want about the nested extension, go to the "/struts 
" link above.



Arron.


David M. Karr wrote:

>>>>>>"Larry" == Larry Maturo  writes:
>>>>>>
>
>Larry> I have a table that displays information on a number of
>Larry> items.  Each table entry has an edit button, so that you
>Larry> can edit the information on that item. I use an iterate 
>Larry> tag to populate the table.  My problem is that I don't
>Larry> know how to save something indicating which edit button
>Larry> they pressed.
>
>Larry> My best guess was to use an onclick handler to set a
>Larry> hidden variable.  My problem is that while I know how
>Larry> to create the hidden variable (using the struts hidden
>Larry> tag) I don't know how to set it in the onclick handler.
>
>One approach is not to try to determine which edit button was pressed, but to
>use a hidden field in a form in each table row to encode the OID of the object
>in that row.  Each form row submits to the same action.
>







nested-object-editor.war
Description: Binary data

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


Re: Form beans and 1..* relationships

2002-01-25 Thread Arron

Or as I like to think of it... a banana picking plantation has more than 
one monkey working a field, each monkey picking any amount of bunches, 
and each bunch many bananas... similar, no?

There's a working example here...
http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp

And to find out how it was all done, go here...
http://www.keyboardmonkey.com/struts

And don't worry about it's future, it's now a part of Struts, and in the 
nightly build.


Arron.


Jason B Menard wrote:

>Hello,
>
>I am a newbie to Struts so please excuse me if this has already been
>previously discussed.
>
>I have a java bean that models a purchase request.  For the sake of
>brevity we can call this the PR bean.  One of the attributes of the PR
>bean is that it has one to many "products", product being another class,
>which we are mainting in the PR in a HashMap.
>
>I also will have a jsp that displays a purchase request form.  Based on
>other actions the user has taken in the application, much of this form
>will be pre-filled.  If I was doing a standard useBean, when displaying
>the purchase request form to the user via a jsp, the jsp would among
>other things iterate through the collection dynamically creating form
>fields, and populating the form with the contents of the PR bean.  For
>example if the PR had four products, and let's say that one of the
>attributes of a product is a part number, the jsp would dynamically
>create fields named "partNumber.1", "partNumber2", etc..., and fill in
>those values on the form.
>
>My question is whether or not it is possible to do this with form beans,
>or should I stick with my current plan and not use a form bean in this
>case, just using another class to do the form validation?
>
>1.  Can you model one-to-many relationships, or any other kind of
>dynamic content, with form beans?
>
>2.  Upon displaying this jsp, to make sure I get it populated correctly,
>in the preceeding action would I simply create a new instance of the
>Form bean, copy the data from the PR bean to the Form bean, and then
>place the Form bean in the appropriate scope before forwarding on to the
>jsp?  Is this the way this would normally be handled or is there a more
>appropriate way to do this?
>
>Thanks,
>
>Jason
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Changing address in address bar

2002-01-24 Thread Arron Bates

Only way that it can be done without being seen as a querystring, is via 
a form's POST method. But realistically would have to be activated via 
JavaScript to do what you want. It also means that if the user clicks 
their browser's "back" button to go back to the page, you'll get the 
typical question dialog "this page was generated from POST data, do you 
want to post it again?"... yes, page loads, no, IE page expired output 
or equivalent. Less friendlier to the user than a name/value in their 
address bar.

...Or...
...you can hide the current document in a frame, but that's not "passe" 
with most developers (personally I just think they're misunderstood :).

Arron.


Antony Stace wrote:

>Opps, I should have mentioned I have a number of these links on the page, ie I have 
>links on the page to
>
>http://localhost:8180/testapp/displayAvail.do?loca=1
>http://localhost:8180/testapp/displayAvail.do?loca=2
>http://localhost:8180/testapp/displayAvail.do?loca=3
>http://localhost:8180/testapp/displayAvail.do?loca=4
>
>and if the user clicks on any of these links they should just get
>
>http://localhost:8180/testapp/displayAvail.do
>
>displayed in their browser.
>
>
>
>On Fri, 25 Jan 2002 15:30:56 +1100
><[EMAIL PROTECTED]> wrote:
>
>>okay...
>>
>>in the page/servlet that has the link, put it in the session there...
>>if in jsp: 
>><% 
>>javax.servlet.http.HttpSession session = request.getSession();
>>session.setAttribute("key","value");
>>%>
>>
>>in servlet:
>>see prvious method...
>>
>>-Original Message-
>>From: Antony Stace [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, 25 January 2002 15:26
>>To: Struts Users Mailing List
>>Subject: Re: Changing address in address bar
>>
>>
>>Thanks for the reply.  This still leaves the address bar with the 
>>
>>?loca=3-(1)
>>
>>part.  I want to get rid of (1)
>>
>>Any ideas?
>>
>>On Fri, 25 Jan 2002 15:24:28 +1100
>><[EMAIL PROTECTED]> wrote:
>>
>>>Set the loca=3 into the HttpSession.
>>>
>>>
>>>javax.servlet.http.*;
>>>HttpSession session = request.getSession();
>>>...
>>>// set into session..
>>>session.setAttribute("key","value");
>>>
>>>// get from session...
>>>String loca = session.getAttribute("key");
>>>
>>>HTH...
>>>
>>>-Original Message-
>>>From: Antony Stace [mailto:[EMAIL PROTECTED]]
>>>Sent: Friday, 25 January 2002 14:53
>>>To: [EMAIL PROTECTED]
>>>Subject: Changing address in address bar
>>>
>>>
>>>Hi
>>>
>>>I have a link in a page
>>>
>>>
>>>http://localhost:8180/testapp/displayAvail.do?loca=3
>>>
>>>which a user can click on.  When the page is diplayed I do not want
>>>
>>the 
>>
>>>?loca=3
>>>
>>>part displayed in the link location on the address bar, ie I just want
>>>
>>>http://localhost:8180/testapp/displayAvail.do
>>>
>>>displayed in the address bar.   Is there anyway using struts that I
>>>
>>can
>>
>>>do this?
>>>
>>>-- 
>>>
>>>
>>>Cheers
>>>
>>>Tony
>>>-
>>>
>>>
>>>
>>>_
>>>
>>>Do You Yahoo!?
>>>
>>>Get your free @yahoo.com address at http://mail.yahoo.com
>>>
>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail:
>>><mailto:[EMAIL PROTECTED]>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>For additional commands, e-mail:
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>
>>-- 
>>
>>
>>Cheers
>>
>>Tony
>>-
>>
>>
>>
>>_
>>
>>Do You Yahoo!?
>>
>>Get your free @yahoo.com address at http://mail.yahoo.com
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>
>



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




Re: html:option and the 65k wall

2002-01-24 Thread Arron Bates

Scott, it's not a data delivery question, but the fact that Java wont 
run a class over 64K.
...but what you recommend is cool, I've done apps like that myself. 
Most cool.  :)

Danny, it really is a case of optimising stuff until the class size is 
down Apollo 13 style. Any Javascript, get that into its own .js file, 
same with CSS.
Then there's the efficiency of the markup of the tags. The more logic 
you get of the tags to do things, the less code there is in the servlet.
Last resort... are there any headers or footers which can be put into 
their own JSP and dynamically include them?...

It's just little fiddly stuff like that.

Arron.


Barr, Scott [IBM GSA] wrote:

>Hi Danny
>
>When using large lists in previous projects, I have used url that generate
>popup windows from which you can do searches on relevant data.
>The user would do their search in the popup, select the item they wanted.
>Clicking OK would the populate the parent form with the data, and close the
>popup window.
>Worked very well, and saved delivering large amounts of data to the client
>
>Just a suggestion :)
>Scott Barr
>
>
>>-Original Message-
>>From: Danny Collins [SMTP:[EMAIL PROTECTED]]
>>Sent: Friday, January 25, 2002 8:40 AM
>>To:   [EMAIL PROTECTED]
>>Subject:  html:option and the 65k wall
>>
>>Hello all,
>>I have a jsp page that has a ton of very long option lists.
>>These are all generated dynamically from the DB. The problem is, if we
>>try to use the html:option tag we exceed 65k. What I would like to do is
>>move each html:select with all of it's generated options into it's own
>>jsp and just include all of the jsps on the main page. The problem with
>>that is the html:select's are mapped to the form class and I can't seem
>>to be able to figure out the syntax to be able to get to the form using
>>the html:select and html:options on an included page.
>>We did try to use the jsp:useBean with  the FormClass on the
>>included page but that didn't seem to help. So either the included pages
>>are being compiled first so the form isn't in the request yet or we have
>>the syntax all wrong.
>> 
>>Any suggestions?
>> 
>>Danny Collins
>>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Includes and processing time

2002-01-24 Thread Arron

Actually... for performance, the first one is best. Why?... as when the 
main page is compiled, the files included by this method are included as 
if they were written in the one file, and then compiled. If a change is 
made to the include, it wont be picked up unless the main page is 
changed/recompiled for some reason. As it all ends up being the same 
page, this is faster performance wise when everything is compiled and 
dancing (C&D? :).

For flexibility, the second. This method will create a servlet for each 
include, and then pass the context from the first, to the included 
second. Because the servlets have to pass the context and everything, 
this is slower when everything is C&D. The second can also be called 
directly in its own right.

For my money, I usually go the first. Well, at least for any include 
that wont be edited without being able to restart the server. If it 
"needs" to be recompiled, you just touch the main page.

In some instances you "need" that second servlet. Why?... Java's spec 
means that it will only take a compiled class up to 62K (If memory 
serves. It's around there). Some pages we have to make can make this 
quite easily once it's all said and done. So this means you have to use 
the separate servlets. In one case I used the same include on multiple 
pages by creating an empty wrapper JSP which would make another servlet, 
and then include the static include like the other pages, and where 
included use the dynamic include.


More often than not, I go for door number one.
(also cool because it perfectly makes for nesting through to included 
files, so I can have my "view state" files for my nested beans. :)



Arron.


Keith Bacon wrote:

>Hi all,
>I tend to think that 
><%@ include file="my_page.jsp" %> is  bad,
><%jsp: include page="my_page.jsp" %> is best.
>
>Any opinions on this?
>If you change an included file I assume all the jsp's that access it are recompiled 
>next time they
>are used (or can be manually recompiled). Which could be very slow.
>Included pages get recompiled, but not the page that includes them ie. only the thing 
>you change
>gets recompiled.
>Is this right?
>
>Keith.
>
>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>
>>The type of include you're using here is a dynamic include. Meaning that 
>>the page to be included isn't simply added, it's compiled into its own 
>>servlet, and the page's context is passed to the included servlet. For 
>>the tags to work in the included servlet, they need all the taglib 
>>imports like your original JSP would.
>>
>>Or you can try the other form of include, which simply takes the file 
>>and puts it in the larger file when the JSP is compiled (this is the 
>>behavior it seems you are expecting)...
>><%@ include file="my_page.jsp" %>
>>
>>
>>Arron.
>>
>>Bryan P. Glennon wrote:
>>
>>>Hi -
>>>   This is really more of a JSP question, but since it involves struts
>>>tags I figured I'd give it a shot here. I have a page which contains a
>>>form built using the html:form taglib. Based on the users selection from
>>>that form, I go off and do some processing and redirect the user back to
>>>the same page. During the processing, an attribute gets set to indicate
>>>which detail information to include. I try to include this detail page
>>>(which is also an html:form form) by doing a jsp:include.  Basically,
>>>the page looks like this:
>>>
>>> 
>>> Navigation form
>>> 
>>>
>>> Static stuff here
>>>
>>> 
>>>
>>> My problem is that the tags in the included page never get
>>>processed. So, is there anyway I can make this work?
>>>
>>>   Sorry again for the OT post.
>>>
>>>Cheers,
>>>Bryan
>>>
>>>--
>>>Bryan Glennon (mailto:[EMAIL PROTECTED])
>>>BPG Consulting, Inc. (http://www.bpgc.com)
>>>Tech Question? (mailto:[EMAIL PROTECTED])
>>>
>>>--
>>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>
>
>__
>Do You Yahoo!?
>Great stuff seeking new owners in Yahoo! Auctions! 
>http://auctions.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Includes and processing time

2002-01-23 Thread Arron Bates

The type of include you're using here is a dynamic include. Meaning that 
the page to be included isn't simply added, it's compiled into its own 
servlet, and the page's context is passed to the included servlet. For 
the tags to work in the included servlet, they need all the taglib 
imports like your original JSP would.

Or you can try the other form of include, which simply takes the file 
and puts it in the larger file when the JSP is compiled (this is the 
behavior it seems you are expecting)...
<%@ include file="my_page.jsp" %>


Arron.

Bryan P. Glennon wrote:

>Hi -
>This is really more of a JSP question, but since it involves struts
>tags I figured I'd give it a shot here. I have a page which contains a
>form built using the html:form taglib. Based on the users selection from
>that form, I go off and do some processing and redirect the user back to
>the same page. During the processing, an attribute gets set to indicate
>which detail information to include. I try to include this detail page
>(which is also an html:form form) by doing a jsp:include.  Basically,
>the page looks like this:
>
>   
>   Navigation form
>   
>
>   Static stuff here
>
>   
>
>   My problem is that the tags in the included page never get
>processed. So, is there anyway I can make this work?
>
>Sorry again for the OT post.
>
>Cheers,
>Bryan
>
>--
>Bryan Glennon (mailto:[EMAIL PROTECTED])
>BPG Consulting, Inc. (http://www.bpgc.com)
>Tech Question? (mailto:[EMAIL PROTECTED])
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: property 'property' not set in NestedSubmitTag

2002-01-23 Thread Arron Bates

Believe it or not, this is as expected...

The nested extension is not to simply maintain the functionality of the 
original, but to provide it in the nested context. If you don't want the 
features of the nested context (the default submit tag), then use the 
original html:submit

When you use a nested tag, one thing is expected. The "property" 
property to be set and intended to be used in the nested context.
Also, where tags use a "name" attribute to identify a bean, this will be 
done automatically, supplied or not.

Just keep in mind, that if you don't need to nest a property, you should 
look at using the original tags in its place.
That's why all the tags weren't extended. Only those who could benefit 
from it.


Arron.


Christian Simonutti wrote:

>On Wed Jan 23, 2002 at 03:2322PM +0100, Tom Klaasen (TeleRelay) wrote:
>
>>Does attached patch work for you?
>>
>
>yes, works with reduced tag () as expected.
>
>thanx,
>simon
>
>[snip]
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Velocity-Tools / Struts

2002-01-22 Thread Arron

Do you mean, serve a form in Velocity and have Struts interpret it?...

 From what I know (FWIK? :) Velocity is more of a "view" system. You can 
use Velocity and Struts at the same time, using Velocity as the "view" 
system in the Struts MVC paradigm.

They're alsmost complementary in a way, and a few people are putting 
some effort into getting them married in an elegant fashion.

Other mails in this list have focused on resources for this, so have a 
search around.

Arron.

Gabriel Sidler wrote:

>Will Spies/Towers Perrin wrote:
>
>>That's great! But how about the other way? Can I post an array in velcity
>>up to a struts form ( via a controller ) which contains an array?
>>
>
>Sorry, I don't get what you mean here. Can you elaborate/make an example?
>
>Gabe
>
>
>
>>___
>>Will Spies
>>Towers Perrin
>>Phone: (215)246-7145
>>e-mail: [EMAIL PROTECTED]
>>
>>
>>
>> To: Struts Users Mailing List 
><[EMAIL PROTECTED]>
>>Gabriel Sidler   cc: (bcc: Will Spies/Towers Perrin)
>>>.ch>
>>
>>01/21/02 04:37
>>PM
>>Please respond
>>to "Struts
>>Users Mailing
>>List"
>>
>>
>>
>>Will Spies/Towers Perrin wrote:
>>
>>>It would be real helpful if this example include posting an array. Is
>>>
>>this
>>
>>>even doable with velstruts?
>>>
>>You mean like creating HTML output from the content of an array?
>>
>>That's quite simple. Assuming you have a 'user' object with 'orders'
>>associated
>>with the session, the template might look like this:
>>
>>
>>#foreach ($order in $session.user.orders)
>>  
>>$order.nbr
>>$order.text
>>$order.amount
>>  
>>#end
>>
>>
>>...would create a table of all orders. Were are going to add more doc and
>>examples. For now you find more info on the Velocity home page at
>>jakarta.apache.org/velocity/
>>
>>Gabe
>>
>>>___
>>>Will Spies
>>>Towers Perrin
>>>Phone: (215)246-7145
>>>e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>> To:
>>>
>>[EMAIL PROTECTED]
>>
>>>Ted Husted   cc: (bcc: Will Spies/Towers
>>>
>>Perrin)
>>
>>>>>
>>Struts
>>
>>>.org>
>>>
>>>01/18/02 09:46
>>>AM
>>>Please respond
>>>to "Struts
>>>Users Mailing
>>>List"
>>>
>>>
>>>
>>>Will Spies/Towers Perrin wrote:
>>>
>>>>>>And Velocity can access the Struts controller too :)
>>>>>>
>>>>is this documented anywhere? Is this just in development now or is it
>>>>
>>>part
>>>
>>>>of their release?
>>>>
>>>It hasn't made it into the release yet, but the code is already working
>>>and seems mature. It's just a matter of making the Struts elements
>>>available as standard objects that Velocity can see.
>>>
>>>Really ~very~ cool. You can download the sample application WAR here.
>>>Very much worth a look.
>>>
>>>http://husted.com/struts/resources/velstruts.zip
>>>
>>>I'll be working on adding more documentation for this, and other
>>>contributions like the Commons-Validator and Tiles to the Struts User
>>>Guide.
>>>
>>>-- Ted Husted, Husted dot Com, Fairport NY USA.
>>>-- Building Java web applications with Struts.
>>>-- Tel +1 585 737-3463.
>>>-- Web http://www.husted.com/struts/
>>>
>>>--
>>>To unsubscribe, e-mail:   <
>>>mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail: <
>>>mailto:[EMAIL PROTECTED]>
>>>
>>>--
>>>To unsubscribe, e-mail:   <
>>>
>>mailto:[EMAIL PROTECTED]>
>>
>>>For additional commands, e-mail: <
>>>
>>mailto:[EMAIL PROTECTED]>
>>
>>--
>>Gabriel Sidler
>>Software Engineer, Eivycom GmbH, Zurich, Switzerland
>>
>>--
>>To unsubscribe, e-mail:   <
>>mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <
>>mailto:[EMAIL PROTECTED]>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>
>--
>Gabriel Sidler
>Software Engineer, Eivycom GmbH, Zurich, Switzerland
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: problems while iterating through an iterator using

2002-01-18 Thread Arron

Was committed to the struts codebase yesterday.Should be in the next 
nightly build (18/01/2002).

Arron.

Bauer, John wrote:

>Is there any plan to incorporate this extension into the core struts release
>anytime soon?
>
>-Original Message-
>From: Arron [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 18, 2002 9:14 AM
>To: Struts Users Mailing List
>Subject: Re: problems while iterating through an iterator
>using
>
>
>An extension to the struts tags which makes this 100% easier, visit here...
>
>http://www.keyboardmonkey.com/struts
>
>...primer, tutorial, and everything you'll need to get up and running.
>
>
>Arron.
>
>
>Chalissary, David wrote:
>
>>Hi again,
>>
>>I have seen a bug in the bugzilla archive for Bug report for Struts
>>[2001/09/04] the bug report says :
>>2046|Opn|Enh|2001-06-07|a struts tag within another struts tag,
>>
>>as I am using a struts tag within another struts, that is logic:iterate
>>within another logic:iterate could this be the problem.
>>
>>Any help would be higly appreciated.
>>
>>regds,
>>
>>David
>>
>>-Original Message-
>>From: Chalissary, David 
>>Sent: 18 January 2002 10:32
>>To: [EMAIL PROTECTED]
>>Subject: problems while iterating through an iterator
>>using
>>
>>
>>Hi,
>>
>>I am having a problem while using , I am using a logic
>>iterate
>>within another logic:iterate. It retrieves the first list which is an
>>ArrayList
>>and within this array list there is a String array of information which
>>needs to be 
>>displayed. The problem occurs while iterating through the second list,
>>the jsp 
>>exception says it cannot find the id of the second iterator before
>>iterating, 
>>but just after the exception, it prints the contents of the second
>>array.
>>I used the bean write to print out the contents of first logic iterate
>>and its fine, the error occurs before the second array of information is
>>printed.
>>
>>I havent got a clue what could be the cause of this errorhas anyone
>>encountered 
>>such a problem. I have included the code here :
>>
>>>type="ResultArray">
>>
>>  
>>>property="result"  
>>   type="java.lang.String"
>>scope="page">
>>>name="finalResult" />
>>
>> 
>>
>>  
>>
>>  >href="SearchResultAction.do?action=>%>&objectId=" >>name="resultID"/> 
>>   
>>  
>>
>>
>>and the exception generated is as given below  :
>>
>>javax.servlet.jsp.JspException: Cannot find bean finalResult in scope
>>null 
>>at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:493) 
>>at
>>org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:200) 
>>at /SearchResult.jsp._jspService(/SearchResult.jsp.java:444) (JSP page
>>line 130) 
>>at com.orionserver[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54) 
>>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5459) 
>>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].server.http.JSPServlet.service(JSPServlet.java:31) 
>>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatch
>>er.java:508) 
>>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletReques
>>tDispatcher.java:177) 
>>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>>J2EE].server.http.ServletRequestDispatcher.forward(ServletRequestDispatc
>>her.java:148) 
>>at
>>org.apache.struts.action.ActionServlet.processActionForward(ActionServle
>>t.java:1758) 
>>at
>>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595) 
>>at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
>>
>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:211) 
>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:309) 
>>at javax.servlet.http.HttpServlet.service(HttpServlet.java:336

Re: problems while iterating through an iterator using

2002-01-18 Thread Arron

An extension to the struts tags which makes this 100% easier, visit here...

http://www.keyboardmonkey.com/struts

...primer, tutorial, and everything you'll need to get up and running.


Arron.


Chalissary, David wrote:

>Hi again,
>
>I have seen a bug in the bugzilla archive for Bug report for Struts
>[2001/09/04] the bug report says :
>2046|Opn|Enh|2001-06-07|a struts tag within another struts tag,
>
>as I am using a struts tag within another struts, that is logic:iterate
>within another logic:iterate could this be the problem.
>
>Any help would be higly appreciated.
>
>regds,
>
>David
>
>-Original Message-
>From: Chalissary, David 
>Sent: 18 January 2002 10:32
>To: [EMAIL PROTECTED]
>Subject: problems while iterating through an iterator
>using
>
>
>Hi,
>
>I am having a problem while using , I am using a logic
>iterate
>within another logic:iterate. It retrieves the first list which is an
>ArrayList
>and within this array list there is a String array of information which
>needs to be 
>displayed. The problem occurs while iterating through the second list,
>the jsp 
>exception says it cannot find the id of the second iterator before
>iterating, 
>but just after the exception, it prints the contents of the second
>array.
>I used the bean write to print out the contents of first logic iterate
>and its fine, the error occurs before the second array of information is
>printed.
>
>I havent got a clue what could be the cause of this errorhas anyone
>encountered 
>such a problem. I have included the code here :
>
> type="ResultArray">
> 
>   
> property="result"  
>type="java.lang.String"
>scope="page">
> name="finalResult" />
> 
>  
> 
>   
> 
>   href="SearchResultAction.do?action=%>&objectId=" >name="resultID"/> 
>
>   
> 
>
>and the exception generated is as given below  :
>
>javax.servlet.jsp.JspException: Cannot find bean finalResult in scope
>null 
>at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:493) 
>at
>org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:200) 
>at /SearchResult.jsp._jspService(/SearchResult.jsp.java:444) (JSP page
>line 130) 
>at com.orionserver[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54) 
>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5459) 
>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].server.http.JSPServlet.service(JSPServlet.java:31) 
>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatch
>er.java:508) 
>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletReques
>tDispatcher.java:177) 
>at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for
>J2EE].server.http.ServletRequestDispatcher.forward(ServletRequestDispatc
>her.java:148) 
>at
>org.apache.struts.action.ActionServlet.processActionForward(ActionServle
>t.java:1758) 
>at
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595) 
>at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
>
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:211) 
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:309) 
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:336) 
>
>regds,
>
>David
>
>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Things that use Struts

2002-01-18 Thread Arron

Go to www.JBoss.org
Apparently they're starting to give the larger boys a stir!

More importantly, I need to comment on the beer issue. The foster's you 
have up there is a US company with an AUS label. The only real beer, is 
the beer down here!


Arron.

Mark Galbreath wrote:

>My point was more towards the issue of Tomcat not being an EJB container and
>the apparent scope of the company would make EJBs mandatory for handling
>data access.
>
>But I know what you mean about a company getting cheap on you.  I am forced
>to used JRun (chosen solely based on the price), arguablly the worst app
>server on the planet.
>
>And stop sending that Foster's crap up here - we want real beer!
>
>Cheers!
>Mark
>
>-Original Message-
>From: Dan Washusen [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 17, 2002 10:50 PM
>To: Struts Users Mailing List
>Subject: RE: Things that use Struts
>
>
>Like I said, it's only a proof of concept.  The company in question is used
>to paying a LOT of money for it's application servers, apparently they
>almost jumped at the chance at cutting that cost to near nothing... I'm only
>a lowly dev on the project and don't really know any of the politics
>associated.  At the moment the only technical issues I am aware of with
>tomcat is it's comparably ineffective method of session management and fail
>over (being restricted to one apache instance for the tomcat sticky
>sessions).
>
>Anyway, I just thought you might like to know about it.  We are definitely
>using Struts, Tomcat may change due to the above issue.
>
>-Original Message-
>From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
>Sent: Friday, 18 January 2002 12:23 PM
>To: Struts Users Mailing List
>Subject: Re: Things that use Struts
>
>
>"One of Australias' biggest sites?"  How are you going to that with Tomcat?
>
>Cheers!
>Mark
>
>- Original Message -
>From: "Dan Washusen" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Thursday, January 17, 2002 8:02 PM
>Subject: RE: Things that use Struts
>
>
>>Hey everyone,
>>I'm currently working on a proof of concept for a re-write of one of
>>Australia's biggest sites (just under a million searches a month).  The
>>proof of concept runs the front end (presentation layer) on Linux with
>>Tomcat 4 and Struts.  I'll keep you posted on how it goes (so far so
>>
>good).
>
>>There is even some talk of Lucene being used.
>>
>>Needless to say, we are very impressed with both Tomcat and Struts.
>>
>>Cheers,
>>Dan
>>
>>-Original Message-
>>From: Stuart Charlton [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, 18 January 2002 10:01 AM
>>To: '[EMAIL PROTECTED]'
>>Subject: Things that use Struts
>>
>>
>>Hi everyone,
>>
>>I've been a Struts developer and lurker since 1.0 was first released and
>>have been pushing it in a big way within my company... Just wanted to
>>
>throw
>
>>in my two cents about where we're using Struts for people who are
>>
>wondering
>
>>whether Struts is right for their project, or if it can tackle a large
>>
>scale
>
>>system.
>>
>>a) We have a subcontract that's replacing a system for a division of the
>>U.S. Navy.  This system is replacing 1.5 million lines of COBOL code with
>>
>a
>
>>J2EE solution using Struts, WebLogic and TOPLink.  After 3 months of
>>development is nearly 60,000 lines of code and will be around 150,000 by
>>
>the
>
>>time we're done.  Most of the screens are pretty static, but this is
>>definitely a huge system, and Struts' design paradigm has scaled
>>
>gracefully
>
>>(with a lot of help from TOPLink).
>>
>>b) One of our financial clients is using a web-based inventory system for
>>trading whole loans & mortgages.  This will be refactored to incorporate
>>Struts over the next several months (currently it's a bit icky, somewhere
>>between JSP model 0 or 1 in terms of modularity).
>>
>>c) Our new venture with Random House, http://www.codenotes.com/ was
>>
>written
>
>>completely with Struts on JRun.
>>
>>Struts is a great framework, the code is clean enough to eat off of, and
>>
>it
>
>>really makes J2EE sing.  With a lot of the new whiz-bang ASP.NET features
>>coming down the pipe, I think Struts really is what's keeping JSP/Servlet
>>development competitive
>>
>>Cheers
>>Stu Charlton
>>

Re: Is there a better way to write this code?

2002-01-17 Thread Arron Bates

c tang wrote:

>You are right this thing is very powerful.  But that
>should not be the reason to not doing it.  I can
>always do the MyBean.wait() in scriptlet.  There is
>nothing to stop that.  
>
>Power to the developers!
>
So why complain about not being able to do something and just do it in a 
scriptlet?...


Arron.

(Power to the developer?... Assember's powerful. Why don't you make 
webapps in that?... They'll *really* fly.
None of this VM sh-t :)


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




Re: Is there a better way to write this code?

2002-01-17 Thread Arron

I can see what you're trying to say and it would be truly flexible if 
you could do that.

But I can already foresee the reaction from the die-hards, and that is 
that it would give the person doing the markup "too" much power. 
Probably get at some things that shouldn't be gotten at, like MyBean.wait().

Nice idea, wouldn't get past the committing committee I'm afraid.

And the fact is, if you want to get that sort of power, you may as well 
script it. There's plenty of ways to get a hold of your object for 
scripting. The MVC model is to decouple a the model. Having access to a 
specific api isn't decoupling.


Arron.

c tang wrote:

>Creating a wrapper class may get rid of scriptlet in
>JSP. But that means for every public api (such as
>Collection.size(), Object.toString()) that does not
>fit get/set pattern, a wrapper class has to be created
>in order to avoid scriptlet using struts.  IMHO, that
>is worse than just using scriptlet because it bloats
>the class number significantly.
>
>ct
>
>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>
>>A getter method like...
>>
>>public int getMyListSize() {
>>return this.myList.getSize();
>>}
>>
>>with a tag like...
>>
>>...maybe?
>>
>>
>>Arron.
>>
>>
>>c tang wrote:
>>
>>>I agree with Alex that current strut taglib has a
>>>
>>big
>>
>>>deficiency.  It allows only access through get/set
>>>methods of a property.  How do I write the size of
>>>collection object to a page without resorting
>>>scriptlet or <%=?  How do I write toString() output
>>>
>>to
>>
>>>a page without resorting scriptlet or <%=?
>>>
>>>I had a proposal to allow x.y expression to get y
>>>in the this order:
>>>(1) x.getY()
>>>(2) x.y()
>>>(3) x.y
>>>
>>>In this way, to write toString of x object to a
>>>
>>page,
>>
>>>simply use
>>>
>>>
>>>This proposal is shotdown.  Without this, scriptlet
>>>has to be used in jsp.
>>>
>>>ct
>>>
>>>
>>>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>>>
>>>>For one, I recommend getting your properties into
>>>>getter/setter 
>>>>methodology. Simply so you can use the wealth that
>>>>is the Struts tagging 
>>>>system (as it's (the bean spec Struts runs against
>>>>for it's model 
>>>>components) kind of what it's all about).
>>>>
>>>>By "'raw' String" do you mean the object's
>>>>"toString()" method?... Any 
>>>>property that yields and object to be written out
>>>>will have it's 
>>>>"toString()" method called to write it to the
>>>>output.
>>>>
>>>>I'm also curious about your "null pointer" issue
>>>>with the nested 
>>>>extension (for some reason :).
>>>>Can I get a hold of the bean and JSP you were
>>>>
>>trying
>>
>>>>to run it with?...
>>>>
>>>>Arron.
>>>>
>>>>
>>>>Alex Paransky wrote:
>>>>
>>>>>I am pretty new with struts and wrote the
>>>>>
>>following
>>
>>>>.JSP code.  Is there a
>>>>
>>>>>better way to write this?  I could not find a tag
>>>>>
>>>>in STRUTS to let me just
>>>>
>>>>>get the property from the object.  My object does
>>>>>
>>>>not have get/set methods,
>>>>
>>>>>so I had to resort to using <%= tag.  Is there a
>>>>>
>>>>tag in STRUTS that would
>>>>
>>>>>just access the "raw" String attribute of the
>>>>>
>>>>object instead of calling
>>>>
>>>>>get/set?
>>>>>
>>>>>I also tried using the keyboardmonkey nested
>>>>>
>>>>library, but kept getting
>>>>
>>>>>NullPointerExceptions when nested:iterate would
>>>>>
>>>>execute
>>>>
>>>>>>>>>
>>>class="com.myprofiles.client.web.bean.MemberProfileHeadersBean"
>>>
>>>>/>
>>>>
>>>>>>>>>
>>>>property="profiles"
>>>>
>>>type="com.myprofiles.service.common.ProfileHeaderValue">
>>>
>>>>><%=profile.name%>
>>>>><%=profile.description%>
>>>>>
>>>>>
>>>>>Thanks.
>>>>>
>>>>>
>>>>>-AP_
>>>>>www: http://www.alexparansky.com
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail:  
>>>>>
>>><mailto:[EMAIL PROTECTED]>
>>>
>>>>>For additional commands, e-mail:
>>>>>
>>>><mailto:[EMAIL PROTECTED]>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:  
>>>>
>>><mailto:[EMAIL PROTECTED]>
>>>
>>>>For additional commands, e-mail:
>>>><mailto:[EMAIL PROTECTED]>
>>>>
>>>
>>>__
>>>Do You Yahoo!?
>>>Send FREE video emails in Yahoo! Mail!
>>>http://promo.yahoo.com/videomail/
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>For additional commands, e-mail:
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:  
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>
>
>__
>Do You Yahoo!?
>Send FREE video emails in Yahoo! Mail!
>http://promo.yahoo.com/videomail/
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Indexed properties...setters and getters

2002-01-16 Thread Arron Bates

Is "table[5].minimumSales" the tag's "name" or its "property" property?...

Have you tried the nested extension for doing this stuff?...


Arron.

TODD HARNEY wrote:

>If I have a html:text field on my form with the property named table[5].minimumSales, 
>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:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: FW: Nesting Beans/Iterators/... GOT IT!

2002-01-16 Thread Arron Bates

Sweet!
:)

Have fun.


Arron.



Collard, John wrote:

>Thanks for all the help!  The problem (for some reason) was the name of my
>property!  I simply created another property and its getter that returned
>the value of the first property.  
>
>John Collard
>[EMAIL PROTECTED]
>


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




Re: Is there a better way to write this code?

2002-01-16 Thread Arron Bates

You have three options on starting the nested tags.

nested:form - extends html:form
html:form - naturally
nested:root - this is the "formless" option for starting off. It requires only a 
"name" attribute which has to match the name of a bean which is in "scope". This can 
be done by defining a bean in the struts-config.xml and have it put in session scope, 
or you can use the  tag and set the name of the nested:root tag to the 
name of the bean in this jap:useBean tag.

One other thing...




...there's no need to set the "name" property here. It will be ignored by the nested 
tags anyway, as they must rely on the founded name set by the parent tags.


Arron.


Alex Paransky wrote:

>Some background:
>
>I am using Struts 1.0.1.  The nested tags were obtained from
>http://www.keyboardmonkey.com/struts.  I could not find a reference manual
>for the nested tags, but looking at the .TDL it appears as they were
>intended to be a 1-to-1 mapping with struts.  So I simply replaced
>struts-logic.tld and nested references the nested-tags.tld).  I even removed
>the code in the tag, so it looked like this:
>
>
>
>
>In the examples on the www.keyboardmonkey.com/struts site, all the tags were
>used inside of a form.  I don't have a form, perhaps that's why I was
>getting a null pointer exception.  I am new with STRUTS so I do not know why
>this is happening and I have not had a chance to dig into the source code
>yet.
>
>Thanks.
>-AP_
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 15, 2002 10:30 PM
>To: Struts Users Mailing List
>Subject: Re: Is there a better way to write this code?
>
>
>For one, I recommend getting your properties into getter/setter
>methodology. Simply so you can use the wealth that is the Struts tagging
>system (as it's (the bean spec Struts runs against for it's model
>components) kind of what it's all about).
>
>By "'raw' String" do you mean the object's "toString()" method?... Any
>property that yields and object to be written out will have it's
>"toString()" method called to write it to the output.
>
>I'm also curious about your "null pointer" issue with the nested
>extension (for some reason :).
>Can I get a hold of the bean and JSP you were trying to run it with?...
>
>Arron.
>
>
>Alex Paransky wrote:
>
>>I am pretty new with struts and wrote the following .JSP code.  Is there a
>>better way to write this?  I could not find a tag in STRUTS to let me just
>>get the property from the object.  My object does not have get/set methods,
>>so I had to resort to using <%= tag.  Is there a tag in STRUTS that would
>>just access the "raw" String attribute of the object instead of calling
>>get/set?
>>
>>I also tried using the keyboardmonkey nested library, but kept getting
>>NullPointerExceptions when nested:iterate would execute
>>
>>>class="com.myprofiles.client.web.bean.MemberProfileHeadersBean" />
>>>type="com.myprofiles.service.common.ProfileHeaderValue">
>> <%=profile.name%>
>> <%=profile.description%>
>>
>>
>>Thanks.
>>
>>
>>-AP_
>>www: http://www.alexparansky.com
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Is there a better way to write this code?

2002-01-16 Thread Arron Bates

A getter method like...

public int getMyListSize() {
return this.myList.getSize();
}

with a tag like...

...maybe?


Arron.


c tang wrote:

>I agree with Alex that current strut taglib has a big
>deficiency.  It allows only access through get/set
>methods of a property.  How do I write the size of
>collection object to a page without resorting
>scriptlet or <%=?  How do I write toString() output to
>a page without resorting scriptlet or <%=?
>
>I had a proposal to allow x.y expression to get y
>in the this order:
>(1) x.getY()
>(2) x.y()
>(3) x.y
>
>In this way, to write toString of x object to a page,
>simply use
>
>
>This proposal is shotdown.  Without this, scriptlet
>has to be used in jsp.
>
>ct
>
>
>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>
>>For one, I recommend getting your properties into
>>getter/setter 
>>methodology. Simply so you can use the wealth that
>>is the Struts tagging 
>>system (as it's (the bean spec Struts runs against
>>for it's model 
>>components) kind of what it's all about).
>>
>>By "'raw' String" do you mean the object's
>>"toString()" method?... Any 
>>property that yields and object to be written out
>>will have it's 
>>"toString()" method called to write it to the
>>output.
>>
>>I'm also curious about your "null pointer" issue
>>with the nested 
>>extension (for some reason :).
>>Can I get a hold of the bean and JSP you were trying
>>to run it with?...
>>
>>Arron.
>>
>>
>>Alex Paransky wrote:
>>
>>>I am pretty new with struts and wrote the following
>>>
>>.JSP code.  Is there a
>>
>>>better way to write this?  I could not find a tag
>>>
>>in STRUTS to let me just
>>
>>>get the property from the object.  My object does
>>>
>>not have get/set methods,
>>
>>>so I had to resort to using <%= tag.  Is there a
>>>
>>tag in STRUTS that would
>>
>>>just access the "raw" String attribute of the
>>>
>>object instead of calling
>>
>>>get/set?
>>>
>>>I also tried using the keyboardmonkey nested
>>>
>>library, but kept getting
>>
>>>NullPointerExceptions when nested:iterate would
>>>
>>execute
>>
>>>>>
>>class="com.myprofiles.client.web.bean.MemberProfileHeadersBean"
>>/>
>>
>>>>>
>>property="profiles"
>>
>>type="com.myprofiles.service.common.ProfileHeaderValue">
>>
>>> <%=profile.name%>
>>> <%=profile.description%>
>>>
>>>
>>>Thanks.
>>>
>>>
>>>-AP_
>>>www: http://www.alexparansky.com
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>For additional commands, e-mail:
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:  
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>
>
>__
>Do You Yahoo!?
>Send FREE video emails in Yahoo! Mail!
>http://promo.yahoo.com/videomail/
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Is there a better way to write this code?

2002-01-15 Thread Arron Bates

For one, I recommend getting your properties into getter/setter 
methodology. Simply so you can use the wealth that is the Struts tagging 
system (as it's (the bean spec Struts runs against for it's model 
components) kind of what it's all about).

By "'raw' String" do you mean the object's "toString()" method?... Any 
property that yields and object to be written out will have it's 
"toString()" method called to write it to the output.

I'm also curious about your "null pointer" issue with the nested 
extension (for some reason :).
Can I get a hold of the bean and JSP you were trying to run it with?...

Arron.


Alex Paransky wrote:

>I am pretty new with struts and wrote the following .JSP code.  Is there a
>better way to write this?  I could not find a tag in STRUTS to let me just
>get the property from the object.  My object does not have get/set methods,
>so I had to resort to using <%= tag.  Is there a tag in STRUTS that would
>just access the "raw" String attribute of the object instead of calling
>get/set?
>
>I also tried using the keyboardmonkey nested library, but kept getting
>NullPointerExceptions when nested:iterate would execute
>
>class="com.myprofiles.client.web.bean.MemberProfileHeadersBean" />
>type="com.myprofiles.service.common.ProfileHeaderValue">
>  <%=profile.name%>
>  <%=profile.description%>
>
>
>Thanks.
>
>
>-AP_
>www: http://www.alexparansky.com
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Nesting Beans/Iterators/Logic tags & whatever else...

2002-01-15 Thread Arron Bates

"There are many applications for the tags use -- even out side the iterate process"

Hell yes! :)

I suppose some people will just see it as a way past their nested iteration problems,
but it brings so much more. Among other things, it will clean your JSP's because the 
markup's reduced for those tags working off the default bean for the form/root tag. 
This is just one of the benefits.

The tags literally extend the original Struts tags so the do exactly the same things, 
but in an improved markup context. Fact is, I've seen so many people in this user 
group use nested beans (anyone using "dot notation" in their properties, is nesting), 
and they can manage that so much easier if they go to the nested context.

Personally, it's a kick in the a-- of those other templating engines. I haven't heard 
of people moving over to them because they offer a better OO approach to their markup. 
(this is a personal view however ;)


Arron.


The full spiel --==>>
http://www.keyboardmonkey.com/struts



Collard, John wrote:

>I didn't intend to sound as negative as I did.  I do owe that-- working on
>it.  I do like it and will at least use different parts of it.  There are
>many applications for the tags use -- even out side the iterate process.
>
>John Collard
>[EMAIL PROTECTED]
>


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




Re: Loading data for

2002-01-14 Thread Arron Bates

My favorite way is to use the struts html:options tag and have its 
"property" property point to a getter in the form's bean which returns a 
list. Then the tag will manage the drop down option's "selected" 
attribute automatically.

The list can be derived from your database of course. I've also use XML 
Schema generated options to create the list.

Arron.

Mark Woon wrote:

>Hi all...
>
>What's the standard way of loading a list of options from a database for
>use within the  tag?  Do you normally just do it within the
>JSP page?  Is there a way to get the ActionForm to load it?  Or do you
>do something completely different?
>
>Thanks,
>-Mark
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Bug in BeanUtils.populate()

2002-01-14 Thread Arron Bates

Diff the change and send a mail to the commons dev list with [PATCH] bug 
- (bugNumber)

Might take a couple of attempts, but someone should get it. Might have a 
conversation as to that it should be painted yellow, but that'd be about 
it. I went through the same ordeal to get the List support in there.
This is with the spec so it should be easier.


Arron.

Jason Chaffee wrote:

>It isn't ignorance, we just weren't on the same page.  :)
>
>Anyway, I filed a bug in commons back in October or ealy November.  I
>was hoping it would have been fixed by now, but it appears it hasn't...
>
>I have tested my change and it works fine.
>
>-Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 14, 2002 3:03 PM
>To: Struts Users Mailing List
>Subject: Re: Bug in BeanUtils.populate()
>
>
>I get what you're trying to do now.
>Sorry about all that.
>
>If you can test your change and make a CVS diff of the changes, why 
>don't you log a bugzilla bug in commons and submit it to the commons dev
>
>list?...
> ...otherwise I can look into it for you.
>
>Once again, sorry about the ignorance.
>
>
>Arron.
>
>Jason Chaffee wrote:
>
>>Again, you are missing the point.  The following is allowed:
>>
>>void setFoo(int index, PropertyType value)
>>
>>This means that the PropertyType can be of the type Object[].
>>
>>-Original Message-
>>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, January 14, 2002 2:36 PM
>>To: Struts Users Mailing List
>>Subject: Re: Bug in BeanUtils.populate()
>>
>>
>>Here is the spec...
>>
>>http://java.sun.com/products/javabeans/docs/beans.101.pdf
>>
>>
>>...where in it does it have...
>>
>>void setFoo(int index, Object[] array)
>>
>>...?  Indexed methods description starts on page 40, and go over to 41.
>>
>>
>>Arron.
>>
>>Jason Chaffee wrote:
>>
>>>Let me try to clearify this again.  The following is supported by the
>>>JavaBean spec.
>>>
>>>void setFoo(int index, Object[] array)
>>>
>>>where Object[] is the Propertytype.
>>>
>>>This means that foo is an array of arrays.  Now, look at the code
>>>snippet from BeanUtils.populate(), you will notice that there is
>>>
>>special
>>
>>>logic to handle a parameterType that is an array.  However, this check
>>>is only checking the first parameter.  In other words, it doesn't
>>>account for the fact that the second parameter in an indexed setter
>>>
>may
>
>>>be of array type.  In particular, see the line, if
>>>(parameterTypes[0].isArray()), this should be, if
>>>(parameterType.isArray()).  This would account for an indexed setter
>>>
>>and
>>
>>>it would handle the logic if it is of type array.  The bug is really
>>>quite obivious when looking at the code.
>>>
>>>  Class parameterTypes[] = setter.getParameterTypes();
>>>  /*
>>>  if (debug >= 1)
>>>  System.out.println("Setter method is '" +
>>> setter.getName() + "(" +
>>> parameterTypes[0].getName() +
>>> (parameterTypes.length > 1 ?
>>>  ", " + parameterTypes[1].getName()
>>>
>>:
>>
>>>"" )
>>> + ")'");
>>>  */
>>>  Class parameterType = parameterTypes[0];
>>>  if (parameterTypes.length > 1)
>>>  parameterType = parameterTypes[1];  // Indexed
>>>setter
>>>
>>>  // Convert the parameter value as required for this setter
>>>method
>>>  Object parameters[] = new Object[1];
>>>  if (parameterTypes[0].isArray()) {
>>>  if (value instanceof String) {
>>>  String values[] = new String[1];
>>>  values[0] = (String) value;
>>>  parameters[0] = ConvertUtils.convert((String[])
>>>values,
>>>  parameterType);
>>>  } else if (value instanceof String[]) {
>>>  parameters[0] = ConvertUtils.convert((String[])
>>>value,
>>>  parameterType);
>>>  } else {
>>>  parameters[0] = value;

Re: Bug in BeanUtils.populate()

2002-01-14 Thread Arron Bates

I get what you're trying to do now.
Sorry about all that.

If you can test your change and make a CVS diff of the changes, why 
don't you log a bugzilla bug in commons and submit it to the commons dev 
list?...
 ...otherwise I can look into it for you.

Once again, sorry about the ignorance.


Arron.

Jason Chaffee wrote:

>Again, you are missing the point.  The following is allowed:
>
>void setFoo(int index, PropertyType value)
>
>This means that the PropertyType can be of the type Object[].
>
>-----Original Message-
>From: Arron Bates [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 14, 2002 2:36 PM
>To: Struts Users Mailing List
>Subject: Re: Bug in BeanUtils.populate()
>
>
>Here is the spec...
>
>http://java.sun.com/products/javabeans/docs/beans.101.pdf
>
>
>...where in it does it have...
>
>void setFoo(int index, Object[] array)
>
>...?  Indexed methods description starts on page 40, and go over to 41.
>
>
>Arron.
>
>Jason Chaffee wrote:
>
>>Let me try to clearify this again.  The following is supported by the
>>JavaBean spec.
>>
>>void setFoo(int index, Object[] array)
>>
>>where Object[] is the Propertytype.
>>
>>This means that foo is an array of arrays.  Now, look at the code
>>snippet from BeanUtils.populate(), you will notice that there is
>>
>special
>
>>logic to handle a parameterType that is an array.  However, this check
>>is only checking the first parameter.  In other words, it doesn't
>>account for the fact that the second parameter in an indexed setter may
>>be of array type.  In particular, see the line, if
>>(parameterTypes[0].isArray()), this should be, if
>>(parameterType.isArray()).  This would account for an indexed setter
>>
>and
>
>>it would handle the logic if it is of type array.  The bug is really
>>quite obivious when looking at the code.
>>
>>   Class parameterTypes[] = setter.getParameterTypes();
>>   /*
>>   if (debug >= 1)
>>   System.out.println("Setter method is '" +
>>  setter.getName() + "(" +
>>  parameterTypes[0].getName() +
>>  (parameterTypes.length > 1 ?
>>   ", " + parameterTypes[1].getName()
>>
>:
>
>>"" )
>>  + ")'");
>>   */
>>   Class parameterType = parameterTypes[0];
>>   if (parameterTypes.length > 1)
>>   parameterType = parameterTypes[1];  // Indexed
>>setter
>>
>>   // Convert the parameter value as required for this setter
>>method
>>   Object parameters[] = new Object[1];
>>   if (parameterTypes[0].isArray()) {
>>   if (value instanceof String) {
>>   String values[] = new String[1];
>>   values[0] = (String) value;
>>   parameters[0] = ConvertUtils.convert((String[])
>>values,
>>   parameterType);
>>   } else if (value instanceof String[]) {
>>   parameters[0] = ConvertUtils.convert((String[])
>>value,
>>   parameterType);
>>   } else {
>>   parameters[0] = value;
>>   }
>>   } else {
>>   if (value instanceof String) {
>>   parameters[0] = ConvertUtils.convert((String)
>>
>value,
>
>>   parameterType);
>>   } else if (value instanceof String[]) {
>>   parameters[0] = ConvertUtils.convert(((String[])
>>value)[0],
>>   parameterType);
>>   } else {
>>   parameters[0] = value;
>>   }
>>   }
>>
>>-Original Message-
>>From: Arron [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, January 14, 2002 2:55 AM
>>To: Struts Users Mailing List
>>Subject: Re: Bug in BeanUtils.populate()
>>
>>
>>The method definitions were literally cut-and-paste from the spec.
>>There is no other code in the spec relating to indexed properties.
>>
>>Arron.
>>
>>
>>Jason Chaffee wrote:
>>
>>>The spec. supports the following:
>>>
>>>setFoo(int index, Object[] array)
>>>
>>>However, BeanUtils.populate() does not.  The problem is that
>>>BeanUtils.populate() isn't checking if 

Re: Nesting Beans/Iterators/Logic tags & whatever else...

2002-01-14 Thread Arron Bates

I'm willing to help you out if you can jar up the code and JSP's you 
have issues with.


Arron.


Collard, John wrote:

>Spent about 25 hours attempting to get it to work.  Kept getting the "no
>getter method found" error, even though I must have compared my code to the
>examples 60-70 times. Sorry.
>
>
>>John Collard
>>Senior Systems Analyst
>>UtiliCorp United Information Technology
>>7101 Mercy Road, Suite 400
>>Omaha, NE  68106
>>voice: 402-926-5236
>>fax: 402-996-9736 
>>email: [EMAIL PROTECTED]
>>
>>
>
>
>-Original Message-
>From: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 14, 2002 4:23 AM
>To: Struts Users Mailing List
>Subject: RE: Nesting Beans/Iterators/Logic tags & whatever else...
>
>
>>-Original Message-
>>From: Arron Bates [mailto:[EMAIL PROTECTED]] 
>>Sent: vrijdag 11 januari 2002 3:01
>>To: Struts Users Mailing List
>>Subject: Nesting Beans/Iterators/Logic tags & whatever else...
>>
>[...]
>
>>If you have used the extension and found it useful, can you 
>>please reply 
>>to this mail to show others that people are using it, and that it is 
>>worth using 
>>
>[...]
>
>You know I use it, and you know I love it :-)
>
>tomK
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Bug in BeanUtils.populate()

2002-01-14 Thread Arron Bates

Here is the spec...

http://java.sun.com/products/javabeans/docs/beans.101.pdf


...where in it does it have...

void setFoo(int index, Object[] array)

...?  Indexed methods description starts on page 40, and go over to 41.


Arron.

Jason Chaffee wrote:

>Let me try to clearify this again.  The following is supported by the
>JavaBean spec.
>
>void setFoo(int index, Object[] array)
>
>where Object[] is the Propertytype.
>
>This means that foo is an array of arrays.  Now, look at the code
>snippet from BeanUtils.populate(), you will notice that there is special
>logic to handle a parameterType that is an array.  However, this check
>is only checking the first parameter.  In other words, it doesn't
>account for the fact that the second parameter in an indexed setter may
>be of array type.  In particular, see the line, if
>(parameterTypes[0].isArray()), this should be, if
>(parameterType.isArray()).  This would account for an indexed setter and
>it would handle the logic if it is of type array.  The bug is really
>quite obivious when looking at the code.
>
>Class parameterTypes[] = setter.getParameterTypes();
>/*
>if (debug >= 1)
>System.out.println("Setter method is '" +
>   setter.getName() + "(" +
>   parameterTypes[0].getName() +
>   (parameterTypes.length > 1 ?
>", " + parameterTypes[1].getName() :
>"" )
>   + ")'");
>*/
>Class parameterType = parameterTypes[0];
>if (parameterTypes.length > 1)
>parameterType = parameterTypes[1];  // Indexed
>setter
>
>// Convert the parameter value as required for this setter
>method
>Object parameters[] = new Object[1];
>if (parameterTypes[0].isArray()) {
>if (value instanceof String) {
>String values[] = new String[1];
>values[0] = (String) value;
>parameters[0] = ConvertUtils.convert((String[])
>values,
>parameterType);
>} else if (value instanceof String[]) {
>parameters[0] = ConvertUtils.convert((String[])
>value,
>parameterType);
>} else {
>parameters[0] = value;
>}
>} else {
>if (value instanceof String) {
>parameters[0] = ConvertUtils.convert((String) value,
>parameterType);
>} else if (value instanceof String[]) {
>    parameters[0] = ConvertUtils.convert(((String[])
>value)[0],
>parameterType);
>} else {
>parameters[0] = value;
>}
>}
>
>-Original Message-
>From: Arron [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 14, 2002 2:55 AM
>To: Struts Users Mailing List
>Subject: Re: Bug in BeanUtils.populate()
>
>
>The method definitions were literally cut-and-paste from the spec.
>There is no other code in the spec relating to indexed properties.
>
>Arron.
>
>
>Jason Chaffee wrote:
>
>>The spec. supports the following:
>>
>>setFoo(int index, Object[] array)
>>
>>However, BeanUtils.populate() does not.  The problem is that
>>BeanUtils.populate() isn't checking if the second parameter is an array
>>or not, it only checks the first parameter.  However, the JavaBean
>>
>spec.
>
>>allows for the second paramter to be of an array type.  If you try
>>
>this,
>
>>you will find that it doesn't work in struts1.0 or struts1.0.1 unless
>>you make the change to the code that I suggested below.  If you look at
>>the code, the bug is very obivious.
>>
>>
>>  -Original Message- 
>>  From: Arron Bates 
>>  Sent: Sun 1/13/2002 11:31 PM 
>>  To: Struts Users Mailing List 
>>  Cc: 
>>  Subject: Re: Bug in BeanUtils.populate()
>>  
>>  
>>
>>  BeanUtils works correctly in that if you want to set against an
>>index,
>>  you can have the following forms.
>>  
>>  Quoted from the bean spec --==>>
>>  
>>  void setter(int index, PropertyType value); // indexed setter
>>  PropertyType getter(int index); // indexed getter
>>  
>>  void setter(PropertyType values[]);

Re: Bug in BeanUtils.populate()

2002-01-14 Thread Arron Bates

That's what made me look into it. :)
Was getting feedback that the iterate:tag will stake anything that 
remotely smells like a collection, and I've always said that the nested 
tags sit on the other ones, so why didn't it work?... difference in how 
the properties are fetched, as they're all going through the BeanUtils 
system, that is why.

Working on getting Mapped versions working, as they're also catered for 
in BeanUtils system.


Arron.


Don Saxton wrote:

>>Builds as of a few days ago will accept implementations of 
>>java.util.List as well as the primitive arrays the spec defines.
>>
>
>so does List work as well with your nested tags as Object[] ?
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Bug in BeanUtils.populate()

2002-01-14 Thread Arron

The method definitions were literally cut-and-paste from the spec.
There is no other code in the spec relating to indexed properties.

Arron.


Jason Chaffee wrote:

>The spec. supports the following:
> 
>setFoo(int index, Object[] array)
> 
>However, BeanUtils.populate() does not.  The problem is that
>BeanUtils.populate() isn't checking if the second parameter is an array
>or not, it only checks the first parameter.  However, the JavaBean spec.
>allows for the second paramter to be of an array type.  If you try this,
>you will find that it doesn't work in struts1.0 or struts1.0.1 unless
>you make the change to the code that I suggested below.  If you look at
>the code, the bug is very obivious.
> 
>
>   -Original Message- 
>   From: Arron Bates 
>   Sent: Sun 1/13/2002 11:31 PM 
>   To: Struts Users Mailing List 
>   Cc: 
>   Subject: Re: Bug in BeanUtils.populate()
>   
>   
>
>   BeanUtils works correctly in that if you want to set against an
>index,
>   you can have the following forms.
>   
>   Quoted from the bean spec --==>>
>   
>   void setter(int index, PropertyType value); // indexed setter
>   PropertyType getter(int index); // indexed getter
>   
>   void setter(PropertyType values[]); // array setter
>   PropertyType[] getter();// array getter
>   
>   ...so it's either setting and getting an entire array
>collection, or
>   directly setting and getting objects against an index which can
>mean
>   absolutely anything internally to the bean. The BeanUtils class
>uses
>   separate code blocks to handle both.
>   
>   Builds as of a few days ago will accept implementations of
>   java.util.List as well as the primitive arrays the spec defines.
>   
>   I think the ones you're after are the array methods.
>   
>   Arron.
>   
>   >It appears there is a bug in BeanUtils.populate() for an
>indexed setter
>   >of array type.  It doesn't take into account that it is an
>indexed
>   >setter and that the second parameter is an array because it
>only checks
>   >the first parameter which is always an int for an indexed
>setter.  This
>   >is the code in the 1.0.1 release:
>   >
>   >   ...
>   >Class parameterType = parameterTypes[0];
>   >if (parameterTypes.length > 1)
>   >parameterType = parameterTypes[1];  //
>Indexed
>   >setter
>   >// Convert the parameter value as required for this
>setter
>   >method
>   >Object parameters[] = new Object[1];
>   >if (parameterTypes[0].isArray()) {
>   >  ...
>   >
>   >it should be as follows:
>   >
>   >   ...
>   >Class parameterType = parameterTypes[0];
>   >if (parameterTypes.length > 1)
>   >parameterType = parameterTypes[1];  //
>Indexed
>   >setter
>   >// Convert the parameter value as required for this
>setter
>   >method
>   >Object parameters[] = new Object[1];
>   >if (parameterType.isArray()) {
>   >  ...
>   >
>   >
>   
>   
>   
>   --
>   To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>   For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>   
>   
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
> winmail.dat
>
> Content-Type:
>
> application/ms-tnef
> Content-Encoding:
>
> base64
>
>
> 
> Part 1.3
>
> Content-Type:
>
> text/plain
>
>



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




Re: Bug in BeanUtils.populate()

2002-01-13 Thread Arron Bates

BeanUtils works correctly in that if you want to set against an index, 
you can have the following forms.

Quoted from the bean spec --==>>

void setter(int index, PropertyType value); // indexed setter
PropertyType getter(int index); // indexed getter

void setter(PropertyType values[]); // array setter
PropertyType[] getter();// array getter

...so it's either setting and getting an entire array collection, or 
directly setting and getting objects against an index which can mean 
absolutely anything internally to the bean. The BeanUtils class uses 
separate code blocks to handle both.

Builds as of a few days ago will accept implementations of 
java.util.List as well as the primitive arrays the spec defines.

I think the ones you're after are the array methods.

Arron.

>It appears there is a bug in BeanUtils.populate() for an indexed setter
>of array type.  It doesn't take into account that it is an indexed
>setter and that the second parameter is an array because it only checks
>the first parameter which is always an int for an indexed setter.  This
>is the code in the 1.0.1 release:
> 
>   ...
>Class parameterType = parameterTypes[0];
>if (parameterTypes.length > 1)
>parameterType = parameterTypes[1];  // Indexed
>setter
>// Convert the parameter value as required for this setter
>method
>Object parameters[] = new Object[1];
>if (parameterTypes[0].isArray()) {
>  ...
> 
>it should be as follows:
> 
>   ...
>Class parameterType = parameterTypes[0];
>if (parameterTypes.length > 1)
>parameterType = parameterTypes[1];  // Indexed
>setter
>// Convert the parameter value as required for this setter
>method
>Object parameters[] = new Object[1];
>if (parameterType.isArray()) {
>  ...
> 
>



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




Re: FreeBSD

2002-01-13 Thread Arron Bates

My site's running red-hat linux, apache, tomcat, struts, using IBM's 1.3 VM
...if that's any interest to you :)

And from what I hear FreeBSD's a little more efficient at running things 
than linux.


Arron.

Robert wrote:

>Is anyone running Struts in a low-medium traffic site on a FreeBSD
>server? I'm curious as to how the JVM's are holding up and what servlet
>engine is being used.
> 
>Thanks!
>
>Robert
>Anyone who has never made a mistake has never tried anything new.
>-- Albert Einstein
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: case sensitive property names ??

2002-01-13 Thread Arron Bates

This has to do with the bean spec.

And what you say is right.
If you use all uppercase, it will leave the first letter alone, 
otherwise it will uppercase the first letter. And this would include 
your "a" example.


Arron.

Paradis, André wrote:

>Hi,
>
>i had the following case where another process calls an action in my
>application with a parameter in url named "A".
>
>like: .../actions/process?A=1&UNAME=andre
>
>I coded a form bean with a getA/setA pair, but it never gets called.  if
>I use "a" in the call to the action, it works.
>
>however, getUNAME() and setUNAME() gets called 
>
>from this portion of code in struts 1.0, I can see that
>property names are case sensitive:
>
>from PropertyUtils.getPropertyDescriptor(Object bean, String name):
>
>for (int i = 0; i < descriptors.length; i++) 
>{
> if (name.equals(descriptors[i].getName()))
>return (descriptors[i]);
>}
>
>Is this a standard requierments that parameter names must be case
>sensitive?  even so, how can one populate a bean with single letter
>uppercase property names?
>
>Thanks for any inputs
>
>
>Andre
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: iterate only showing one row -- newbie question

2002-01-12 Thread Arron

Wow, that's a lot of code there mate. :)

I really do recommend using the nested extension for this. It's an exact 
fit for what you're trying to do.
http://www.keyboardmonkey.com/strtus

There's all the information you need to get running. Primer, tutorial if 
you need it, and stuff for the future.

To put it bluntly... original struts iterate tags using nested objects 
is simply s--t. And to not use a nested bean creates s--t bean code. The 
nested extension will fix all that for you, and you'll end up with your 
JSP looking like this...

Start JSP --==>>



  
  
  
  
  



  
  
  
  




<<==-- End JSP

...it could be just me, but I think that the short-and-sweet aspect of 
such markup is truly compelling. And there's other things possible with 
it beside this application alone.

And don't worry, the Nested Extension's destiny is to be in Struts 
itself, I'm just building up it's user base to get feedback and make it 
stronger before the developers commit it to Struts itself.

You have a good nesting model happening. You understand that part, and 
that's the most important.
Give it a try and get back to the group with how it goes.


Arron.




Team Gasoline wrote:

> Hi All --
>
>
> The following iterate code only shows up as one row in my jsp. With 
> the debug code I know that the arrayList is being populated with all 
> the beans representing my resultSet. The row that appears seems to be 
> the last row to be obtained. What is happening with the rest??? Thanks 
> for your help! 

...

> With System.out.println I have verified that the list in AppInfo 
> contains the 9 different AppInfoPick beans. If I replace the 
> bean:write tags in the iterate with just text or just the name of the 
> bean without the property attribute, I expect that iterate should 
> iterate through all objects in the list or print the text in rows 
> equal to the ArrayList.size(), which does not happen, but I do get 
> that one row. Also if I add a scope attribute to the bean:write tags I 
> receive one row of null that's all.
>
>
> Thanks again!



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




Re: select/options/option

2002-01-12 Thread Arron

The value which is returned from the "property" property in the select 
tag will make the choice for you if one of the choices matches this value.

eg.
Use the options tag running off a list, and if the property which is 
specified in the select tag matches one, Struts will select it for you.


Arron.

Jason Wells wrote:

> Thanks for the summarized info.
>
> Using the  tag, is there a way to set an option to be 
> initially selected? I'm looking for something equivalent to
>
> blah
>
> I don't see mention of this in the online docs for the HTML taglib.
>
> Thanks,
> Jason
>
>
> Larry Maturo wrote:
>
>> Since I see these questions come up, and I just got them
>> figured out, I thought I would share them with the mailing
>> list.
>>
>> Select can be used with:
>>
>> a: A collection of strings, such as an arraylist
>> b: A collection of beans, each of which has string fields
>> c: Hard coded values
>>
>> I know you can combine a and c, as well as b and c.  I'm
>> guessing you could combine a, b, and c as well.
>>
>> With An ArrayList of Strings
>> 
>>
>> ArrayList name is nameList.  This list has been put into either the 
>> request or session.
>>
>> name of field in form bean to set is selectedValue.
>>
>> 
>> 
>> 
>>
>> With An ArrayList of Beans
>> --
>>
>> Bean string fields of interest are:
>>   1.  displayValue
>>   2.  idValue
>>
>> ArrayList name is beanList.  This list has been put into either the 
>> request or session.
>>
>> name of field in form bean to set is selectedValue.  It
>> should be set to the idValue of the selected bean.
>>
>> 
>> > labelProperty="displayValue"/>
>> 
>>
>> With HardCoded Values
>> -
>>
>> name of field in form bean to set is selectedValue.
>> 
>> 
>>
>> 
>> 
>>
>> -- Larry Maturo
>>[EMAIL PROTECTED]
>>Athens Group, Inc.
>
>



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




Re: iterate over bean attributes

2002-01-11 Thread Arron

What you could do create a wrapper object to hold each one, and nest the 
real property in there.
The bean that holds it can hold a reference to it which is in a list as 
well as the typical. That way you wouldn't have to write code to update 
your list all the time as you're always getting access to the final 
property in the final nested bean.

Then you could use a normal property reference to acess it on the first 
page, and the list on the other.

For help with keeping all the nesting take a look at...
http://www.keyboardmonkey.com/struts

:)

In all truth you probably might not want to go that far unless it's 
quite a big list. But you could do it that way.



Arron *



* I can't help it. There's a nested solution for everything... :)

Peter Georgiou wrote:

>Hi
>
>Is there a nice way to iterate over form bean attributes?
>
>The only way I can think of is to copy all the form bean attributes to a
>collection/array and then iterate over that data structure.
>
>This situation arises because I'm displaying confirmation page listing all
>the data from a previous form and I'm repeating lots of tables, with the
>only changes each time being the bean attribute.
>
>I was just wondering if there was a nicer way to do this than that what i've
>described.
>
>
>Thanks
>
>
>Peter
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Re: Partial Loading of JSP Page

2002-01-10 Thread Arron Bates

The developers are currently chewing over the details of implementing 
such feature.

I involves the returned page polling the server which has started said 
action on another thread and once complete the polling page returns the 
content as intended.

But as yet there is no solution you can just plug in.

Arron.

Rakesh wrote:

>Try a flash plugin or an applet with a progress bar... :-)
>
>--Rakesh
>  [EMAIL PROTECTED]
>---
>
>- Original Message -
>From: "SUPRIYA MISRA" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, January 10, 2002 9:06 PM
>Subject: Partial Loading of JSP Page
>
>
>>I am trying to work on a simple JSP page which does about 12 tasks and
>>
>each
>
>>task would take a minute at least. Is there a way to show the user the
>>progress made--Like "Task 1 completed,working on Task2 and so on". Or a
>>display of percentage of work done (5% done and so on)so that user knows
>>
>how
>
>>long to wait rather that guessing whether to end the task.
>>
>>Any workable ideas ??
>>
>>
>>
>>_
>>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>For additional commands, e-mail:
>>
><mailto:[EMAIL PROTECTED]>
>
>>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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




Nesting Beans/Iterators/Logic tags & whatever else...

2002-01-10 Thread Arron Bates


Some people on this list have been helped out of "nesting iterate tags 
within iterate" by being referred to the Nesting Extension. If you want 
to nest iterate tags within iterate tags the extension is still by far 
the best way to go, but the extension can do so much more.

The extension links together any tag which uses a "property" property to 
bring them to the "nesting context". Logic tags, Form tags, and a few 
bean tags. There are other options in the extension which capitalise on 
the nesting context.

To help out with all this, I've built a more extensive resources page ( 
http://www.keyboardmonkey.com/struts ) which has...
- Two part "primer" which will get you up to speed with what it does 
and why it does it.
- Two part tutorial which will get you under way to building your 
first nested application.
- Page of advanced topics which will tell you of some of the other 
things possible with the extension.
- Running examples
- Downloads of the extension and examples
- A few words on some "why should I implement this" issues.
- A questions/feedback form

For this information, go here...
http://www.keyboardmonkey.com/struts

This is just a general announcement of the extension to the Struts user 
community. Some people may have picked up on the link from the resources 
page, some may not. This is because I really wanted to get the primer 
and initial tutorial built to help people ramp-up on what it does, and 
generally make the task easier on all of us (it also gives me more docco 
to refer too if people have problems using the extension).

I'm trying to get it into Struts itself, and it seems very likely that 
it will. Your views on the extension will help this along, so use the 
feedback form on the page above if you feel it belongs in Struts, or 
even if it doesn't those opinions are valid also.

No-one who has used the extension has come back with a bad response, and 
all have seen the compelling reasons as to why it's useful (it sits on 
the original tags, so at worst you can use it as you do the current tags).

If you have used the extension and found it useful, can you please reply 
to this mail to show others that people are using it, and that it is 
worth using (I know there's plenty of you out there, I've seen the hit 
stats on my resource site :) . The more people using it, the more likely 
for a quick adoption into Struts itself.


I'll personally help anyone having troubles, where time permits.
Hope you'll give nesting a try. It really does bring that next level of 
ability to Struts JSP views.



Arron.


(theKM*)
* I think, therefore, I nest




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




Re: Need Iterator/Indexed help quick, please.

2001-10-18 Thread Arron Bates

There is no support for indexing outside of the nightly build.
Find it and download it and it should get you going.

Even though it's in the documentation, there is no support for it in the 
release version.
There has to be a couple of improvements in these indexed/nested areas, 
but indexing is coming soon.

I had to get over the same problem and wrote it in myself.

Hope the build does it for ya.

Arron.


Alex Colic wrote:

>Hi,
>
>I have gotten myself into a bit of a jam and I am wondering if someone could
>help me out.
>
>I got a web app that a customer wants to make some last minute changes to.
>>From the looks of it, it looks simple but I can't figure it out. Hopefully
>someone has an idea on how I can do this.
>
>I have a vector, that holds a CategoryList object, that holds a vector of
>Category Objects. Each one of these objects has the usual set/get methods:
>
>CategoryList Object
>
>set/get CategoryList Vector
>add Category List adds a Category to the above Vector
>getCategory(int i) returns the Category at that element for the above
>Vector.
>
>Category Object
>set/get categoryGroup (String)
>set/get categoryValue (String) ***I think this is what I need populated***
>set/get categoryValues (Vector) of Strings
>
>There can be an unknown number of category objects in the CategoryList
>Object. On my page I want to create a series of Select dropdowns with the
>categoryValues of each Category Object. I have managed to do this via:
>
>
>  scope="session">
>
>  
>
>  
>  
>  indexed="true">
>   property="categoryValues"/>
>   
>  
>  
>
>  
>
>
>This creates something like:
>
>
>  
>Project
>  
>  
>  
>   Commissioning
>   Commissioning,Engineering Signoff
>   Commissioning,Government
>Agencies
>   Erection/Installation
>   value="Erection/Installation,Structural">Erection/Installation,Structuralption>
>   
> 
>   
>
>
>My problem is getting the value of what the user selected. All I want to do
>is for the first select box, whatever the user selected put that in the
>respective categories categoryValue property. But I do not see where that
>value is going. When I look at the request parameters I get:
>
>category[0].categoryValue = Erection/Installation,Structural,Footings &
>Foundation
>
>In a nutshell is there a way to populate my objects with the value that the
>user has selected? Do I need to modify my object?
>
>Any help you can provide is highly appreciated.
>
>Alex
>
> pwCategory.java
>
> Content-Type:
>
> application/x-javascript
> Content-Encoding:
>
> quoted-printable
>
>
> 
> pwCategoryList.java
>
> Content-Type:
>
> application/x-javascript
> Content-Encoding:
>
> quoted-printable
>
>





<    1   2   3