How to call multiple submits in a jsp form(in STRUTS other than using javascript)

2004-08-13 Thread jacob skariah
Hi,

   Is there any better way to call multiple submits in
a jsp form using Struts without using javascripts.

I have to call diffrent actions on each submit,(say
listing , deleting and adding) , this can be easily
done through scripts , but what if scripts is
disabled. 

Does Struts have any better solution.

Thanx in Advance

Regards

manoj



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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



Re: clarification was: Re: Loosing request attributes

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 20:29:53 -0400, Rick Reumann <[EMAIL PROTECTED]> wrote:
> 
> I notice this problem ( validation fails now lost select list on page )
> comes up a lot on this mailing list. Probably time I updated a wiki
> somewhere of the various approaches you can take to accomodate this
> problem ( application scope, session scope, persistence layer caching,
> call validate manually, combination of the above, etc).
> 

Updating the Wiki would be awesome!

> --
> Rick

Craig

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



RE: Simple design question

2004-08-13 Thread Dhaliwal, Pritpal (HQP)
Hi Kenneth,

This is a quick little tutorial by me, it might help. Feedback is
appreciated.
http://www.bachansoft.com/tutorials/web/strutsquickstart.jsp

Pritpal Dhaliwal


-Original Message-
From: Kenneth Litwak [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 3:54 PM
To: Struts Users Mailing List
Subject: Simple design question


I'm trying to teach myself Struts while writing an actual
application . I need to go from an index.jsp, with variable request
parameter values (depending upon the specific user choice of what to
do).  For this should I code one Action that then forwards to separate
things depending upon request parameters or put multiple forms on the
index.jsp, each of which invokes a different Action?  Never done any of
this before, so I don't have a feel for what's better.  Thanks.



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




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



Re: clarification was: Re: Loosing request attributes

2004-08-13 Thread Rick Reumann
Craig McClanahan wrote:
That makes more sense now.
I tend to put all my lookup data (for dropdown lists and such) into
application scope (if its global) or session scope (if it's user
specific), primarily as a performance enhancement ... I only have to
look it up once, instead of once per request.  As a side effect, you
don't have to worry about the values going away, like you do if they
are in request scope.
I try to do that also, but often times the lists you need to display are 
specific to the type of user logged in. In these cases, if I don't 
manually validate and then use the setUp() method to repopulate some 
Request scope stuff, I'll usually just stick the Lists in Session scope. 
If memory performance is a super major concern then I stick to the 
manual validate in the Action and repopulate the request as needed with 
the Lists it needs.

I notice this problem ( validation fails now lost select list on page ) 
comes up a lot on this mailing list. Probably time I updated a wiki 
somewhere of the various approaches you can take to accomodate this 
problem ( application scope, session scope, persistence layer caching, 
call validate manually, combination of the above, etc).

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


Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
Thanks again.
Erik
Kris Schneider wrote:
 supports a "varStatus" attribute. The value of that atrribute is a
String that names an instance of javax.servlet.jsp.jstl.core.LoopTagStatus. The
LoopTagStatus instance has nested visibility so that it's only available within
the enclosing  tag. LoopTagStatus exposes a number of properties,
but the one you're probably interested in is "index":
..
 
   <%-- ${status.index} is the current index --%>
   ...
 
..
Quoting Erik Weber <[EMAIL PROTECTED]>:
 

How can I refer to the index of the current iteration with c:forEach 
(analogous to the indexId attribute to logic:iterate)?

Thanks,
Erik
Kris Schneider wrote:
   

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

<%-- ${entry.key} is the current key --%>
<%-- ${entry.value} is the associated bean array --%>

  ...


Quoting Erik Weber <[EMAIL PROTECTED]>:

 

I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:





  

  
  
  


  
  
  
  


  
  

  




  

  
  
  


  
  
  
  


  
  

  




Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
   

 

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


Re: Simple design question

2004-08-13 Thread Wendy Smoak
From: "Kenneth Litwak" <[EMAIL PROTECTED]>
>  I'm trying to teach myself Struts while writing an actual
> application.

Before you start writing your own, spend some time with the struts-example
webapp, and figure out how it works.  Running your container and that
example in a debugger (JSwat?) for an hour will reveal all sorts of things
it would otherwise take you days and weeks to figure out.

-- 
Wendy Smoak


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



Simple design question

2004-08-13 Thread Kenneth Litwak
I'm trying to teach myself Struts while writing an actual
application . I need to go from an index.jsp, with variable request
parameter values (depending upon the specific user choice of what to
do).  For this should I code one Action that then forwards to separate
things depending upon request parameters or put multiple forms on the
index.jsp, each of which invokes a different Action?  Never done any of
this before, so I don't have a feel for what's better.  Thanks.



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



RE: include vs. forward attributes in struts-config action element

2004-08-13 Thread Michael Finger
Thanks for the clarification Craig!




-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 3:32 PM
To: Struts Users Mailing List
Subject: Re: include vs. forward attributes in struts-config action
element

On Fri, 13 Aug 2004 14:15:22 -0700, Michael Finger
<[EMAIL PROTECTED]> wrote:
> 
> 
> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:04 PM
> To: Struts Users Mailing List
> Subject: Re: include vs. forward attributes in struts-config action
> element
> 
> >They are stil supported.
> >
> >The original motivation was to allow you some flexibility in how
> >actions (from the viewpoint of the rest of the application) are
> >implemented ... for example, if you have a charting servlet
available,
> >and it accepts request parameters to configure it's behavior, you
> >could leverage the validation part of Struts to check the request
> >parameters, but forward to the charting servlet in order to actually
> >produce the graph.
> >
> >Craig
> 
> Thanks Craig,
> So for an action (from the viewpoint of the rest of the application)
it
> would be a either-or situation as to use the forward attribute or
> forward element?

Well, sort of.

If you use the forward *attribute*, Struts is going to forward total
control over preparing the response (for the current request) to
whatever servlet resource is identified by the URI.  Since there's no
way for such a servlet to return an ActionForward, there won't be any
subsequent forwarding based on  elements (either local or
global).

> I guess my confusion was over if you could//would want
> to use both the element and attribute at the same time -- something
you
> can't do really because it would result in two calls to
> resultdispatcher.forward.

Yep.  It's legal for the servlet you forwarded to the first time to
call RD.forward() again (if it wanted to), but it's not legal for the
controller servlet to forward to something that creates the entire
response, then forward again to somewhere else.

> 
> Mike

Craig

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


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



Re: clarification was: Re: Loosing request attributes

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 17:37:20 -0400, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Craig McClanahan wrote:
> 
> >>>I can then
> >>>call a private setUp() method in my Action that is used to set up my
> >>>form with any other request attributes that should always be there.
> >>
> >>I'm curious why using the input parameter doesn't work for you?
> >>
> >
> >
> > Indeed ... the feature is working as it was designed, based on
> > application user expectations that, if errors occur, whatever they
> > typed in is redisplayed (even if it is wrong) so that it can be
> > corrected.  That's the way that any rich GUI client works, and nobody
> > wants to use apps that force you to fill an entire form in again
> > simply because you made one mistake.
> 
> I'm sorry I should have qualified I didn't mean setUp "my form" but
> set up things "on the resulting JSP that I forward to" - for example
> drop down lists etc. I never repopulate the form inputs and ActionForm
> fields.. those stay populated fine... but Leandro's original question
> was about objects that he was sticking in request scope with
> request.setAttribute( ..) (not ActionForm properties). My point was that
> those Request objects that a JSP might always need to have populated on
> the page will be lost if you do form validation the conventional struts
> way. Using Session or Application scope is not always the best place to
> place Objects that a JSP might need, so when validation fails you need a
> way to sometimes replace these objects - hence I call validate()
> manually and use a setUp() method used to populate the Request with
> objects my resulting JSP should have.
> 

That makes more sense now.

I tend to put all my lookup data (for dropdown lists and such) into
application scope (if its global) or session scope (if it's user
specific), primarily as a performance enhancement ... I only have to
look it up once, instead of once per request.  As a side effect, you
don't have to worry about the values going away, like you do if they
are in request scope.


> --
> Rick

Craig


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

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



Re: include vs. forward attributes in struts-config action element

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 14:15:22 -0700, Michael Finger
<[EMAIL PROTECTED]> wrote:
> 
> 
> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:04 PM
> To: Struts Users Mailing List
> Subject: Re: include vs. forward attributes in struts-config action
> element
> 
> >They are stil supported.
> >
> >The original motivation was to allow you some flexibility in how
> >actions (from the viewpoint of the rest of the application) are
> >implemented ... for example, if you have a charting servlet available,
> >and it accepts request parameters to configure it's behavior, you
> >could leverage the validation part of Struts to check the request
> >parameters, but forward to the charting servlet in order to actually
> >produce the graph.
> >
> >Craig
> 
> Thanks Craig,
> So for an action (from the viewpoint of the rest of the application) it
> would be a either-or situation as to use the forward attribute or
> forward element?

Well, sort of.

If you use the forward *attribute*, Struts is going to forward total
control over preparing the response (for the current request) to
whatever servlet resource is identified by the URI.  Since there's no
way for such a servlet to return an ActionForward, there won't be any
subsequent forwarding based on  elements (either local or
global).

> I guess my confusion was over if you could//would want
> to use both the element and attribute at the same time -- something you
> can't do really because it would result in two calls to
> resultdispatcher.forward.

Yep.  It's legal for the servlet you forwarded to the first time to
call RD.forward() again (if it wanted to), but it's not legal for the
controller servlet to forward to something that creates the entire
response, then forward again to somewhere else.

> 
> Mike

Craig

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



Re: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Christina Siena
Problem solved. It is possible after all to use input control names
containing equals or semicolon or any delimiter as follows:

document.formname.elements("value(number=1480;countryCode=USA;templateNumber=7;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:)").value
= "";

just in case anyone needs this solution.



> Hi,
>
> I am developing a page containing dynamically generated input
> type="text" controls where their names consist of multiple composite
> keys. The name of the input type="text" controls, however, can not be
> referenced correctly using javascript. For example, I have the
> following html input tag:
>
>  name="value(number=1480;countryCode=USA;templateNumber=7;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
> value="" disabled="true" class="disabledText"
> onchange="benefitsChanged();" />
>
> The following javascript won't work because the control name contains =
> and ; and : as follows:
>
> document.formname.number=1480;countryCode=USA;templateNumber=7;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
> = "";
>
> I only have one other idea how to solve this problem. Instead of control
> names containing the multiple composite keys, instead use a simple valid
> name. In the action, map the valid name to the multiple composite keys.
> Does
> anyone have any other ideas how to solve this?
>
> Thanks in advance.
>
>
>
>
> - To
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




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



RE: Nested tile definitions w parameters

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Craig Dickson [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:48 PM
> To: Struts Users Mailing List
> Subject: RE: Nested tile definitions w parameters
> 
> 
> Jim, thanks for the reply, but I am having some trouble understanding 
> what you did.


I just made the content value point at another tiles definition.  
Since you have main layout, that in essence wants to call a sublayout, that's what 
you're doing.


> 
> How does the viewContent parameter get used?
> 
> Also, just for clarification, view.jsp has the sub-layout in it and 
> singlePanel.jsp contains the content I wish to insert into an area in 
> the layout.
> 
> Jim Barrows wrote on 8/13/2004, 2:16 PM:
> 
>  >
>  > 
>  > What about taking this:
>  > >
>  > > 
>  > > 
>  > >  value="/WEB-INF/jsp/view/singlePanel.jsp"/>
>  > > 
>  >
>  > and doing this:
>  > 
>  >  
>  >   value="/WEB-INF/jsp/view/singlePanel.jsp"/>
>  > 
>  > 
>  >   > value="/WEB-INF/jsp/subLayoutPageWithTilesInsertsAndStuff.jsp"/>
>  > 
>  >
>  >
>  > /WEB-INF/jsp/view/view.jsp
>  > >
>  > > Basically what we are trying to achieve is to use the 
> view.jsp as the
>  > > content that gets included by the master.jsp layout page. But the
>  > > view.jsp page also has a 
>  > > tag in it
>  > > - kind of like a sub-layout situation. We want to include the
>  > > singlePanel.jsp page inside the view.jsp page.
>  > >
>  > > When the page renders, we get an error stating that 
> there is no value
>  > > for "viewPane" - like it is not getting passed or something.
>  > >
>  > > Are we doing something wrong, or is this "nested tile
>  > > definitions" use
>  > > case outside of Struts current capability?
>  > >
>  > > Thanks
>  > >
>  > >
>  > >
>  > > 
> -
>  > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > > For additional commands, e-mail: [EMAIL PROTECTED]
>  > >
>  > >
>  >
>  > 
> -
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Nested tile definitions w parameters

2004-08-13 Thread Craig Dickson
Jim, thanks for the reply, but I am having some trouble understanding 
what you did.

How does the viewContent parameter get used?

Also, just for clarification, view.jsp has the sub-layout in it and 
singlePanel.jsp contains the content I wish to insert into an area in 
the layout.

Jim Barrows wrote on 8/13/2004, 2:16 PM:

 >
 > 
 > What about taking this:
 > >
 > > 
 > > 
 > > 
 > > 
 >
 > and doing this:
 > 
 >  
 >  
 > 
 > 
 >  value="/WEB-INF/jsp/subLayoutPageWithTilesInsertsAndStuff.jsp"/>
 > 
 >
 >
 > /WEB-INF/jsp/view/view.jsp
 > >
 > > Basically what we are trying to achieve is to use the view.jsp as the
 > > content that gets included by the master.jsp layout page. But the
 > > view.jsp page also has a 
 > > tag in it
 > > - kind of like a sub-layout situation. We want to include the
 > > singlePanel.jsp page inside the view.jsp page.
 > >
 > > When the page renders, we get an error stating that there is no value
 > > for "viewPane" - like it is not getting passed or something.
 > >
 > > Are we doing something wrong, or is this "nested tile
 > > definitions" use
 > > case outside of Struts current capability?
 > >
 > > Thanks
 > >
 > >
 > >
 > > -
 > > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > > For additional commands, e-mail: [EMAIL PROTECTED]
 > >
 > >
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >



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



RE: submit and listbox

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Luis Antonio Martinez Cuevas [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:35 PM
> To: Struts Users Mailing List
> Subject: submit and listbox
> 
> 
> Hi, i am new on the list, i have a few questions about Struts, i hope
> you can help me Struts mail list.
> 
> I have a submit button and a list box, I want to make the 
> list box like
> a submit button, when I select some of the list box it make 
> submit but I
> can't catch this because I already have a submit button, can some one
> help me?

Yes.. how would you do this using straight html?  Answer: Javascript.


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



submit and listbox

2004-08-13 Thread Luis Antonio Martinez Cuevas
Hi, i am new on the list, i have a few questions about Struts, i hope
you can help me Struts mail list.

I have a submit button and a list box, I want to make the list box like
a submit button, when I select some of the list box it make submit but I
can't catch this because I already have a submit button, can some one
help me?


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



RE: Displaying bean values within tiles

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Andy Engle [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:00 PM
> To: Struts Users Mailing List
> Subject: RE: Displaying bean values within tiles
> 
> 
> Ok, let me get this straight.  I'll go down the list and you see if I
> have each step correct:
> 
> 1. Put a string in some scope, like the request scope:
> 
> request.setAttribute("thispagetitle", results.getWhatever());
> 
> 
> 2. In my "results" page, I want the title of that page to be the value
> that I sent back as "thispagetitle", so I will do this:
> 
> 

Ummm.. it's in request scope so  or  
> Which will put the value of "thispagetitle" into "pagetitle".

No,  
> 
> 3. Then, in my template file, whatever is put into "pagetitle" will be
> displayed:
> 
> Results: 
> 
> ...which should display getWhatever() in step #1.
> 
> 
> Is that the way this thing works?


No.  Not if you're puttting the title into request scope.
Put the title in the tiles definition, and it would work that way, just like my 
example.



> 
> Thank you for your help!
> 
> 
> Andy
> 
> 
> 
> 
> 
> 
> 
> --- Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> > 
> > 
> > > -Original Message-
> > > From: Andy Engle [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, August 13, 2004 12:05 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Displaying bean values within tiles
> > > 
> > > 
> > > Hi all,
> > > 
> > > I hate to ask a real, boring, non-OT question on a 
> Friday, but I am
> > > working with a Struts application in which I am using tiles 
> > > to organize
> > > my views.  What I want to be able to do is pass in a bean 
> > > with a String
> > > (or, "string beans" for all you farmer types out there) into my
> > tiles
> > > setup and have that value displayed in my view.
> > > 
> > > I have my tiles definitions in tiles-defs.xml, and of 
> course I have
> > a
> > > file template.jsp which handles my layout.
> > > 
> > > I have horsed around with using the  tag with
> > the
> > > String value, but I can't seem to get that to work -- for the page
> > I
> > > want to display it on, it either displays the default 
> value for the
> > > page as I have it set in tiles-defs.xml, or it doesn't print
> > anything
> > > at all.  I suppose my question could/should be how and where would
> > I
> > > use this useAttribute tag, as it seems to be the solution to my
> > > problem.
> > 
> > useAttribute:
> >  Declare a Java variable, and an attribute in the specified scope,
> > using tile attribute value.
> > Java variable and attribute will have the name specified by 'id', or
> > the original name if not specified. 
> > 
> > So I believe for tiles def:
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > In the jsp page:
> > 
> > 
> > Will allow
> > 
> > 
> > 
> > And yes, for this example I could have used  > name="title"/>.  :)
> > 
> > Not sure what you mean by pass in a bean to your tiles setup though.
> > 
> > 
> > > 
> > > Thanks for your help, and I look forward to receiving your
> > responses.
> > > 
> > > 
> > > Best Regards,
> > > Andy
> > > 
> > > 
> > >
> > 
> -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



validwhen with checkboxes (1.2)

2004-08-13 Thread Nathan Maves
can you run a check to see if a checkbox has been selected?
This doesn't seem to work for me, where rollable is a checkbox in the 
same form.  I want this field to be required when the rollable checkbox 
is checked.




test
((rollable == null) or (*this* == null)) 


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


clarification was: Re: Loosing request attributes

2004-08-13 Thread Rick Reumann
Craig McClanahan wrote:
I can then
call a private setUp() method in my Action that is used to set up my
form with any other request attributes that should always be there.
I'm curious why using the input parameter doesn't work for you?

Indeed ... the feature is working as it was designed, based on
application user expectations that, if errors occur, whatever they
typed in is redisplayed (even if it is wrong) so that it can be
corrected.  That's the way that any rich GUI client works, and nobody
wants to use apps that force you to fill an entire form in again
simply because you made one mistake.
I'm sorry I should have qualified I didn't mean setUp "my form" but 
set up things "on the resulting JSP that I forward to" - for example 
drop down lists etc. I never repopulate the form inputs and ActionForm 
fields.. those stay populated fine... but Leandro's original question 
was about objects that he was sticking in request scope with 
request.setAttribute( ..) (not ActionForm properties). My point was that 
those Request objects that a JSP might always need to have populated on 
the page will be lost if you do form validation the conventional struts 
way. Using Session or Application scope is not always the best place to 
place Objects that a JSP might need, so when validation fails you need a 
way to sometimes replace these objects - hence I call validate() 
manually and use a setUp() method used to populate the Request with 
objects my resulting JSP should have.

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


Re: Trying to use validwhen with 1.2

2004-08-13 Thread Nathan Maves
Thank god its friday!  That was it!
On Aug 13, 2004, at 2:40 PM, Niall Pemberton wrote:
The obvious question - have you deployed antlr.jar?
Niall
- Original Message -
From: "Nathan Maves" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 9:26 PM
Subject: Trying to use validwhen with 1.2

My first attpemt at using validwhen is failing badly :)
I am getting this error.
I have upgraded both the validation and validator-rules.
I have also upgraded all of the jars
java.lang.NoClassDefFoundError: antlr/TokenStream
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
java.lang.Class.getMethod0(Class.java:1893)
java.lang.Class.getMethod(Class.java:976)
org.apache.commons.validator.ValidatorAction.loadValidationMethod(Vali 
da
torAction.java:623)

org.apache.commons.validator.ValidatorAction.executeValidationMethod(V 
al
idatorAction.java:557)
org.apache.commons.validator.Field.validateForRule(Field.java:811)
org.apache.commons.validator.Field.validate(Field.java:890)
org.apache.commons.validator.Form.validate(Form.java:174)
org.apache.commons.validator.Validator.validate(Validator.java:367)

org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorFo 
rm
.java:112)

org.apache.struts.action.RequestProcessor.processValidate(RequestProce 
ss
or.java:921)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav 
a:
206)
org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1158)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

common.filters.compression.CompressionFilter.doFilter(CompressionFilte 
r.
java:36)
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:
182)

org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(Monitor 
Fi
lter.java:305)

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


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

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


RE: Nested tile definitions w parameters

2004-08-13 Thread Jim Barrows


What about taking this:
> 
> 
> 
> 
> 

and doing this:
 
 
 
 





/WEB-INF/jsp/view/view.jsp
> 
> Basically what we are trying to achieve is to use the view.jsp as the 
> content that gets included by the master.jsp layout page. But the 
> view.jsp page also has a  
> tag in it 
> - kind of like a sub-layout situation. We want to include the 
> singlePanel.jsp page inside the view.jsp page.
> 
> When the page renders, we get an error stating that there is no value 
> for "viewPane" - like it is not getting passed or something.
> 
> Are we doing something wrong, or is this "nested tile 
> definitions" use 
> case outside of Struts current capability?
> 
> Thanks
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: include vs. forward attributes in struts-config action element

2004-08-13 Thread Michael Finger


-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 2:04 PM
To: Struts Users Mailing List
Subject: Re: include vs. forward attributes in struts-config action
element


>They are stil supported.
>
>The original motivation was to allow you some flexibility in how
>actions (from the viewpoint of the rest of the application) are
>implemented ... for example, if you have a charting servlet available,
>and it accepts request parameters to configure it's behavior, you
>could leverage the validation part of Struts to check the request
>parameters, but forward to the charting servlet in order to actually
>produce the graph.
>
>Craig

Thanks Craig,
So for an action (from the viewpoint of the rest of the application) it
would be a either-or situation as to use the forward attribute or
forward element? I guess my confusion was over if you could//would want
to use both the element and attribute at the same time -- something you
can't do really because it would result in two calls to
resultdispatcher.forward.

Mike




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


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



Re: include vs. forward attributes in struts-config action element

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 13:50:56 -0700, Michael Finger
<[EMAIL PROTECTED]> wrote:
> >> This question came up when I was digging up info on
> RequestDispatcher
> >> forward vs. include and found refrences to these attributes,
> >> but no real
> >> examples.   Does struts still support the forward and include
> >> attributes
> ?> as a legacy or a servlet api spec thing? Or what?
> 
> >I'm confused.  what's your confusion about? :)
> 
> 
> Why does the forward attribute exist? (I'm having to tweak the
> RequestDispatcher class a little bit and noticed how the process method
> was written)
> 

They are stil supported.

The original motivation was to allow you some flexibility in how
actions (from the viewpoint of the rest of the application) are
implemented ... for example, if you have a charting servlet available,
and it accepts request parameters to configure it's behavior, you
could leverage the validation part of Struts to check the request
parameters, but forward to the charting servlet in order to actually
produce the graph.

Craig

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



RE: Displaying bean values within tiles

2004-08-13 Thread Andy Engle
Ok, let me get this straight.  I'll go down the list and you see if I
have each step correct:

1. Put a string in some scope, like the request scope:

request.setAttribute("thispagetitle", results.getWhatever());


2. In my "results" page, I want the title of that page to be the value
that I sent back as "thispagetitle", so I will do this:



Which will put the value of "thispagetitle" into "pagetitle".


3. Then, in my template file, whatever is put into "pagetitle" will be
displayed:

Results: 

...which should display getWhatever() in step #1.


Is that the way this thing works?

Thank you for your help!


Andy







--- Jim Barrows <[EMAIL PROTECTED]> wrote:

> 
> 
> > -Original Message-
> > From: Andy Engle [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 12:05 PM
> > To: [EMAIL PROTECTED]
> > Subject: Displaying bean values within tiles
> > 
> > 
> > Hi all,
> > 
> > I hate to ask a real, boring, non-OT question on a Friday, but I am
> > working with a Struts application in which I am using tiles 
> > to organize
> > my views.  What I want to be able to do is pass in a bean 
> > with a String
> > (or, "string beans" for all you farmer types out there) into my
> tiles
> > setup and have that value displayed in my view.
> > 
> > I have my tiles definitions in tiles-defs.xml, and of course I have
> a
> > file template.jsp which handles my layout.
> > 
> > I have horsed around with using the  tag with
> the
> > String value, but I can't seem to get that to work -- for the page
> I
> > want to display it on, it either displays the default value for the
> > page as I have it set in tiles-defs.xml, or it doesn't print
> anything
> > at all.  I suppose my question could/should be how and where would
> I
> > use this useAttribute tag, as it seems to be the solution to my
> > problem.
> 
> useAttribute:
>  Declare a Java variable, and an attribute in the specified scope,
> using tile attribute value.
> Java variable and attribute will have the name specified by 'id', or
> the original name if not specified. 
> 
> So I believe for tiles def:
> 
>   
>   
>   
>   
>   
> 
> 
> In the jsp page:
> 
> 
> Will allow
> 
> 
> 
> And yes, for this example I could have used  name="title"/>.  :)
> 
> Not sure what you mean by pass in a bean to your tiles setup though.
> 
> 
> > 
> > Thanks for your help, and I look forward to receiving your
> responses.
> > 
> > 
> > Best Regards,
> > Andy
> > 
> > 
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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



RE: include vs. forward attributes in struts-config action element

2004-08-13 Thread Michael Finger
>> This question came up when I was digging up info on
RequestDispatcher
>> forward vs. include and found refrences to these attributes, 
>> but no real
>> examples.   Does struts still support the forward and include 
>> attributes
?> as a legacy or a servlet api spec thing? Or what? 

>I'm confused.  what's your confusion about? :)


Why does the forward attribute exist? (I'm having to tweak the
RequestDispatcher class a little bit and noticed how the process method
was written)




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


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



Nested tile definitions w parameters

2004-08-13 Thread Craig Dickson
We have a (pretty common) definition similar to this:



 
 


We then have a definition that extends the first definition, like this:






Basically what we are trying to achieve is to use the view.jsp as the 
content that gets included by the master.jsp layout page. But the 
view.jsp page also has a  tag in it 
- kind of like a sub-layout situation. We want to include the 
singlePanel.jsp page inside the view.jsp page.

When the page renders, we get an error stating that there is no value 
for "viewPane" - like it is not getting passed or something.

Are we doing something wrong, or is this "nested tile definitions" use 
case outside of Struts current capability?

Thanks



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



Re: Trying to use validwhen with 1.2

2004-08-13 Thread Niall Pemberton
The obvious question - have you deployed antlr.jar?

Niall

- Original Message - 
From: "Nathan Maves" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 9:26 PM
Subject: Trying to use validwhen with 1.2


> My first attpemt at using validwhen is failing badly :)
> 
> I am getting this error.
> 
> I have upgraded both the validation and validator-rules.
> I have also upgraded all of the jars
> 
> java.lang.NoClassDefFoundError: antlr/TokenStream
> java.lang.Class.getDeclaredMethods0(Native Method)
> java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
> java.lang.Class.getMethod0(Class.java:1893)
> java.lang.Class.getMethod(Class.java:976)
> 
> org.apache.commons.validator.ValidatorAction.loadValidationMethod(Valida 
> torAction.java:623)
> 
> org.apache.commons.validator.ValidatorAction.executeValidationMethod(Val 
> idatorAction.java:557)
> org.apache.commons.validator.Field.validateForRule(Field.java:811)
> org.apache.commons.validator.Field.validate(Field.java:890)
> org.apache.commons.validator.Form.validate(Form.java:174)
> org.apache.commons.validator.Validator.validate(Validator.java:367)
> 
> org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm 
> .java:112)
> 
> org.apache.struts.action.RequestProcessor.processValidate(RequestProcess 
> or.java:921)
> 
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 
> 206)
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 
> common.filters.compression.CompressionFilter.doFilter(CompressionFilter. 
> java:36)
> org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java: 
> 182)
> 
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFi 
> lter.java:305)
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


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



Trying to use validwhen with 1.2

2004-08-13 Thread Nathan Maves
My first attpemt at using validwhen is failing badly :)
I am getting this error.
I have upgraded both the validation and validator-rules.
I have also upgraded all of the jars
java.lang.NoClassDefFoundError: antlr/TokenStream
	java.lang.Class.getDeclaredMethods0(Native Method)
	java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
	java.lang.Class.getMethod0(Class.java:1893)
	java.lang.Class.getMethod(Class.java:976)
	 
org.apache.commons.validator.ValidatorAction.loadValidationMethod(Valida 
torAction.java:623)
	 
org.apache.commons.validator.ValidatorAction.executeValidationMethod(Val 
idatorAction.java:557)
	org.apache.commons.validator.Field.validateForRule(Field.java:811)
	org.apache.commons.validator.Field.validate(Field.java:890)
	org.apache.commons.validator.Form.validate(Form.java:174)
	org.apache.commons.validator.Validator.validate(Validator.java:367)
	 
org.apache.struts.validator.DynaValidatorForm.validate(DynaValidatorForm 
.java:112)
	 
org.apache.struts.action.RequestProcessor.processValidate(RequestProcess 
or.java:921)
	 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 
206)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	 
common.filters.compression.CompressionFilter.doFilter(CompressionFilter. 
java:36)
	org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java: 
182)
	 
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFi 
lter.java:305)

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


RE: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Christina Siena [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Javascript question re: dynamically generated input
> type='text' controls
> 
> 
> If I try to use hidden fields to associate the valid name with the
> multiple composite key name, then what is it about hidden 
> fields that I
> can use?

by way of example:






Then put the key together in your action class.  HTML is not designed to do what you 
want to do.





> >
> >
> >> -Original Message-
> >> From: Christina Siena [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, August 13, 2004 11:23 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: Javascript question re: dynamically generated input
> >> type='text'
> >> controls
> >>
> >>
> >> Hi,
> >>
> >> I am developing a page containing dynamically generated input
> >> type="text" controls where their names consist of multiple 
> composite
> >> keys. The name of the input type="text" controls, however, 
> can not be
> >> referenced correctly using javascript. For example, I have the
> >> following html input tag:
> >>
> >>  >> name="value(number=1480;countryCode=USA;templateNumber=7;t
> > ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
> >> value="" disabled="true" class="disabledText"
> >> onchange="benefitsChanged();" />
> >>
> >> The following javascript won't work because the control name
> >> contains > and ; and : as follows:
> >>
> >> document.formname.number=1480;countryCode=USA;templateNumber=7
> > ;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
> >> = "";
> >>
> >> I only have one other idea how to solve this problem. Instead
> >> of control
> >> names containing the multiple composite keys, instead use a
> >> simple valid
> >> name. In the action, map the valid name to the multiple
> >> composite keys.
> >> Does
> >> anyone have any other ideas how to solve this?
> >
> > Um hidden fields in the form?
> >
> >
> > 
> --
> --- To
> > unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Christina Siena
If I try to use hidden fields to associate the valid name with the
multiple composite key name, then what is it about hidden fields that I
can use?
>
>
>> -Original Message-
>> From: Christina Siena [mailto:[EMAIL PROTECTED]
>> Sent: Friday, August 13, 2004 11:23 AM
>> To: [EMAIL PROTECTED]
>> Subject: Javascript question re: dynamically generated input
>> type='text'
>> controls
>>
>>
>> Hi,
>>
>> I am developing a page containing dynamically generated input
>> type="text" controls where their names consist of multiple composite
>> keys. The name of the input type="text" controls, however, can not be
>> referenced correctly using javascript. For example, I have the
>> following html input tag:
>>
>> > name="value(number=1480;countryCode=USA;templateNumber=7;t
> ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
>> value="" disabled="true" class="disabledText"
>> onchange="benefitsChanged();" />
>>
>> The following javascript won't work because the control name
>> contains > and ; and : as follows:
>>
>> document.formname.number=1480;countryCode=USA;templateNumber=7
> ;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
>> = "";
>>
>> I only have one other idea how to solve this problem. Instead
>> of control
>> names containing the multiple composite keys, instead use a
>> simple valid
>> name. In the action, map the valid name to the multiple
>> composite keys.
>> Does
>> anyone have any other ideas how to solve this?
>
> Um hidden fields in the form?
>
>
> - To
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: Who calls the validate method ???

2004-08-13 Thread Leandro Melo
Rick,
as i said i really like your approach, but there are
some input pages that are really really simple, so
there's no need for doing this.
Then, in this cases, i'd like to call some other
method just after validate is called from Struts.
That's why i was wondering "who" calls it.


 --- Rick Reumann <[EMAIL PROTECTED]> escreveu: 
> Leandro Melo wrote:
> 
> > Hi,
> > could anyone tell me who calls the validate method
> of
> > the ActionForms?
> 
> I think "you" should:) I find it's often more
> beneficial to not rely on 
> Struts calling this validate() method and instead
> you should call this 
> manually.
> 
>  From my other post:
> 
>  - when validation fails and you are back on
> the initial form you 
> will not have access to the previous set request
> attributes. It is for 
> this reason that I now rarely ever set my mapping
> validate to "true" and 
> instead call validate() from my Action after the
> form submits. The 
> reason for this is when validation fails
> (ActionErrors/Messages return) 
> I can then call a private setUp() method in my
> Action that is used to 
> set up my form with any other request attributes
> that should always be 
> there.
> 
> For example, a common complaint is: "I have a List
> that I set up in 
> request scope that is used on the form for the user
> to select an item, 
> but when validation fails this List will not be
> there." To get around 
> this problem, simply call validate() manually in
> your action and if 
> errors return you can then call a setUp() method
> that will repopulate 
> what you need to be in the request, otherwise you
> just proceed on as normal.
> 
> 
> 
> -- 
> Rick
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: include vs. forward attributes in struts-config action element

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Michael Finger [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 12:57 PM
> To: Struts Users Mailing List
> Subject: include vs. forward attributes in struts-config 
> action element
> 

code and problem explanation

> 
> 
> It looks to me like including a forward attribute  in the 
> action element
> will break any forwards you want with a forward element as it calls
> RequestDispatcher.forward - which forwards on the output 
> stream, etc...
> 
> This question came up when I was digging up info on  RequestDispatcher
> forward vs. include and found refrences to these attributes, 
> but no real
> examples.   Does struts still support the forward and include 
> attributes
> as a legacy or a servlet api spec thing? Or what? 

I'm confused.  what's your confusion about? :)


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



include vs. forward attributes in struts-config action element

2004-08-13 Thread Michael Finger
Hi all, 

I'm a bit puzzled about the processing of includes and forward
attributes in the struts-config action element vs. the forward element
under the action element

 

I understand why the forward element is there (and I use it quite a lot
, too) but I got a bit confused when I was looking around in the
RequestProcessor.process method:

 

public void process(HttpServletRequest request,

HttpServletResponse response)

throws IOException, ServletException {

 

...

 

// Process a forward or include specified by this mapping

if (!processForward(request, response, mapping)) {

return;

}

if (!processInclude(request, response, mapping)) {

return;

}

 





// Process the returned ActionForward instance

processForwardConfig(request, response, forward);

 

}

 

It looks to me like including a forward attribute  in the action element
will break any forwards you want with a forward element as it calls
RequestDispatcher.forward - which forwards on the output stream, etc...

This question came up when I was digging up info on  RequestDispatcher
forward vs. include and found refrences to these attributes, but no real
examples.   Does struts still support the forward and include attributes
as a legacy or a servlet api spec thing? Or what? 

 

 

Thanks

 

Michael Finger

 

 



Re: Loosing request attributes

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 12:51:44 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Rick Reumann [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 1:06 PM
> > To: Struts Users Mailing List
> > Subject: Re: Loosing request attributes
> > The problem you are describing comes up a lot on this list - when
> > validation fails and you are back on the initial form you
> > will not have
> > access to the previous set request attributes. It is for this reason
> > that I now rarely ever set my mapping validate to "true" and instead
> > call validate() from my Action after the form submits. The reason for
> > this is when validation fails (ActionErrors/Messages return)
> > I can then
> > call a private setUp() method in my Action that is used to set up my
> > form with any other request attributes that should always be there.
> 
> I'm curious why using the input parameter doesn't work for you?
> 

Indeed ... the feature is working as it was designed, based on
application user expectations that, if errors occur, whatever they
typed in is redisplayed (even if it is wrong) so that it can be
corrected.  That's the way that any rich GUI client works, and nobody
wants to use apps that force you to fill an entire form in again
simply because you made one mistake.

Craig

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



RE: Who calls the validate method ???

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:09 PM
> To: Struts Users Mailing List
> Subject: Re: Who calls the validate method ???
> 
> 
> Leandro Melo wrote:
> 
> > Hi,
> > could anyone tell me who calls the validate method of
> > the ActionForms?
> 
> I think "you" should:) I find it's often more beneficial to 
> not rely on 
> Struts calling this validate() method and instead you should 
> call this 
> manually.
> 
>  From my other post:
> 
>  - when validation fails and you are back on the 
> initial form you 
> will not have access to the previous set request attributes. 
> It is for 
> this reason that I now rarely ever set my mapping validate to 
> "true" and 
> instead call validate() from my Action after the form submits. The 
> reason for this is when validation fails 
> (ActionErrors/Messages return) 
> I can then call a private setUp() method in my Action that is used to 
> set up my form with any other request attributes that should 
> always be 
> there.
> 
> For example, a common complaint is: "I have a List that I set up in 
> request scope that is used on the form for the user to select 
> an item, 
> but when validation fails this List will not be there." To get around 
> this problem, simply call validate() manually in your action and if 
> errors return you can then call a setUp() method that will repopulate 
> what you need to be in the request, otherwise you just 
> proceed on as normal.

See, I disagree with this entirely.  Pick lists can be put into application scope, if 
they are small enough.  Use the Fast Lane Reader pattern if they aren't.  If you need 
to customize the list based on whatever, then you can that through the list bean ( I 
wouldn't recommend just putting a list in application scope, rather a bean containing 
a list to support this kind of setup) and then set the input parameter.  If they 
aren't application in scope, then put them into the session.
I know that some people don't like putting things into session/application scopes 
because of memory.. however memory is not only cheaper then developer time, it's 
expensable too!



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



RE: Loosing request attributes

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:06 PM
> To: Struts Users Mailing List
> Subject: Re: Loosing request attributes
> The problem you are describing comes up a lot on this list - when 
> validation fails and you are back on the initial form you 
> will not have 
> access to the previous set request attributes. It is for this reason 
> that I now rarely ever set my mapping validate to "true" and instead 
> call validate() from my Action after the form submits. The reason for 
> this is when validation fails (ActionErrors/Messages return) 
> I can then 
> call a private setUp() method in my Action that is used to set up my 
> form with any other request attributes that should always be there.

I'm curious why using the input parameter doesn't work for you?



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



Re: Who calls the validate method ???

2004-08-13 Thread Rick Reumann
Leandro Melo wrote:
Hi,
could anyone tell me who calls the validate method of
the ActionForms?
I think "you" should:) I find it's often more beneficial to not rely on 
Struts calling this validate() method and instead you should call this 
manually.

From my other post:
 - when validation fails and you are back on the initial form you 
will not have access to the previous set request attributes. It is for 
this reason that I now rarely ever set my mapping validate to "true" and 
instead call validate() from my Action after the form submits. The 
reason for this is when validation fails (ActionErrors/Messages return) 
I can then call a private setUp() method in my Action that is used to 
set up my form with any other request attributes that should always be 
there.

For example, a common complaint is: "I have a List that I set up in 
request scope that is used on the form for the user to select an item, 
but when validation fails this List will not be there." To get around 
this problem, simply call validate() manually in your action and if 
errors return you can then call a setUp() method that will repopulate 
what you need to be in the request, otherwise you just proceed on as normal.


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


Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
Vary nice Rick!
Interesting solution, i'll work on that!


 --- Rick Reumann <[EMAIL PROTECTED]> escreveu: 
> Leandro Melo wrote:
> 
> > Suppose a user submits a request that is handled
> by
> > MyActionDoSomething. Then this action sets a
> request
> > attribute like this:
> > 
> > request.setAttribute("MyObject", obj); 
> > 
> > and forwards the request to the page
> > myPageDoSomeOtherThing.jsp, wich has some inputs
> for
> > the user to fill in.
> 
> The problem you are describing comes up a lot on
> this list - when 
> validation fails and you are back on the initial
> form you will not have 
> access to the previous set request attributes. It is
> for this reason 
> that I now rarely ever set my mapping validate to
> "true" and instead 
> call validate() from my Action after the form
> submits. The reason for 
> this is when validation fails (ActionErrors/Messages
> return) I can then 
> call a private setUp() method in my Action that is
> used to set up my 
> form with any other request attributes that should
> always be there.
> 
> For example, a common complaint is: "I have a List
> that I set up in 
> request scope that is used on the form for the user
> to select an item, 
> but when validation fails this List will not be
> there." To get around 
> this problem, simply call validate() manually in
> your action and if 
> errors return you can then call a setUp() method
> that will repopulate 
> what you need to be in the request, otherwise you
> just proceed on as 
> normal.
> 
> -- 
> Rick
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Loosing request attributes

2004-08-13 Thread Rick Reumann
Leandro Melo wrote:
Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:
request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
The problem you are describing comes up a lot on this list - when 
validation fails and you are back on the initial form you will not have 
access to the previous set request attributes. It is for this reason 
that I now rarely ever set my mapping validate to "true" and instead 
call validate() from my Action after the form submits. The reason for 
this is when validation fails (ActionErrors/Messages return) I can then 
call a private setUp() method in my Action that is used to set up my 
form with any other request attributes that should always be there.

For example, a common complaint is: "I have a List that I set up in 
request scope that is used on the form for the user to select an item, 
but when validation fails this List will not be there." To get around 
this problem, simply call validate() manually in your action and if 
errors return you can then call a setUp() method that will repopulate 
what you need to be in the request, otherwise you just proceed on as 
normal.

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


RE: Displaying bean values within tiles

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Andy Engle [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 12:05 PM
> To: [EMAIL PROTECTED]
> Subject: Displaying bean values within tiles
> 
> 
> Hi all,
> 
> I hate to ask a real, boring, non-OT question on a Friday, but I am
> working with a Struts application in which I am using tiles 
> to organize
> my views.  What I want to be able to do is pass in a bean 
> with a String
> (or, "string beans" for all you farmer types out there) into my tiles
> setup and have that value displayed in my view.
> 
> I have my tiles definitions in tiles-defs.xml, and of course I have a
> file template.jsp which handles my layout.
> 
> I have horsed around with using the  tag with the
> String value, but I can't seem to get that to work -- for the page I
> want to display it on, it either displays the default value for the
> page as I have it set in tiles-defs.xml, or it doesn't print anything
> at all.  I suppose my question could/should be how and where would I
> use this useAttribute tag, as it seems to be the solution to my
> problem.

useAttribute:
 Declare a Java variable, and an attribute in the specified scope, using tile 
attribute value.
Java variable and attribute will have the name specified by 'id', or the original name 
if not specified. 

So I believe for tiles def:








In the jsp page:


Will allow



And yes, for this example I could have used .  :)

Not sure what you mean by pass in a bean to your tiles setup though.


> 
> Thanks for your help, and I look forward to receiving your responses.
> 
> 
> Best Regards,
> Andy
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Christina Siena [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 11:23 AM
> To: [EMAIL PROTECTED]
> Subject: Javascript question re: dynamically generated input 
> type='text'
> controls
> 
> 
> Hi,
> 
> I am developing a page containing dynamically generated input
> type="text" controls where their names consist of multiple composite
> keys. The name of the input type="text" controls, however, can not be
> referenced correctly using javascript. For example, I have the
> following html input tag:
> 
>  name="value(number=1480;countryCode=USA;templateNumber=7;t
ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
> value="" disabled="true" class="disabledText"
> onchange="benefitsChanged();" />
> 
> The following javascript won't work because the control name 
> contains =
> and ; and : as follows:
> 
> document.formname.number=1480;countryCode=USA;templateNumber=7
;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
> = "";
> 
> I only have one other idea how to solve this problem. Instead 
> of control
> names containing the multiple composite keys, instead use a 
> simple valid
> name. In the action, map the valid name to the multiple 
> composite keys.
> Does
> anyone have any other ideas how to solve this?

Um hidden fields in the form?


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



Re: Who calls the validate method ???

2004-08-13 Thread Hubert Rabago
It's actually the RequestProcessor.
There's a processValidate() there where the form's validate() method is
called.

--- Leandro Melo <[EMAIL PROTECTED]> wrote:

> Hi,
> could anyone tell me who calls the validate method of
> the ActionForms?
> 
> I thought it was ActionServlet, but it seems not be
> it.
> 
> ltcmelo
> 
> =
> 
> 
> 
>   
>   
>   
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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

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



Who calls the validate method ???

2004-08-13 Thread Leandro Melo
Hi,
could anyone tell me who calls the validate method of
the ActionForms?

I thought it was ActionServlet, but it seems not be
it.

ltcmelo

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
Erik,
i'm not talking about form attributes, that's what i
said in my last e-mail.
I'll try to clear it out.
Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:

request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
This page (myPageDoSomeOtherThing.jsp) uses the bean
"obj" that was set in MyActionDoSomething.java ok !?

Now suppose the user submits wrong information in
myPageDoSomeOtherThing.jsp, what will cause the
validate method in the associated ActionForm to return
some ActionErrors. BUT when the ActionForm send this
page back for the user to re-input data, the bean
"obj" that was set at the very beginning in
MyActionDoSomething.java is NOT present anymore!

I think now it's clear that i'm not talking about the
formBean attributes, right !? 








 --- Erik Weber <[EMAIL PROTECTED]> escreveu: 
> You shouldn't have to do anything (in general, you
> rarely need to 
> implement reset) special for this. Struts does this
> for you. The user 
> submits the form. The form bean is populated with
> the user's input. 
> Validation starts on the form bean. Validation
> fails. Struts forwards 
> back to the input page, and the struts tags render
> all the values that 
> the user had input using the populated form bean.
> 
> Could you describe in more detail which types of
> form values seem to be 
> "missing" and which ones are intact? Is there a
> pattern to it?
> 
> Erik
> 
> 
> 
> Leandro Melo wrote:
> 
> >I don`t want to reset the attributes of my
> ActionForm
> >(what a form.reset() would do), BUT the attributes
> of
> >the request the were probably set by the Action
> that
> >forwarded to the specific page.
> >
> >So i need them back in that page if validate fails.
> >
> >
> > --- Robert Taylor <[EMAIL PROTECTED]> escreveu:
> 
> >  
> >
> >>form.reset();
> >>
> >>robert
> >>
> >>
> >>
> >>>-Original Message-
> >>>From: Leandro Melo
> >>>  
> >>>
> >>[mailto:[EMAIL PROTECTED]
> >>
> >>
> >>>Sent: Friday, August 13, 2004 11:20 AM
> >>>To: Struts Users Mailing List
> >>>Subject: Re: Loosing request attributes
> >>>
> >>>
> >>>I was taking a look at the HttpServeltRequest and
> >>>ServletRequest apis and noted that theres a
> method
> >>>"getParameterMap()" wich returns a map of the
> >>>parameters, BUT there isn`t such a
> >>>  
> >>>
> >>"setParameterMap()"
> >>
> >>
> >>>method.
> >>>
> >>>So, what`s an automated way to re-set all my
> >>>  
> >>>
> >>request
> >>
> >>
> >>>parameters in the ActionForm??? Do i have to go
> >>>  
> >>>
> >>one by
> >>
> >>
> >>>one for each ActionForm :-( ???
> >>>
> >>>
> >>> --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> >>>  
> >>>
> Ensure that the request attributes are set in
> 
> 
> >>the
> >>
> >>
> ActionForm, this is
> the only way that you can ensure that they'll
> 
> 
> >>still
> >>
> >>
> be there when the
> validate fails.
> 
> Leandro Melo wrote:
> 
> 
> 
> >Hi,
> >when a user request hits the ActionForm's
> >  
> >
> >>validate
> >>
> >>
> >method and bounces back, i'm loosing some
> >  
> >
> >>request
> >>
> >>
> >attributes that i had set for the page. In
> >  
> >
> >>other
> >>
> >>
> >words, if the user inputs some data that don't
> >  
> >
> >>pass
> >>
> >>
> >the validate method,
> >the page comes back with a few request scope
> >attributes missing.
> >
> >Is there a way to avoid that this happens?
> >
> >=
> >_
> >Leandro Terra C. Melo
> >Eng. de Controle e Automação - UFMG
> >
> >
> >
> >
> >
> >  
> >
>
>>___
> >>
> >>
> >Yahoo! Acesso Grátis - navegue de graça com
> >  
> >
> >>conexão
> >>
> >>
> de qualidade! Acesse:
> 
> 
> >>http://br.acesso.yahoo.com/
> >>
> >>
>
>>-
> >>
> >>
> >To unsubscribe, e-mail:
> >  
> >
> [EMAIL PROTECTED]
> 
> 
> >For additional commands, e-mail:
> >  
> >
> [EMAIL PROTECTED]
> 
> 
> >
> >  
> >
> --
> Brice Ruth, Sr. IT Analyst
> Fiskars Brands Inc
> http://www.fiskarsbrands.com/
> 
> 
> 
> 
> 
>
>-
> >  
> >
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
=== message truncated === 

=





 

Displaying bean values within tiles

2004-08-13 Thread Andy Engle
Hi all,

I hate to ask a real, boring, non-OT question on a Friday, but I am
working with a Struts application in which I am using tiles to organize
my views.  What I want to be able to do is pass in a bean with a String
(or, "string beans" for all you farmer types out there) into my tiles
setup and have that value displayed in my view.

I have my tiles definitions in tiles-defs.xml, and of course I have a
file template.jsp which handles my layout.

I have horsed around with using the  tag with the
String value, but I can't seem to get that to work -- for the page I
want to display it on, it either displays the default value for the
page as I have it set in tiles-defs.xml, or it doesn't print anything
at all.  I suppose my question could/should be how and where would I
use this useAttribute tag, as it seems to be the solution to my
problem.

Thanks for your help, and I look forward to receiving your responses.


Best Regards,
Andy


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



Re: Losing request attributes

2004-08-13 Thread Leandro Melo
Denis, that's not the point of our discussion. One
more time: I'm not talking about formBean attributes.

Anyway, Hubert pointed a workaroung for my problem.

Thanks.


 --- Denis Avdic <[EMAIL PROTECTED]> escreveu: 
> In order to keep the actual entries that the user
> typed in (so they
> don't have to retype everything if they changed a
> bunch of things) I
> usually put the entire form and errors into request
> if there are
> errors.
> 
> Then you need to make sure that your  populate
> action checks for
> presence of the form in request and overrides the DB
> entries with the
> ones in the form.
> 
> On Fri, 13 Aug 2004 15:23:47 -0300 (ART), Leandro
> Melo
> <[EMAIL PROTECTED]> wrote:
> > Hubert,
> > i think that's actually the only solution.
> > Thanks.
> > 
> > 
> > 
> > 
> > > You can point the "input" to an action which
> will
> > > populate the request with
> > > the attribute(s) you need, and then forwards to
> your
> > > form.
> > >
> > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > >
> > > > This is because when the user submits the
> form,
> > > that already starts a
> > > > different request, so the request attributes
> are
> > > no longer there.
> > > > In your mapping for the action where the form
> gets
> > > submitted to, where does
> > > > the input attribute point to?
> > > >
> > > > Hubert
> > > >
> > > > --- Leandro Melo <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > > As i replied many times for this topic, i'd
> like
> > > to
> > > > > expose the situation again and in DETAILS.
> > > > >
> > > > > Suppose a user submits a request that is
> handled
> > > by
> > > > > MyActionDoSomething. Then this action sets a
> > > request
> > > > > attribute like this:
> > > > >
> > > > > request.setAttribute("MyObject", obj);
> > > > >
> > > > > and forwards the request to the page
> > > > > myPageDoSomeOtherThing.jsp, wich has some
> inputs
> > > for
> > > > > the user to fill in.
> > > > > This page (myPageDoSomeOtherThing.jsp) uses
> the
> > > bean
> > > > > "obj" that was set in
> MyActionDoSomething.java
> > > ok !?
> > > > >
> > > > > Now suppose the user submits wrong
> information
> > > in
> > > > > myPageDoSomeOtherThing.jsp, what will cause
> the
> > > > > validate method in the associated ActionForm
> to
> > > return
> > > > > some ActionErrors. BUT when the ActionForm
> send
> > > this
> > > > > page back for the user to re-input data, the
> > > bean
> > > > > "obj" that was set at the very beginning in
> > > > > MyActionDoSomething.java is NOT present
> anymore!
> > > > >
> > > > > I think now it's clear that i'm not talking
> > > about the
> > > > > formBean attributes, right !?
> > > > >
> > >
> > >
> > >
> __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > 
> > =
> > 
> > 
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > 
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> >
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Losing request attributes

2004-08-13 Thread Denis Avdic
In order to keep the actual entries that the user typed in (so they
don't have to retype everything if they changed a bunch of things) I
usually put the entire form and errors into request if there are
errors.

Then you need to make sure that your  populate action checks for
presence of the form in request and overrides the DB entries with the
ones in the form.

On Fri, 13 Aug 2004 15:23:47 -0300 (ART), Leandro Melo
<[EMAIL PROTECTED]> wrote:
> Hubert,
> i think that's actually the only solution.
> Thanks.
> 
> 
> 
> 
> > You can point the "input" to an action which will
> > populate the request with
> > the attribute(s) you need, and then forwards to your
> > form.
> >
> > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> >
> > > This is because when the user submits the form,
> > that already starts a
> > > different request, so the request attributes are
> > no longer there.
> > > In your mapping for the action where the form gets
> > submitted to, where does
> > > the input attribute point to?
> > >
> > > Hubert
> > >
> > > --- Leandro Melo <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > > As i replied many times for this topic, i'd like
> > to
> > > > expose the situation again and in DETAILS.
> > > >
> > > > Suppose a user submits a request that is handled
> > by
> > > > MyActionDoSomething. Then this action sets a
> > request
> > > > attribute like this:
> > > >
> > > > request.setAttribute("MyObject", obj);
> > > >
> > > > and forwards the request to the page
> > > > myPageDoSomeOtherThing.jsp, wich has some inputs
> > for
> > > > the user to fill in.
> > > > This page (myPageDoSomeOtherThing.jsp) uses the
> > bean
> > > > "obj" that was set in MyActionDoSomething.java
> > ok !?
> > > >
> > > > Now suppose the user submits wrong information
> > in
> > > > myPageDoSomeOtherThing.jsp, what will cause the
> > > > validate method in the associated ActionForm to
> > return
> > > > some ActionErrors. BUT when the ActionForm send
> > this
> > > > page back for the user to re-input data, the
> > bean
> > > > "obj" that was set at the very beginning in
> > > > MyActionDoSomething.java is NOT present anymore!
> > > >
> > > > I think now it's clear that i'm not talking
> > about the
> > > > formBean attributes, right !?
> > > >
> >
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> 
> =
> 
> 
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
> http://br.acesso.yahoo.com/
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



RE: Losing request attributes

2004-08-13 Thread Leandro Melo
Hubert, 
i think that's actually the only solution.
Thanks.

 
> You can point the "input" to an action which will
> populate the request with
> the attribute(s) you need, and then forwards to your
> form.
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> 
> > This is because when the user submits the form,
> that already starts a
> > different request, so the request attributes are
> no longer there.
> > In your mapping for the action where the form gets
> submitted to, where does
> > the input attribute point to?
> > 
> > Hubert
> > 
> > --- Leandro Melo <[EMAIL PROTECTED]>
> wrote:
> > 
> > > As i replied many times for this topic, i'd like
> to
> > > expose the situation again and in DETAILS.
> > > 
> > > Suppose a user submits a request that is handled
> by
> > > MyActionDoSomething. Then this action sets a
> request
> > > attribute like this:
> > > 
> > > request.setAttribute("MyObject", obj); 
> > > 
> > > and forwards the request to the page
> > > myPageDoSomeOtherThing.jsp, wich has some inputs
> for
> > > the user to fill in.
> > > This page (myPageDoSomeOtherThing.jsp) uses the
> bean
> > > "obj" that was set in MyActionDoSomething.java
> ok !?
> > > 
> > > Now suppose the user submits wrong information
> in
> > > myPageDoSomeOtherThing.jsp, what will cause the
> > > validate method in the associated ActionForm to
> return
> > > some ActionErrors. BUT when the ActionForm send
> this
> > > page back for the user to re-input data, the
> bean
> > > "obj" that was set at the very beginning in
> > > MyActionDoSomething.java is NOT present anymore!
> > > 
> > > I think now it's clear that i'm not talking
> about the
> > > formBean attributes, right !? 
> > > 
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Christina Siena
Hi,

I am developing a page containing dynamically generated input
type="text" controls where their names consist of multiple composite
keys. The name of the input type="text" controls, however, can not be
referenced correctly using javascript. For example, I have the
following html input tag:



The following javascript won't work because the control name contains =
and ; and : as follows:

document.formname.number=1480;countryCode=USA;templateNumber=7;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
= "";

I only have one other idea how to solve this problem. Instead of control
names containing the multiple composite keys, instead use a simple valid
name. In the action, map the valid name to the multiple composite keys.
Does
anyone have any other ideas how to solve this?

Thanks in advance.




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



RE: Losing request attributes

2004-08-13 Thread Hubert Rabago
You can point the "input" to an action which will populate the request with
the attribute(s) you need, and then forwards to your form.

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:

> This is because when the user submits the form, that already starts a
> different request, so the request attributes are no longer there.
> In your mapping for the action where the form gets submitted to, where does
> the input attribute point to?
> 
> Hubert
> 
> --- Leandro Melo <[EMAIL PROTECTED]> wrote:
> 
> > As i replied many times for this topic, i'd like to
> > expose the situation again and in DETAILS.
> > 
> > Suppose a user submits a request that is handled by
> > MyActionDoSomething. Then this action sets a request
> > attribute like this:
> > 
> > request.setAttribute("MyObject", obj); 
> > 
> > and forwards the request to the page
> > myPageDoSomeOtherThing.jsp, wich has some inputs for
> > the user to fill in.
> > This page (myPageDoSomeOtherThing.jsp) uses the bean
> > "obj" that was set in MyActionDoSomething.java ok !?
> > 
> > Now suppose the user submits wrong information in
> > myPageDoSomeOtherThing.jsp, what will cause the
> > validate method in the associated ActionForm to return
> > some ActionErrors. BUT when the ActionForm send this
> > page back for the user to re-input data, the bean
> > "obj" that was set at the very beginning in
> > MyActionDoSomething.java is NOT present anymore!
> > 
> > I think now it's clear that i'm not talking about the
> > formBean attributes, right !? 
> > 


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

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



RE: Loosing request attributes

2004-08-13 Thread Hubert Rabago
This is because when the user submits the form, that already starts a
different request, so the request attributes are no longer there.
In your mapping for the action where the form gets submitted to, where does
the input attribute point to?

Hubert

--- Leandro Melo <[EMAIL PROTECTED]> wrote:

> As i replied many times for this topic, i'd like to
> expose the situation again and in DETAILS.
> 
> Suppose a user submits a request that is handled by
> MyActionDoSomething. Then this action sets a request
> attribute like this:
> 
> request.setAttribute("MyObject", obj); 
> 
> and forwards the request to the page
> myPageDoSomeOtherThing.jsp, wich has some inputs for
> the user to fill in.
> This page (myPageDoSomeOtherThing.jsp) uses the bean
> "obj" that was set in MyActionDoSomething.java ok !?
> 
> Now suppose the user submits wrong information in
> myPageDoSomeOtherThing.jsp, what will cause the
> validate method in the associated ActionForm to return
> some ActionErrors. BUT when the ActionForm send this
> page back for the user to re-input data, the bean
> "obj" that was set at the very beginning in
> MyActionDoSomething.java is NOT present anymore!
> 
> I think now it's clear that i'm not talking about the
> formBean attributes, right !? 
> 
> 
> 
> 
>  --- Jim Barrows <[EMAIL PROTECTED]> escreveu: 
> > 
> > 
> > > -Original Message-
> > > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, August 13, 2004 10:50 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: Loosing request attributes
> > > 
> > > 
> > > No i'm not Kataria. Is this the default option???
> > > Actually, i checked it out in some bibliography
> > and it
> > > seems that redirect is not even a valid attribute
> > for
> > > action mappings :-| ??
> > 
> > Missing, as in the when the screen gets re-rendered
> > they're missing or the data is missing?
> > If the data is missing are you using primitives
> > in your action form or Strings?  If you're using
> > primitives then of course your data is misssing. 
> > See archives and documentation for why.
> > 
> > 
> > > 
> > > 
> > >  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> > > escreveu: 
> > > > Ru using redirect="true" in ur action mapping.
> > If so
> > > > then changing it to false will solve the
> > problem.
> > > > 
> > > > Thanx,
> > > > Satish Kataria
> > > > 
> > > > -Original Message-
> > > > From: Leandro Melo
> > > > [mailto:[EMAIL PROTECTED] 
> > > > Sent: Friday, August 13, 2004 7:39 AM
> > > > To: struts jakarta
> > > > Subject: Loosing request attributes
> > > > 
> > > > 
> > > > Hi,
> > > > when a user request hits the ActionForm's
> > validate
> > > > method and bounces back, i'm loosing some
> > request
> > > > attributes that i had set for the page. In other
> > > > words, if the user inputs some data that don't
> > pass
> > > > the validate method,
> > > > the page comes back with a few request scope
> > > > attributes missing.
> > > > 
> > > > Is there a way to avoid that this happens?
> > > > 
> > > > =
> > > > _
> > > > Leandro Terra C. Melo
> > > > Eng. de Controle e Automação - UFMG
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > >
> >
> ___
> > > > Yahoo! Acesso Grátis - navegue de graça com
> > conexão
> > > > de qualidade! Acesse:
> > http://br.acesso.yahoo.com/
> > > > 
> > > >
> > >
> >
> -
> > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED]
> > > > 
> > > >
> > >
> >
> -
> > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED]
> > > > 
> > > >  
> > > 
> > > =
> > > 
> > > 
> > > __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > > http://mail.yahoo.com 
> > > 
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > 
> > > 
> > 
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >  
> 
> =
> 
> 
> 
>   
>   
>   
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




__
Do you 

RE: Loosing request attributes

2004-08-13 Thread Leandro Melo
As i replied many times for this topic, i'd like to
expose the situation again and in DETAILS.

Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:

request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
This page (myPageDoSomeOtherThing.jsp) uses the bean
"obj" that was set in MyActionDoSomething.java ok !?

Now suppose the user submits wrong information in
myPageDoSomeOtherThing.jsp, what will cause the
validate method in the associated ActionForm to return
some ActionErrors. BUT when the ActionForm send this
page back for the user to re-input data, the bean
"obj" that was set at the very beginning in
MyActionDoSomething.java is NOT present anymore!

I think now it's clear that i'm not talking about the
formBean attributes, right !? 




 --- Jim Barrows <[EMAIL PROTECTED]> escreveu: 
> 
> 
> > -Original Message-
> > From: Leandro Melo
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 10:50 AM
> > To: Struts Users Mailing List
> > Subject: RE: Loosing request attributes
> > 
> > 
> > No i'm not Kataria. Is this the default option???
> > Actually, i checked it out in some bibliography
> and it
> > seems that redirect is not even a valid attribute
> for
> > action mappings :-| ??
> 
> Missing, as in the when the screen gets re-rendered
> they're missing or the data is missing?
> If the data is missing are you using primitives
> in your action form or Strings?  If you're using
> primitives then of course your data is misssing. 
> See archives and documentation for why.
> 
> 
> > 
> > 
> >  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> > escreveu: 
> > > Ru using redirect="true" in ur action mapping.
> If so
> > > then changing it to false will solve the
> problem.
> > > 
> > > Thanx,
> > > Satish Kataria
> > > 
> > > -Original Message-
> > > From: Leandro Melo
> > > [mailto:[EMAIL PROTECTED] 
> > > Sent: Friday, August 13, 2004 7:39 AM
> > > To: struts jakarta
> > > Subject: Loosing request attributes
> > > 
> > > 
> > > Hi,
> > > when a user request hits the ActionForm's
> validate
> > > method and bounces back, i'm loosing some
> request
> > > attributes that i had set for the page. In other
> > > words, if the user inputs some data that don't
> pass
> > > the validate method,
> > > the page comes back with a few request scope
> > > attributes missing.
> > > 
> > > Is there a way to avoid that this happens?
> > > 
> > > =
> > > _
> > > Leandro Terra C. Melo
> > > Eng. de Controle e Automação - UFMG
> > > 
> > > 
> > >   
> > >   
> > >   
> > >
> >
>
___
> > > Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > > de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > > 
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > >  
> > 
> > =
> > 
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Loosing request attributes

2004-08-13 Thread Leandro Melo
Sorry Kataria,
the redirect attribute is inside the forward tag. My
fault.
Any way, i'm not using and as i understand the default
is false.


 --- Leandro Melo <[EMAIL PROTECTED]>
escreveu: 
> No i'm not Kataria. Is this the default option???
> Actually, i checked it out in some bibliography and
> it
> seems that redirect is not even a valid attribute
> for
> action mappings :-| ??
> 
> 
>  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> escreveu: 
> > Ru using redirect="true" in ur action mapping. If
> so
> > then changing it to false will solve the problem.
> > 
> > Thanx,
> > Satish Kataria
> > 
> > -Original Message-
> > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, August 13, 2004 7:39 AM
> > To: struts jakarta
> > Subject: Loosing request attributes
> > 
> > 
> > Hi,
> > when a user request hits the ActionForm's validate
> > method and bounces back, i'm loosing some request
> > attributes that i had set for the page. In other
> > words, if the user inputs some data that don't
> pass
> > the validate method,
> > the page comes back with a few request scope
> > attributes missing.
> > 
> > Is there a way to avoid that this happens?
> > 
> > =
> > _
> > Leandro Terra C. Melo
> > Eng. de Controle e Automação - UFMG
> > 
> > 
> > 
> > 
> > 
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > 
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >
>
-
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >  
> 
> =
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=


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

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



RE: Loosing request attributes

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 10:50 AM
> To: Struts Users Mailing List
> Subject: RE: Loosing request attributes
> 
> 
> No i'm not Kataria. Is this the default option???
> Actually, i checked it out in some bibliography and it
> seems that redirect is not even a valid attribute for
> action mappings :-| ??

Missing, as in the when the screen gets re-rendered they're missing or the data is 
missing?
If the data is missing are you using primitives in your action form or Strings?  
If you're using primitives then of course your data is misssing.  See archives and 
documentation for why.


> 
> 
>  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> escreveu: 
> > Ru using redirect="true" in ur action mapping. If so
> > then changing it to false will solve the problem.
> > 
> > Thanx,
> > Satish Kataria
> > 
> > -Original Message-
> > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, August 13, 2004 7:39 AM
> > To: struts jakarta
> > Subject: Loosing request attributes
> > 
> > 
> > Hi,
> > when a user request hits the ActionForm's validate
> > method and bounces back, i'm loosing some request
> > attributes that i had set for the page. In other
> > words, if the user inputs some data that don't pass
> > the validate method,
> > the page comes back with a few request scope
> > attributes missing.
> > 
> > Is there a way to avoid that this happens?
> > 
> > =
> > _
> > Leandro Terra C. Melo
> > Eng. de Controle e Automação - UFMG
> > 
> > 
> > 
> > 
> > 
> >
> ___
> > Yahoo! Acesso Grátis - navegue de graça com conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > 
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> >  
> 
> =
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Loosing request attributes

2004-08-13 Thread Leandro Melo
No i'm not Kataria. Is this the default option???
Actually, i checked it out in some bibliography and it
seems that redirect is not even a valid attribute for
action mappings :-| ??


 --- "Kataria, Satish" <[EMAIL PROTECTED]>
escreveu: 
> Ru using redirect="true" in ur action mapping. If so
> then changing it to false will solve the problem.
> 
> Thanx,
> Satish Kataria
> 
> -Original Message-
> From: Leandro Melo
> [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 13, 2004 7:39 AM
> To: struts jakarta
> Subject: Loosing request attributes
> 
> 
> Hi,
> when a user request hits the ActionForm's validate
> method and bounces back, i'm loosing some request
> attributes that i had set for the page. In other
> words, if the user inputs some data that don't pass
> the validate method,
> the page comes back with a few request scope
> attributes missing.
> 
> Is there a way to avoid that this happens?
> 
> =
> _
> Leandro Terra C. Melo
> Eng. de Controle e Automação - UFMG
> 
> 
>   
>   
>   
>
___
> Yahoo! Acesso Grátis - navegue de graça com conexão
> de qualidade! Acesse: http://br.acesso.yahoo.com/
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=


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

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



Re: [OT] DAO ... where to draw the line?

2004-08-13 Thread Matthew J. Vincent

Matthew J. Vincent wrote:
Hi all,
Thanks for the info.  Here's another issue.
What if I have an employee search screen that wants to show only some 
of the information of an employee (not all).  What do you do then?
1. Instanatiate an Employee object and only fill in the relative 
information?  Keep in mind that this could be just employee name and 
location on the search results screen and then when the user chooses 
which employee to view I need to get all of the employee information.

2.  Instantiate an Employee object and fill out all the information 
even though you won't be needing most of it on the search results screen?

3.  Create 2 DTOs, one called Employee and one called EmployeeSearch 
DTO.  The EmployeeSearch DTO only stores what needs to be shown on the 
search results screen and the EmployeeDTO holds all the information 
for what needs to be shown on the detail screen?

4.  Something else...
Thanks!
Matt

Navjot Singh wrote:
hi matthew,
I wont say that you go with one or other of your approaches.
It depends upon type of assosciation that 2 entities may share. They 
may have aggregation or composition relationship. Depending on that 
your DAO implementation will decide that you need to get ONLY id or 
the composite objects.

Let me explain.
Say you have class named ORDER ad ORDER_DETAILS. (consists-of 
relationship) Order without order details is nothing. So you may get 
the OrderDetails object as well when you get Order.

Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) 
EMPLOYEE *may* still exists with or without department. So you may 
get only id of department and later fetch the department.

Think in employee table, you have relationship (reports-to). If you 
specify this relation as composition, you may go on fetching the 
objects all the way up to the organization chart ;-)

Do i make sense?
Navjot Singh
-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: 
Wednesday, August 11, 2004 8:21 AM
To: Struts Users Mailing List
Subject: [OT] DAO ... where to draw the line?

[OFF TOPIC]
I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line?
For example:

Let''s say I have three tables:
Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)
How deep do your classes go to replicate the data?
Do you do this...
public class Employee {
   private int id;
   private String name;
   private int deptId;   // just the id
   // .. implementation details
}
or do you do this
public class Employee {
   private int id;
   private String name;
   private Department dept;  // all of the data
   // .. implementation details
}
and so on and so on.   Class Department has the same type of 
problem.  Does it hold just the id for location or a variable class 
Location?

Should DAOs just fill in the id (keys) so it is up to the 
application using the DAOs to get the Employee class, then the 
Department class, and the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + 
loc.getLocationName());

or
Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  
It's possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!
Thanks!
Matt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
 

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

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

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


Re: [OT] Friday: where's Atlanta Mark?

2004-08-13 Thread Michael McGrady
Vic Cekvenich wrote:
He is now harasing the Axis list.
.V 

Well, I thought he did need a little SOAP from time to time.  LOL
Michael
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Michael McGrady
This is getting to be like Abbott and Costello's "Who's On First?".  You 
mean the lastest nightly build of what?  Struts?  Commons-beanutils?

Thanks,
Michael
Niall Pemberton wrote:
Just the latest nightly build.
- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 6:12 AM
Subject: Re: Bean-Map-Forms: what do I need Niall

 

Niall Pemberton wrote:
   

I don't have anything that implements Map - but I developed a LazyDynaMap
and flavours of ActionForm which use it
 

Apparently you have forgotten our discussion a few days ago.  I have
implemented a BeanMapForm which you said the nightlies would allow me to
use, since they no longer read org.apache as org.getApache().  The
BeanMapForm is at
http://wiki.apache.org/struts/StrutsCatalogInstrumentableForms.  I was
asking what I needed to do that.
Thanks,
Michael
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

   


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

 


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


Re: [OT] Friday: where's Atlanta Mark?

2004-08-13 Thread Vic Cekvenich
He is now harasing the Axis list.
.V
Michael McGrady wrote:
Whatever happened to Friday Mark the beer hustler from Atlanta?  This 
list seems much less active.  What does that mean?

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


Spring's MVC? (was Re: Spring/Struts & Hibernate)

2004-08-13 Thread dhay

Talking of Spring, has anyone tried out their MVC framework (hopefully this
isn't considered sacrilege!!).

Any comparisons with Struts?

cheers,

David



|-+>
| |   "Marco Mistroni" |
| |   <[EMAIL PROTECTED]|
| |   stems.com>   |
| ||
| |   08/13/2004 09:31 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>|
  |
|
  |   To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>  
   |
  |   cc:  
|
  |   Subject:  Spring/Struts  & Hibernate 
|
  
>|




Hello mark,
 How r u? hope fine...
i saw some of ur posts in the past about Spring framework and
I wanted to ask u few questions..

are you using Spring? Together with Struts?

What do you think about it?


Thanx in advance and regards
 Marco



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






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



RE: Read only iterate?

2004-08-13 Thread Brian Lee
Lists work, but you have to write your own set(int index) method to set the 
correct object from the List.

BAL
From: "Jim Barrows" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: Read only iterate?
Date: Fri, 13 Aug 2004 09:40:27 -0700

> -Original Message-
> From: Mike Elliott [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: Read only iterate?
>
>
> I've been totally defeated in my attempt to alter an html:text
> element inside a logic:iterate tag.  There must be a way to
> accomplish this, but I've been beating my head against the wall
> for three days now without making progress.
>
> I have simplified the problem substantially from the initial page.
> What I have now looks like this:
from
http://struts.apache.org/userGuide/struts-html.html#text
I'm guessing that a List won't work and you need to have an array.
>
>-
>   [ Submit ]
>Problematic Input [0   ]
>Problematic Input [1   ]
>Functioning Input [A Value ]
>-
>
> The lines containing "Problematic Input" were generated by a
> logic:iterate tag, which successfully fetched the list of objects from
> the form bean.  The last line, containing "Functioning Input", was
> generated outside of the logic:iterate tag.  Actual contents of the
> jsp page, bean, etc., are attached.
>
> What happens at runtime is that when the JSP page is rendered, the
> text fields for all three rows are successfully and correctly fetched
> from the form bean, but only the last row can be changed.  As the log
> shows:
>
> 
>   INFO  [org.apache.struts.util.PropertyMessageResources]
> Initializing,
> config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] initializing entries
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
>   INFO  [problem.ProblemAction] show
>   INFO  [org.apache.struts.util.PropertyMessageResources]
> Initializing,
> config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
>   INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
>   INFO  [problem.ProblemAction] update
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
>
> The page is initialized properly.  All three values are fetched from
> the form bean via the expected get methods.  The html form is properly
> populated and displays the expected values (0, 1, and "A Value").
>
> The three fields are then changed (to 5, 5, and "mutated") and the
> submit button is selected at the point in the log file where I have
> inserted the  annotation.
>
> This causes the form to be submitted to the Action, causing the set
> method for the field "working_perfectly" to be invoked (as it should
> be), but the set method for the two fields in the logic:iterate tag is
> not invoked.  And I don't know why.  And I can't seem to get them to
> be invoked, either.
>
> So . . . the magic isn't working.  Something must be needed to tell
> the generated servlet not to treat these two properties (inside the
> logic:iterate tag) as read-only.  What should it be?  How can I get
> these properties to be updated in the form bean as the
> "working_perfectly" property is?
>
> Like I said -- I've been beating my head against this problem for
> three days now.  There's just got to be a way!
>
> --
> struts-config.xml
> --
> 
>
>"-//Apache Software Foundation//DTD Struts
> Configuration 1.0//EN"
>
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
>
> 
>
>
> name="problemBean"
>  type="problem.ProblemBean"/>
>
>
>
> path="/problemPage"
>  type="problem.ProblemAction"
>  name="problemBean"
>  validate="false"
>  input="/pages/problem.jsp"/>
>
>
> 
>
> --
> problem.jsp:
> --
> <%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
> <%@ taglib uri="/taglib/struts-html" prefix="html" %>
> 
>   
> Problem page
> 
>
> 
> 
>method="post">
> cellpadding="0">
>   
> 

Re: Read only iterate?

2004-08-13 Thread Richard Yee

Mike,
What does the generated HTML look like?

-Richard




__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

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



Re: [OT] Need help with layered Map iteration in JSP

2004-08-13 Thread Curtis Taylor
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>


  <%-- ${entry.key} is the current key --%>
  <%-- ${entry.value} is the associated bean array --%>
  
  

  


See the API docs for the LoopTagStatus interface:  http://tinyurl.com/542tw

"Erik Weber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How can I refer to the index of the current iteration with c:forEach
> (analogous to the indexId attribute to logic:iterate)?
>
> Thanks,
> Erik
>
>
> Kris Schneider wrote:
>
> ><%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> >
> >
> >  <%-- ${entry.key} is the current key --%>
> >  <%-- ${entry.value} is the associated bean array --%>
> >  
> >...
> >  
> >
> >
> >Quoting Erik Weber <[EMAIL PROTECTED]>:
> >
> >
> >
> >>I could use some Struts-EL/JSTL tag help, please.
> >>
> >>I have a Map with each entry having a String as the key and a bean array
> >>as the value.
> >>
> >>I need two iterations, one nested inside the other.
> >>
> >>For the outer iteration, I want to iterate the keySet of the Map. I
> >>don't know what the keys are going to be or how many there will be.
> >>
> >>Within that iteration, for each key in the keySet, I need to iterate
> >>over the buckets of the array that is the value for that key.
> >>
> >>To make this more clear, let's say I will produce a table of tables,
> >>somewhat like this:
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>Could someone show me some skeleton JSTL or Struts-el code?
> >>
> >>I would appreciate it very much,
> >>Erik
> >>
> >>
> >
> >
> >




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



RE: Read only iterate?

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Mike Elliott [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: Read only iterate?
> 
> 
> I've been totally defeated in my attempt to alter an html:text
> element inside a logic:iterate tag.  There must be a way to
> accomplish this, but I've been beating my head against the wall
> for three days now without making progress.
> 
> I have simplified the problem substantially from the initial page.
> What I have now looks like this:

from 
http://struts.apache.org/userGuide/struts-html.html#text
I'm guessing that a List won't work and you need to have an array.


> 
>-
>   [ Submit ]
>Problematic Input [0   ]
>Problematic Input [1   ]
>Functioning Input [A Value ]
>-
> 
> The lines containing "Problematic Input" were generated by a
> logic:iterate tag, which successfully fetched the list of objects from
> the form bean.  The last line, containing "Functioning Input", was
> generated outside of the logic:iterate tag.  Actual contents of the
> jsp page, bean, etc., are attached.
> 
> What happens at runtime is that when the JSP page is rendered, the
> text fields for all three rows are successfully and correctly fetched
> from the form bean, but only the last row can be changed.  As the log
> shows:
> 
> 
>   INFO  [org.apache.struts.util.PropertyMessageResources] 
> Initializing, 
> config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] initializing entries
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
>   INFO  [problem.ProblemAction] show
>   INFO  [org.apache.struts.util.PropertyMessageResources] 
> Initializing, 
> config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
>   INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
>   INFO  [problem.ProblemAction] update
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
> The page is initialized properly.  All three values are fetched from
> the form bean via the expected get methods.  The html form is properly
> populated and displays the expected values (0, 1, and "A Value").
> 
> The three fields are then changed (to 5, 5, and "mutated") and the
> submit button is selected at the point in the log file where I have
> inserted the  annotation.
> 
> This causes the form to be submitted to the Action, causing the set
> method for the field "working_perfectly" to be invoked (as it should
> be), but the set method for the two fields in the logic:iterate tag is
> not invoked.  And I don't know why.  And I can't seem to get them to
> be invoked, either.
> 
> So . . . the magic isn't working.  Something must be needed to tell
> the generated servlet not to treat these two properties (inside the
> logic:iterate tag) as read-only.  What should it be?  How can I get
> these properties to be updated in the form bean as the
> "working_perfectly" property is?
> 
> Like I said -- I've been beating my head against this problem for
> three days now.  There's just got to be a way!
> 
> --
> struts-config.xml
> --
> 
> 
>"-//Apache Software Foundation//DTD Struts 
> Configuration 1.0//EN"
>   
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
> 
> 
> 
>
> name="problemBean"
>  type="problem.ProblemBean"/>
>
> 
>
> path="/problemPage"
>  type="problem.ProblemAction"
>  name="problemBean"
>  validate="false"
>  input="/pages/problem.jsp"/>
>
> 
> 
> 
> --
> problem.jsp:
> --
> <%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
> <%@ taglib uri="/taglib/struts-html" prefix="html" %>
> 
>   
> Problem page
> 
> 
> 
> 
>method="post">
> cellpadding="0">
>   
> 
>   
> 
>   
>   
>property="items" >
> 
>   Problematic input
>   
>property="integer_value" indexed="true"/>
> 

Read only iterate?

2004-08-13 Thread Mike Elliott
I've been totally defeated in my attempt to alter an html:text
element inside a logic:iterate tag.  There must be a way to
accomplish this, but I've been beating my head against the wall
for three days now without making progress.

I have simplified the problem substantially from the initial page.
What I have now looks like this:

   -
  [ Submit ]
   Problematic Input [0   ]
   Problematic Input [1   ]
   Functioning Input [A Value ]
   -

The lines containing "Problematic Input" were generated by a
logic:iterate tag, which successfully fetched the list of objects from
the form bean.  The last line, containing "Functioning Input", was
generated outside of the logic:iterate tag.  Actual contents of the
jsp page, bean, etc., are attached.

What happens at runtime is that when the JSP page is rendered, the
text fields for all three rows are successfully and correctly fetched
from the form bean, but only the last row can be changed.  As the log
shows:


  INFO  [org.apache.struts.util.PropertyMessageResources] Initializing, 
config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
  INFO  [problem.ProblemBean] initializing entries
  INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
  INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
  INFO  [problem.ProblemAction] show
  INFO  [org.apache.struts.util.PropertyMessageResources] Initializing, 
config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
  INFO  [problem.ProblemBean] getEntries
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean] getWorking_perfectly

  INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
  INFO  [problem.ProblemAction] update
  INFO  [problem.ProblemBean] getEntries
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean] getWorking_perfectly

The page is initialized properly.  All three values are fetched from
the form bean via the expected get methods.  The html form is properly
populated and displays the expected values (0, 1, and "A Value").

The three fields are then changed (to 5, 5, and "mutated") and the
submit button is selected at the point in the log file where I have
inserted the  annotation.

This causes the form to be submitted to the Action, causing the set
method for the field "working_perfectly" to be invoked (as it should
be), but the set method for the two fields in the logic:iterate tag is
not invoked.  And I don't know why.  And I can't seem to get them to
be invoked, either.

So . . . the magic isn't working.  Something must be needed to tell
the generated servlet not to treat these two properties (inside the
logic:iterate tag) as read-only.  What should it be?  How can I get
these properties to be updated in the form bean as the
"working_perfectly" property is?

Like I said -- I've been beating my head against this problem for
three days now.  There's just got to be a way!

--
struts-config.xml
--


http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>



   
  
   

   
  
   



--
problem.jsp:
--
<%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
<%@ taglib uri="/taglib/struts-html" prefix="html" %>

  
Problem page




  

  

  

  
  
  

  Problematic input
  

  

  

  
Functioning input

   

  


  
  

  


--
ProblemAction.java
--
package problem;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.Action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public final class ProblemAction extends Action {

   public ActionForward execute( ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response ) {

  String arg = request.getParameter( "arg" );

  if ("update".equals( arg )) {
 log.info( "update" );
  }

  if

Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Niall Pemberton
Just the latest nightly build.
- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 6:12 AM
Subject: Re: Bean-Map-Forms: what do I need Niall


> Niall Pemberton wrote:
>
> >I don't have anything that implements Map - but I developed a LazyDynaMap
> >and flavours of ActionForm which use it
> >
>
> Apparently you have forgotten our discussion a few days ago.  I have
> implemented a BeanMapForm which you said the nightlies would allow me to
> use, since they no longer read org.apache as org.getApache().  The
> BeanMapForm is at
> http://wiki.apache.org/struts/StrutsCatalogInstrumentableForms.  I was
> asking what I needed to do that.
>
> Thanks,
>
> Michael
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Kris Schneider
 supports a "varStatus" attribute. The value of that atrribute is a
String that names an instance of javax.servlet.jsp.jstl.core.LoopTagStatus. The
LoopTagStatus instance has nested visibility so that it's only available within
the enclosing  tag. LoopTagStatus exposes a number of properties,
but the one you're probably interested in is "index":

..
  
<%-- ${status.index} is the current index --%>
...
  
..

Quoting Erik Weber <[EMAIL PROTECTED]>:

> How can I refer to the index of the current iteration with c:forEach 
> (analogous to the indexId attribute to logic:iterate)?
> 
> Thanks,
> Erik
> 
> 
> Kris Schneider wrote:
> 
> ><%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> >
> >
> >  <%-- ${entry.key} is the current key --%>
> >  <%-- ${entry.value} is the associated bean array --%>
> >  
> >...
> >  
> >
> >
> >Quoting Erik Weber <[EMAIL PROTECTED]>:
> >
> >  
> >
> >>I could use some Struts-EL/JSTL tag help, please.
> >>
> >>I have a Map with each entry having a String as the key and a bean array 
> >>as the value.
> >>
> >>I need two iterations, one nested inside the other.
> >>
> >>For the outer iteration, I want to iterate the keySet of the Map. I 
> >>don't know what the keys are going to be or how many there will be.
> >>
> >>Within that iteration, for each key in the keySet, I need to iterate 
> >>over the buckets of the array that is the value for that key.
> >>
> >>To make this more clear, let's say I will produce a table of tables, 
> >>somewhat like this:
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>Could someone show me some skeleton JSTL or Struts-el code?
> >>
> >>I would appreciate it very much,
> >>Erik

-- 
Kris Schneider 
D.O.Tech   

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



Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
How can I refer to the index of the current iteration with c:forEach 
(analogous to the indexId attribute to logic:iterate)?

Thanks,
Erik
Kris Schneider wrote:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

 <%-- ${entry.key} is the current key --%>
 <%-- ${entry.value} is the associated bean array --%>
 
   ...
 

Quoting Erik Weber <[EMAIL PROTECTED]>:
 

I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:


 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 

Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
   

 

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


[OT] Friday: where's Atlanta Mark?

2004-08-13 Thread Michael McGrady
Whatever happened to Friday Mark the beer hustler from Atlanta?  This 
list seems much less active.  What does that mean?

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


Re: Spring/Struts & Hibernate

2004-08-13 Thread James Mitchell
I am using it.  It works great.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message - 
From: "Marco Mistroni" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 9:31 AM
Subject: Spring/Struts & Hibernate


> Hello mark,
> How r u? hope fine...
> i saw some of ur posts in the past about Spring framework and
> I wanted to ask u few questions.. 
> 
> are you using Spring? Together with Struts?
> 
> What do you think about it?
> 
> 
> Thanx in advance and regards
> Marco
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



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



Re: Loosing request attributes

2004-08-13 Thread Erik Weber
You shouldn't have to do anything (in general, you rarely need to 
implement reset) special for this. Struts does this for you. The user 
submits the form. The form bean is populated with the user's input. 
Validation starts on the form bean. Validation fails. Struts forwards 
back to the input page, and the struts tags render all the values that 
the user had input using the populated form bean.

Could you describe in more detail which types of form values seem to be 
"missing" and which ones are intact? Is there a pattern to it?

Erik

Leandro Melo wrote:
I don`t want to reset the attributes of my ActionForm
(what a form.reset() would do), BUT the attributes of
the request the were probably set by the Action that
forwarded to the specific page.
So i need them back in that page if validate fails.
--- Robert Taylor <[EMAIL PROTECTED]> escreveu: 
 

form.reset();
robert
   

-Original Message-
From: Leandro Melo
 

[mailto:[EMAIL PROTECTED]
   

Sent: Friday, August 13, 2004 11:20 AM
To: Struts Users Mailing List
Subject: Re: Loosing request attributes
I was taking a look at the HttpServeltRequest and
ServletRequest apis and noted that theres a method
"getParameterMap()" wich returns a map of the
parameters, BUT there isn`t such a
 

"setParameterMap()"
   

method.
So, what`s an automated way to re-set all my
 

request
   

parameters in the ActionForm??? Do i have to go
 

one by
   

one for each ActionForm :-( ???
--- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
 

Ensure that the request attributes are set in
   

the
   

ActionForm, this is
the only way that you can ensure that they'll
   

still
   

be there when the
validate fails.
Leandro Melo wrote:
   

Hi,
when a user request hits the ActionForm's
 

validate
   

method and bounces back, i'm loosing some
 

request
   

attributes that i had set for the page. In
 

other
   

words, if the user inputs some data that don't
 

pass
   

the validate method,
the page comes back with a few request scope
attributes missing.
Is there a way to avoid that this happens?
=
_
Leandro Terra C. Melo
Eng. de Controle e Automação - UFMG


 

___
   

Yahoo! Acesso Grátis - navegue de graça com
 

conexão
   

de qualidade! Acesse:
   

http://br.acesso.yahoo.com/
   

-
   

To unsubscribe, e-mail:
 

[EMAIL PROTECTED]
   

For additional commands, e-mail:
 

[EMAIL PROTECTED]
   

 

--
Brice Ruth, Sr. IT Analyst
Fiskars Brands Inc
http://www.fiskarsbrands.com/

   

-
 

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

=



 

___
 

Yahoo! Acesso Grátis - navegue de graça com
 

conexão de qualidade! Acesse:
http://br.acesso.yahoo.com/
   

 

-
 

To unsubscribe, e-mail:
 

[EMAIL PROTECTED]
   

For additional commands, e-mail:
 

[EMAIL PROTECTED]
   

   

-
 

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

=




___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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


RE: Loosing request attributes

2004-08-13 Thread Leandro Melo
I don`t want to reset the attributes of my ActionForm
(what a form.reset() would do), BUT the attributes of
the request the were probably set by the Action that
forwarded to the specific page.

So i need them back in that page if validate fails.


 --- Robert Taylor <[EMAIL PROTECTED]> escreveu: 
> form.reset();
> 
> robert
> 
> > -Original Message-
> > From: Leandro Melo
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 11:20 AM
> > To: Struts Users Mailing List
> > Subject: Re: Loosing request attributes
> >
> >
> > I was taking a look at the HttpServeltRequest and
> > ServletRequest apis and noted that theres a method
> > "getParameterMap()" wich returns a map of the
> > parameters, BUT there isn`t such a
> "setParameterMap()"
> > method.
> >
> > So, what`s an automated way to re-set all my
> request
> > parameters in the ActionForm??? Do i have to go
> one by
> > one for each ActionForm :-( ???
> >
> >
> >  --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> > > Ensure that the request attributes are set in
> the
> > > ActionForm, this is
> > > the only way that you can ensure that they'll
> still
> > > be there when the
> > > validate fails.
> > >
> > > Leandro Melo wrote:
> > >
> > > >Hi,
> > > >when a user request hits the ActionForm's
> validate
> > > >method and bounces back, i'm loosing some
> request
> > > >attributes that i had set for the page. In
> other
> > > >words, if the user inputs some data that don't
> pass
> > > >the validate method,
> > > >the page comes back with a few request scope
> > > >attributes missing.
> > > >
> > > >Is there a way to avoid that this happens?
> > > >
> > > >=
> > > >_
> > > >Leandro Terra C. Melo
> > > >Eng. de Controle e Automação - UFMG
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
>___
> > > >Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > > de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > > >
> > >
> >
>
>-
> > > >To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > >For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > >
> > > --
> > > Brice Ruth, Sr. IT Analyst
> > > Fiskars Brands Inc
> > > http://www.fiskarsbrands.com/
> > >
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> >
> > =
> >
> >
> >
> >
> >
> >
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Loosing request attributes

2004-08-13 Thread Robert Taylor
form.reset();

robert

> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 11:20 AM
> To: Struts Users Mailing List
> Subject: Re: Loosing request attributes
>
>
> I was taking a look at the HttpServeltRequest and
> ServletRequest apis and noted that theres a method
> "getParameterMap()" wich returns a map of the
> parameters, BUT there isn`t such a "setParameterMap()"
> method.
>
> So, what`s an automated way to re-set all my request
> parameters in the ActionForm??? Do i have to go one by
> one for each ActionForm :-( ???
>
>
>  --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> > Ensure that the request attributes are set in the
> > ActionForm, this is
> > the only way that you can ensure that they'll still
> > be there when the
> > validate fails.
> >
> > Leandro Melo wrote:
> >
> > >Hi,
> > >when a user request hits the ActionForm's validate
> > >method and bounces back, i'm loosing some request
> > >attributes that i had set for the page. In other
> > >words, if the user inputs some data that don't pass
> > >the validate method,
> > >the page comes back with a few request scope
> > >attributes missing.
> > >
> > >Is there a way to avoid that this happens?
> > >
> > >=
> > >_
> > >Leandro Terra C. Melo
> > >Eng. de Controle e Automação - UFMG
> > >
> > >
> > >
> > >
> > >
> >
> >___
> > >Yahoo! Acesso Grátis - navegue de graça com conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > >
> >
> >-
> > >To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > >For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > Brice Ruth, Sr. IT Analyst
> > Fiskars Brands Inc
> > http://www.fiskarsbrands.com/
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
> =
>
>
>
>
>
>
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
> http://br.acesso.yahoo.com/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
I was taking a look at the HttpServeltRequest and
ServletRequest apis and noted that theres a method
"getParameterMap()" wich returns a map of the
parameters, BUT there isn`t such a "setParameterMap()"
method.

So, what`s an automated way to re-set all my request
parameters in the ActionForm??? Do i have to go one by
one for each ActionForm :-( ???


 --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu: 
> Ensure that the request attributes are set in the
> ActionForm, this is 
> the only way that you can ensure that they'll still
> be there when the 
> validate fails.
> 
> Leandro Melo wrote:
> 
> >Hi,
> >when a user request hits the ActionForm's validate
> >method and bounces back, i'm loosing some request
> >attributes that i had set for the page. In other
> >words, if the user inputs some data that don't pass
> >the validate method,
> >the page comes back with a few request scope
> >attributes missing.
> >
> >Is there a way to avoid that this happens?
> >
> >=
> >_
> >Leandro Terra C. Melo
> >Eng. de Controle e Automação - UFMG
> >
> >
> > 
> > 
> > 
>
>___
> >Yahoo! Acesso Grátis - navegue de graça com conexão
> de qualidade! Acesse: http://br.acesso.yahoo.com/
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >  
> >
> 
> -- 
> Brice Ruth, Sr. IT Analyst
> Fiskars Brands Inc
> http://www.fiskarsbrands.com/
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Caching Framework

2004-08-13 Thread ravi.vedala

Thanks a ton Erik.

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:41 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


// your PlugIn implementation

public class SimpleCache implements org.apache.struts.action.PlugIn {

public void init(org.apache.struts.action.ActionServlet controller, 
org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException {

javax.servlet.ServletContext app = controller.getServletContext();

//invoke some DAO methods to get arrays of String values;

//for example, labels & values for the fifty US states

//to be used in an HTML select

DAO someDAO = new DAO();

app.setAttribute("USStateLabels", someDAO.getUSStateLabels()); // "Alabama", 
"Arkansas", etc.

app.setAttribute("USStateValues", someDAO.getUSStateValues()); // "AL", "AR", 
etc.

}

public void destroy() {

}

}


 . . .




. . .



State:
 


Cheers,
Erik


[EMAIL PROTECTED] wrote:

>That's really a great idea Erik.
>
>Can you please point me to some example.
>
>Thanks Erik,
>
>Regds
>Ravi
>
>-Original Message-
>From: Erik Weber [mailto:[EMAIL PROTECTED]
>Sent: Friday, August 13, 2004 7:21 PM
>To: Struts Users Mailing List
>Subject: Re: Caching Framework
>
>
>Ravi, without getting real complicated, I use PlugIns to do this!
>
>Implement org.apache.struts.action.PlugIn. You only need to write two
>methods -- init and destroy. In your init method, gather some data
>store it as application scope attributes (you get a reference to the
>controller Servlet in the init method). Finally, register your PlugIn
>with struts-config.xml. When your Struts app initializes, your PlugIn's
>init method is invoked. Your JSPs now have easy access to the cached
>data, as do your Actions.
>
>Erik
>
>
>
>[EMAIL PROTECTED] wrote:
>
> 
>
>>Hi,
>>
>>Is there any Caching framework available for struts ?
>>
>>For eg: I need to cache some list of objects ...etc.,
>>
>>Ravi
>>
>>
>>
>>
>>
>>Confidentiality Notice
>>
>>The information contained in this electronic message and any
>>attachments to this message are intended for the exclusive use of the
>>addressee(s) and may contain confidential or privileged information.
>>If you are not the intended recipient, please notify the sender at
>>Wipro or [EMAIL PROTECTED] immediately and destroy all copies of
>>this message and any attachments.
>>
>>
>>   
>>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain confidential or privileged information. If
>you are not the intended recipient, please notify the sender at Wipro
>or [EMAIL PROTECTED] immediately and destroy all copies of this
>message and any attachments.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> 
>

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





Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
You seem to like parsing HttpServletRequests manually, so why don't 
you skip Struts altogether and parse all request parameters manually? 
I bet it would be "clear, extensible, light, fast, loosely coupled 
solution". Hell, who needs ActionForms after all? They make your 
solution tightly coupled to Struts!
The forms are meant to mine values.  They are not meant to supplant 
business logic.  The question is not about "manual" parsing.  The 
question is when and how to parse.  Parsing is parsing -- is "manual" of 
necessity.   There is a difference between "manual" and "hard coding". 

ActionForms are not tightly coupled to Struts.  They are Struts.  I for 
one am a great advocate of Struts and believe in fact that in the end it 
will be preferred to JSF by a long shot.  Still, loose coupling is a 
primary goal of Struts, not the opposite.  I am not sure why you prefer 
your solution.  I cannot see a single advantage in practice to it.  But, 
as I said, c'est la vie!

Michael


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


RE: Caching Framework

2004-08-13 Thread Richard Cave
Code as follows
Caching class

package com.mypackage.Cache

mport org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.action.ActionServlet;

public class Cacheimplements PlugIn
{
private static Cacheinstance = null;

private ModuleConfig module = null;
private ActionServlet action = null;

public Cache()
{
  if (instance == null)
instance = this;
}

public static Cache getInstance()
{
  if (instance == null)
instance = new Cache();
  return instance;
}
 
 
   
   public void init(ActionServlet action, ModuleConfig module)
   {
 this.action = action;
 this.module = module;

   put your code in here to fire off any caching of data
   }

  public void destroy()
   {
  instance = null;
  action = null;
  module = null;

 any cleanup code.
   }


Add the following into your Struts-config.xml file





Parameters can be supplied to the class using the 

inclusion between the plug-in statements. You would then have a local
declaration in the Cache class with getter and setter methods to access the
parameter.

Hope this helps.

Richard


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 15:29
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



As I am very new to struts, it would be very helpful if you can point me to
some sample code.

Thanks for support from everybody.

Regds
Ravi

-Original Message-
From: Richard Cave [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:16 PM
To: 'Struts Users Mailing List'
Subject: RE: Caching Framework


Ravi,

We've just implemented a master data load using the same technique as Eric.
Appears to be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this

>message
and any attachments.
>


>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender at Wipro or [EMAIL PROTECTED]
immediately and destroy all copies of this message and any attachments.

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

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



Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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

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

Re: Caching Framework

2004-08-13 Thread Vic Cekvenich
In Struts, a layered framework, caching data should happen in the data 
layer. iBatis, Hibrenate, and other DAO's all do caching automaticaly 
and configureable of data, such as drop down selects, etc.
Caching data in View layer is not Strut-y.
.V

[EMAIL PROTECTED] wrote:
Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
 
Ravi



Confidentiality Notice
The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
OK, Cap't of the Eh Team!
Maybe you should go and add "Note: this is a clear, extensible, light, 
fast, loosely coupled, solution compared to a messy, solution 
specific, heavy, slow, tightly coupled version!" to the Wiki page? 
After all, you have invented an elegant solution with low cost and 
with great flexibility and freedom!

Janne,
You too can be sardonic.  LOL  I guess we are just going to have to 
disagree on this one.  Enjoy coding and have a great day!  I was way 
ahead of you on the Wiki page suggestion though.  LOL

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
I guess, to be more concilliatory, Janne, I could say that if you want 
to use your solution, then you could just index item, e.g. 

public Id getIndex(Integer id) {
 return new Id(intValue());
}
Where the class Id is the following:
public class Id {
 private int id;
 public Id(Integer x) {
   id = x.intValue();
 }
 public int getId() {
   return id;
 }
 public void setX(Integer x) {
 }
 public void setY(Integer y) {
 }
}
That gets rid of all your classes and gives you the same result. 


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


RE: Caching Framework

2004-08-13 Thread ravi.vedala

As I am very new to struts, it would be very helpful if you can point me to some 
sample code.

Thanks for support from everybody.

Regds
Ravi

-Original Message-
From: Richard Cave [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:16 PM
To: 'Struts Users Mailing List'
Subject: RE: Caching Framework


Ravi,

We've just implemented a master data load using the same technique as Eric. Appears to 
be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this
>message
and any attachments.
>

>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to this 
message are intended for the exclusive use of the addressee(s) and may contain 
confidential or privileged information. If you are not the intended recipient, please 
notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of 
this message and any attachments.

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

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



Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Caching Framework

2004-08-13 Thread kcitron
Use OSCache
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Accessing bean properties problem

2004-08-13 Thread Janne Mattila
OK, Cap't of the Eh Team!
Maybe you should go and add "Note: this is a clear, extensible, light, fast, 
loosely coupled, solution compared to a messy, solution specific, heavy, 
slow, tightly coupled version!" to the Wiki page? After all, you have 
invented an elegant solution with low cost and with great flexibility and 
freedom!


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 07:11:29 -0700
No mas, Janne!  If you think that your serpentine code is superior to the 
following:

public class ButtonMiner {
 public int getId(HttpServletRequest request) {
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   buttonValue = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
 return Integer.parseInt(buttonValue.substring(1));
 }
}

which you could get from indexing "_", then go for it!  I have no more to 
say.

Michael
Janne Mattila wrote:
I am well aware of the solution that you suggest and the fact that you 
think other solutions are over-engineered - I did indeed try to search for 
a solution before creating my own, and noticed the wiki page with the 
original over-engineered solution (which I noticed did change just 
recently).

There are two problems, first, your solution does not solve my case. Note 
that this is not a simple case of distinguishing whether "accept" or 
"nuke" was clicked (for those I would not certainly have used the original 
strategy from the wiki page, I agree with over-engineering there) - I want 
to get the ID conveniently as well. Please refer to earlier posts for 
details. Of course, I can add more parsing code to get also the ID, but 
this does not help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one 
important being parsing HttpServletRequest parameters so I do not have to 
deal with them manually. This service comes with a price - I have to spend 
time to learn the principles of the framework and all the small annoying 
quirks and unintuitive details (so far I've ran into quite a few!). If I 
have to both learn to cope with Struts and still continue to parse request 
parameters manually like I have done so many times before, the deal does 
not sound so good to me. The solution you suggest works, is not too 
complicated, but it does not integrate as seamlessly with the rest of the 
framework and how it is used to handle parameters. Button parameters end 
up being an exception to the general rule and I prefer a "pretty" 
solution. The solution I described also integrates nicely to the way other 
indexed properties are handled on the JSP page.

I don't know, but I am currently satisfied with the solution I am using. I 
end up creating one additional class (ImageButtonTracer) and add instance 
of it as a field to each form that requires this kind of "indexed 
buttons". You would probably create one additional helper class (with a 
further developed version of the method you present) and add parameter 
name encoding logic to each form that contains such buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in 
any event.  The better button solution involves making only one button 
and then nuking that button as soon as you determine what image was 
clicked.  I just nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To recap, 
I want to have a page with several delete buttons. Clicking on one 
button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts w

Re: Caching Framework

2004-08-13 Thread Erik Weber
// your PlugIn implementation
public class SimpleCache implements org.apache.struts.action.PlugIn {
   public void init(org.apache.struts.action.ActionServlet controller, 
org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException {
javax.servlet.ServletContext app = controller.getServletContext();
   //invoke some DAO methods to get arrays of String values;
   //for example, labels & values for the fifty US states
   //to be used in an HTML select
DAO someDAO = new DAO();
   app.setAttribute("USStateLabels", someDAO.getUSStateLabels()); // "Alabama", 
"Arkansas", etc.
   app.setAttribute("USStateValues", someDAO.getUSStateValues()); // "AL", "AR", 
etc.
   }
   public void destroy() {
   }
}
. . .

. . .


State:


Cheers,
Erik
[EMAIL PROTECTED] wrote:
That's really a great idea Erik.
Can you please point me to some example.
Thanks Erik,
Regds
Ravi
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework
Ravi, without getting real complicated, I use PlugIns to do this!
Implement org.apache.struts.action.PlugIn. You only need to write two
methods -- init and destroy. In your init method, gather some data store
it as application scope attributes (you get a reference to the
controller Servlet in the init method). Finally, register your PlugIn
with struts-config.xml. When your Struts app initializes, your PlugIn's
init method is invoked. Your JSPs now have easy access to the cached
data, as do your Actions.
Erik

[EMAIL PROTECTED] wrote:
 

Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
Ravi


Confidentiality Notice
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro
or [EMAIL PROTECTED] immediately and destroy all copies of this message and any 
attachments.
   

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

Confidentiality Notice
The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
No mas, Janne!  If you think that your serpentine code is superior to 
the following:

public class ButtonMiner {
 public int getId(HttpServletRequest request) {
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   buttonValue = parameterName.substring(0,parameterName.indexOf('.'));
 }
 return Integer.parseInt(buttonValue.substring(1));
 }
}
which you could get from indexing "_", then go for it!  I have no more 
to say.

Michael
Janne Mattila wrote:
I am well aware of the solution that you suggest and the fact that you 
think other solutions are over-engineered - I did indeed try to search 
for a solution before creating my own, and noticed the wiki page with 
the original over-engineered solution (which I noticed did change just 
recently).

There are two problems, first, your solution does not solve my case. 
Note that this is not a simple case of distinguishing whether "accept" 
or "nuke" was clicked (for those I would not certainly have used the 
original strategy from the wiki page, I agree with over-engineering 
there) - I want to get the ID conveniently as well. Please refer to 
earlier posts for details. Of course, I can add more parsing code to 
get also the ID, but this does not help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one 
important being parsing HttpServletRequest parameters so I do not have 
to deal with them manually. This service comes with a price - I have 
to spend time to learn the principles of the framework and all the 
small annoying quirks and unintuitive details (so far I've ran into 
quite a few!). If I have to both learn to cope with Struts and still 
continue to parse request parameters manually like I have done so many 
times before, the deal does not sound so good to me. The solution you 
suggest works, is not too complicated, but it does not integrate as 
seamlessly with the rest of the framework and how it is used to handle 
parameters. Button parameters end up being an exception to the general 
rule and I prefer a "pretty" solution. The solution I described also 
integrates nicely to the way other indexed properties are handled on 
the JSP page.

I don't know, but I am currently satisfied with the solution I am 
using. I end up creating one additional class (ImageButtonTracer) and 
add instance of it as a field to each form that requires this kind of 
"indexed buttons". You would probably create one additional helper 
class (with a further developed version of the method you present) and 
add parameter name encoding logic to each form that contains such 
buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something 
similar, however.  As I menteioned before, I just use the following 
code to determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated 
in any event.  The better button solution involves making only one 
button and then nuking that button as soon as you determine what 
image was clicked.  I just nuked the whole solution, since it is 
unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking 
on one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly 
implement this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonT

RE: Caching Framework

2004-08-13 Thread Guillermo Meyer
You could use Providers (http://providers.sourceforge.net) to handle collections
of objects, cache them and in addition use these collection to populate
select tags, create dependant drop down lists and display labels (descriptions)
according to an ID (i.e using  tag similar to  Struts )

With providers you can create collections with different strategies (fixed,
JDBC, filtered, etc) and optionally you could create your own collection
factory.

Cheers.
Guillermo.

>-- Mensaje original --
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Caching Framework
>Date:  Fri, 13 Aug 2004 19:08:31 +0530
>From:  <[EMAIL PROTECTED]>
>To:<[EMAIL PROTECTED]>
>
>
>
>Hi,
>
>
>Is there any Caching framework available for struts ?
>
>
>For eg: I need to cache some list of objects ...etc.,
>
>
>Ravi
>
>
>
>
>
>
>Confidentiality Notice
>
>
>The information contained in this electronic message and any attachments
>to this message are intended
>for the exclusive use of the addressee(s) and may contain confidential
or
>privileged information. If
>you are not the intended recipient, please notify the sender at Wipro or
>[EMAIL PROTECTED] immediately
>and destroy all copies of this message and any attachments.



FiberTel, el nombre de la banda ancha http://www.fibertel.com.ar



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



Re: How to help the user navigate to his own folder

2004-08-13 Thread Bill Siggelkow
I suggest you slide (couldn't resist:) on over to 
http://jakarta.apache.org/site/mail2.html#Slide.

Gao Jun wrote:
Hi everyone,
 
I've a problem in using Slide and I'd like to hear your suggestion.
We are using slide to implement a document management system and we
will assign specific users access to specific folders. For example,
we have a doc tree like,
 
A
   -B1
-C
   -B2
 
One user has the access to folder C, so he can read and write in folder C.
However, I have the problem of letting this user enter C folder. 
First, because he doesn't have access to A and B1, so he can't navigate to
C by enter A first, then enter B1.
Second, if I let this user jump into C directly, this user should know his
folder has the path A/B1/C. But does Slide provide a way (some api) to let
us find this users all available paths?
 
Have you ever met this kind of problem? Any suggestion?
 
Thanks and regards,
 
Jun

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

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


RE: Caching Framework

2004-08-13 Thread rahul.chaudhary
--- Begin Message ---
One option is to use the singleton pattern. It also depends upon what functionality 
are you looking for e.g. frequency of cache update.. and many more..

-Original Message- 
From: Ravi Vedala (WT01 - FINANCE BANKING & SERVICES) 
Sent: Fri 8/13/2004 6:38 AM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: Caching Framework




Hi,


Is there any Caching framework available for struts ?


For eg: I need to cache some list of objects ...etc.,


Ravi






Confidentiality Notice


The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or 
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments. 

<>--- End Message ---

Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Validating indexed properties

2004-08-13 Thread Bill Siggelkow
I posted this message to the commons-user list but didn't receive any 
feedback. Basically, I am trying to get the indexedListProperty feature 
of Validator to allow me to report errors correctly for each property on 
a form that fails validation -- the only way I could get it to work was 
to change the Validator Field class -- I am trying to find out if there 
are any other known work arounds.
===
I have been working with indexedListProperty in Struts 1.2 (using 
Validator 1.1.3, I believe). Suppose I have the following validation:



   
   
   
   minlength
   5
   


Now, when I validate the form, if the minlength validation fails on one 
of the indexed properties, then none of the rest of the partNumber 
fields are checked for minlength.

I am using Struts and I was trying to output the error message beside 
the property using html:messages -- the result is that the error message 
is only generated for the first property that fails.

For what its worth, I did hack a fix -- I changed the
ValidatorResults validate(Map params, Map actions) method in the Field 
class [org.apache.commons.validator.Field].

Basically where it had (on line 724):
-
if (!good) {
return allResults;
}

I made it ...
-
if (!good && numberOfFieldsToValidate <= 1) {
return allResults;
}

This worked -- in other words I get all the messages generated for each 
field if the field is indexed.

Any opinions on ramifications of making this change or other possible 
solutions? I have not messed at all with the client-side javascript so I 
am not sure what the behavior is like there.

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


RE: Caching Framework

2004-08-13 Thread Richard Cave
Ravi,

We've just implemented a master data load using the same technique as Eric.
Appears to be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this message
and any attachments.
> 

>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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

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



RE: Caching Framework

2004-08-13 Thread ravi.vedala

That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two
methods -- init and destroy. In your init method, gather some data store
it as application scope attributes (you get a reference to the
controller Servlet in the init method). Finally, register your PlugIn
with struts-config.xml. When your Struts app initializes, your PlugIn's
init method is invoked. Your JSPs now have easy access to the cached
data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain confidential or privileged information. If
>you are not the intended recipient, please notify the sender at Wipro
>or [EMAIL PROTECTED] immediately and destroy all copies of this message and any 
>attachments.
> 
>

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




Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Caching Framework

2004-08-13 Thread Erik Weber
Ravi, without getting real complicated, I use PlugIns to do this!
Implement org.apache.struts.action.PlugIn. You only need to write two 
methods -- init and destroy. In your init method, gather some data store 
it as application scope attributes (you get a reference to the 
controller Servlet in the init method). Finally, register your PlugIn 
with struts-config.xml. When your Struts app initializes, your PlugIn's 
init method is invoked. Your JSPs now have easy access to the cached 
data, as do your Actions.

Erik

[EMAIL PROTECTED] wrote:
Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
Ravi


Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.
 

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


Caching Framework

2004-08-13 Thread ravi.vedala

Hi,

Is there any Caching framework available for struts ?

For eg: I need to cache some list of objects ...etc.,

Ravi





Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

Re: Accessing bean properties problem

2004-08-13 Thread Janne Mattila


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 06:22:38 -0700
Janne Mattila wrote:
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have 
not quite figured out how to properly implement this kind of 
functionality using them.

All the solutions involve parsing the request parameters, Janne.  That is 
clearly the only way you will ever know what they are.  The difference is 
that there is a clear, extensible, light, fast, loosely coupled, solution 
and a messy, solution specific, heavy, slow, tightly coupled version of the 
solution.  You are seeking the latter for some reason.  There is NO reason 
to couple your solution to Struts.  Struts is a framework and is not meant 
to be a fulcrum to solve this problem.  If you were using the solution I 
have suggested for "ages", you should go back to it.  Your present solution 
is horrible in comparison.  That is just plain true.
If you use Struts to do your HTTP request processing, you'll couple your 
HTTP request processing to Struts. I don't know what all this nonsense about 
"decoupling from Struts" is meant to be. That is the whole point of using 
Struts, there is absolutely no logic in trying to decouple you application's 
HTTP parameter handling from Struts. It is what Struts does.

You seem to like parsing HttpServletRequests manually, so why don't you skip 
Struts altogether and parse all request parameters manually? I bet it would 
be "clear, extensible, light, fast, loosely coupled solution". Hell, who 
needs ActionForms after all? They make your solution tightly coupled to 
Struts!

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

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


Spring/Struts & Hibernate

2004-08-13 Thread Marco Mistroni
Hello mark,
How r u? hope fine...
i saw some of ur posts in the past about Spring framework and
I wanted to ask u few questions.. 

are you using Spring? Together with Struts?

What do you think about it?


Thanx in advance and regards
Marco



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



Re: Accessing bean properties problem

2004-08-13 Thread Janne Mattila
I am well aware of the solution that you suggest and the fact that you think 
other solutions are over-engineered - I did indeed try to search for a 
solution before creating my own, and noticed the wiki page with the original 
over-engineered solution (which I noticed did change just recently).

There are two problems, first, your solution does not solve my case. Note 
that this is not a simple case of distinguishing whether "accept" or "nuke" 
was clicked (for those I would not certainly have used the original strategy 
from the wiki page, I agree with over-engineering there) - I want to get the 
ID conveniently as well. Please refer to earlier posts for details. Of 
course, I can add more parsing code to get also the ID, but this does not 
help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one important 
being parsing HttpServletRequest parameters so I do not have to deal with 
them manually. This service comes with a price - I have to spend time to 
learn the principles of the framework and all the small annoying quirks and 
unintuitive details (so far I've ran into quite a few!). If I have to both 
learn to cope with Struts and still continue to parse request parameters 
manually like I have done so many times before, the deal does not sound so 
good to me. The solution you suggest works, is not too complicated, but it 
does not integrate as seamlessly with the rest of the framework and how it 
is used to handle parameters. Button parameters end up being an exception to 
the general rule and I prefer a "pretty" solution. The solution I described 
also integrates nicely to the way other indexed properties are handled on 
the JSP page.

I don't know, but I am currently satisfied with the solution I am using. I 
end up creating one additional class (ImageButtonTracer) and add instance of 
it as a field to each form that requires this kind of "indexed buttons". You 
would probably create one additional helper class (with a further developed 
version of the method you present) and add parameter name encoding logic to 
each form that contains such buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in any 
event.  The better button solution involves making only one button and then 
nuking that button as soon as you determine what image was clicked.  I just 
nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To recap, I 
want to have a page with several delete buttons. Clicking on one button 
would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have 
not quite figured out how to properly implement this kind of 
functionality using them.

I finally figured out a reasonably satisfying way to do this while using 
Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTr

Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them. 

All the solutions involve parsing the request parameters, Janne.  That 
is clearly the only way you will ever know what they are.  The 
difference is that there is a clear, extensible, light, fast, loosely 
coupled, solution and a messy, solution specific, heavy, slow, tightly 
coupled version of the solution.  You are seeking the latter for some 
reason.  There is NO reason to couple your solution to Struts.  Struts 
is a framework and is not meant to be a fulcrum to solve this problem.  
If you were using the solution I have suggested for "ages", you should 
go back to it.  Your present solution is horrible in comparison.  That 
is just plain true.

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


Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Michael McGrady
Niall Pemberton wrote:
I don't have anything that implements Map - but I developed a LazyDynaMap
and flavours of ActionForm which use it
To use it you need...
* Struts Nightly Build
http://cvs.apache.org/builds/jakarta-struts/nightly/
* BeanUtils 1.7.0 Release
http://jakarta.apache.org/site/binindex.cgi
* LazyValidatorMap  or LazyValidatorActionMap
http://www.niallp.pwp.blueyonder.co.uk/lazyforms.zip
Full Info on my web site:
 http://www.niallp.pwp.blueyonder.co.uk
Niall
Niall,
This is the prior message I was referring to:
To: "Struts Developers List" <[EMAIL PROTECTED]>
Subject: Re:  this.that.x=4 and this.that.y=9 translations
 in  ActionForm
At 08:53 AM 8/10/2004, you wrote:
Have you tried this with the latest nightly build - I was having similar
problems with some of the standard parameters struts uses (e.g. Cancel
button indicator and Transaction tokens) - my forms were trying to get the
"org" bean.
I changed the form population mechanims to ignore parameters that start
"org.apache.struts." recently to resolve this - try it with the nightly
build.
Niall
What do I need to use this?
Thanks, Michael

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
See http://wiki.apache.org/struts/StrutsCatalogMultipleImageTagsSimplified
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking on 
one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTracer tracer) {
deleteButton = tracer;
}
}
public class ImageButtonTracer {
private Map clickedButtons;
public ImageButtonTracer() {
clickedButtons = new HashMap();
}
public Button getItem(int index) {
Button toReturn = (Button) clickedButtons.get(new 
Integer(index));
if (toReturn == null) toReturn = new Button();
clickedButtons.put(new Integer(index), toReturn);
return toReturn;
}

public void setItem(int index, Button button) {
logger.debug("setItem(" + index + ")");
clickedButtons.put(new Integer(index), button);
}
public Collection getClickedButtonIndexes() {
return clickedButtons.keySet();
}
public class Button {
private int x;
private int y;
public int getX() { return x; }
public int getY() { return y; }
public void setX(int i) { x = i; }
public void setY(int i) { y = i; }
}
}
public class ChoiceView implements Serializable {
private String key;
private String name;
private String description;
... + getters & setters
}

 
 
   
 
 
 
 
   
 
 
 


public class SaveChoicesAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ChoicesForm cform = (ChoicesForm) form;
ChoiceDAO dao = new ChoiceDAO();
// UPDATE
Iterator i = cform.getChoices().iterator();
while (i.hasNext()) {
ChoiceView view = (ChoiceView) i.next();
Choice toUpdate = ChoiceView.createChoice(view);
dao.update(toUpdate);
}
  // DELETE
Collection deletedIds =
cform.getDeleteButton().getClickedButtonIndexes();
if (deletedIds != null) {
Iterator d = deletedIds.iterator();
while (d.hasNext()) {
int deleteIndex = ((Integer) d.next()).intValue();
ChoiceView toDelete = cform.getChoice(deleteIndex);
Choice choice = ChoiceView.createChoice(toDelete);
dao.delete(choice);
}
}
return mapping.findForward("success");
}
}
ImageButtonTracer can be simplified a bit if one assumes that only one 
button can be clicked per request (as is the case) => public 
Collection getClickedButtonIndexes()  can be changed to public int 
getClickedButtonIndex(). This works, and I can use indexed properties 
somewhat comfortably.

Any improvements / alternatives are welcome.
_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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



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

Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
Thanks!
Erik

Kris Schneider wrote:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

 <%-- ${entry.key} is the current key --%>
 <%-- ${entry.value} is the associated bean array --%>
 
   ...
 

Quoting Erik Weber <[EMAIL PROTECTED]>:
 

I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:


 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 

Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
   

 

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in 
any event.  The better button solution involves making only one button 
and then nuking that button as soon as you determine what image was 
clicked.  I just nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking on 
one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTracer tracer) {
deleteButton = tracer;
}
}
public class ImageButtonTracer {
private Map clickedButtons;
public ImageButtonTracer() {
clickedButtons = new HashMap();
}
public Button getItem(int index) {
Button toReturn = (Button) clickedButtons.get(new 
Integer(index));
if (toReturn == null) toReturn = new Button();
clickedButtons.put(new Integer(index), toReturn);
return toReturn;
}

public void setItem(int index, Button button) {
logger.debug("setItem(" + index + ")");
clickedButtons.put(new Integer(index), button);
}
public Collection getClickedButtonIndexes() {
return clickedButtons.keySet();
}
public class Button {
private int x;
private int y;
public int getX() { return x; }
public int getY() { return y; }
public void setX(int i) { x = i; }
public void setY(int i) { y = i; }
}
}
public class ChoiceView implements Serializable {
private String key;
private String name;
private String description;
... + getters & setters
}

 
 
   
 
 
 
 
   
 
 
 


public class SaveChoicesAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ChoicesForm cform = (ChoicesForm) form;
ChoiceDAO dao = new ChoiceDAO();
// UPDATE
Iterator i = cform.getChoices().iterator();
while (i.hasNext()) {
ChoiceView view = (ChoiceView) i.next();
Choice toUpdate = ChoiceView.createChoice(view);
dao.update(toUpdate);
}
  // DELETE
Collection deletedIds =
cform.getDeleteButton().getClickedButtonIndexes();
if (deletedIds != null) {
Iterator d = deletedIds.iterator();
while (d.hasNext()) {
int deleteIndex = ((Integer) d.next()).intValue();
ChoiceView toDelete = cform.getChoice(deleteIndex);
Choice choice = ChoiceView.createChoice(toDelete);
dao.delete(choice);
}
}
return mapping.findForward("success");
}
}
ImageButtonTracer can be simplified a bit if one assumes that only one

  1   2   >