About Action Form

2004-10-16 Thread Koon Yue Lam
Hi, suppose I have 2 actions which each has its own action form
A1 will have F1
A2 will have F2

and we have JSP1, JSP2 and JSP3

it is like a 2 steps wizard, 
user first access JSP1 and when submit, A1 is executed and populate
F1, it then forward to JSP2

user will select some data in JSP2 and when submit, A2 is executed and
populate F2

The question is the data need to populate F2 is determined by what
user select on F1, but only one action form can be associated to
action. How do A2 know what user has selected??

any help will be appreciated

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



Re: About Action Form

2004-10-16 Thread Michael McGrady
The answer can be determined by thinking it through.  Start with where 
the data is and where it goes.  You do not say if data prepopulates a 
form, so I will assume it does not. 

JSP1 has some data which is submitted and shows up in F1 and maybe A1.  
Right?  There it is.  Your data.  All of it and that is it.  If the 
foward to JSP2 does not somehow save that data, then  the data will 
be gone.  So, if you need it, you need to save it somehow.  There are 
lots of ways to do that.  So, you get to JSP2 and either have data saved 
or not.  If not, not.  Is so, so.  This is exactly all there is to it in 
an important way.  When JSP2 is submitted the data is sent to F2 and 
maybe A2.  If JSP2 did not save any previous data in the response 
object, and nothing else did too.  All the data left, as we reach good 
old A2 which forwards to JSP3.  Now if no data from A2 is saved, old 
JSP3 doesn't get any.  That's all there is to it. 

Michael
Koon Yue Lam wrote:
Hi, suppose I have 2 actions which each has its own action form
A1 will have F1
A2 will have F2
and we have JSP1, JSP2 and JSP3
it is like a 2 steps wizard, 
user first access JSP1 and when submit, A1 is executed and populate
F1, it then forward to JSP2

user will select some data in JSP2 and when submit, A2 is executed and
populate F2
The question is the data need to populate F2 is determined by what
user select on F1, but only one action form can be associated to
action. How do A2 know what user has selected??
any help will be appreciated
-
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: About Action Form

2004-10-16 Thread Koon Yue Lam
oh, so I need some way to store data in the respond object
I know session can be help, is it a right way to do?
It is not very big object but it would be an array of String (which
contains user's multiple selection)

thanks for your help, ^^

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



Re: About Action Form

2004-10-16 Thread Frank W. Zammetti
Session is probably the way to go.  For things like this, i.e., data 
that is transient on the whole but needs to persists across a number of 
requests, session is probably the right choice.

Why WOULDN'T it be the right choice?  If your storing a lot of data, 
session can become a problem, especially if you might deploy to a 
distributed environment.  Second, if you expect a very large number of 
requests, you may find server resources being chewed up more than you'd 
like and performance might ultimately suffer.  Also, if you need the 
capability of saving the steps of the wizard for later, you'll need a 
more permanent persistence mechanism.  These are just some of the concerns.

All that being said, from what you describe, I'm thinking session 
without hesitation.  Not much data, your entire process takes a couple 
of steps then some final result (which may be more permanently 
persisted, I don't know)... Session coding will be very easy, and unless 
your going to have a huge load, there shouldn't be any problem.  Only 
you know all the details though, so you'll have to make the real 
determination.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Koon Yue Lam wrote:
oh, so I need some way to store data in the respond object
I know session can be help, is it a right way to do?
It is not very big object but it would be an array of String (which
contains user's multiple selection)
thanks for your help, ^^
-
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: logic:iterate and table display

2004-10-16 Thread Vijay Vishvas Dharap
Can you tell how to use EL code.
Am kind of newbie to Struts and and not much aware of EL tags.
But my containier is only JSP 1.2
Also I am using struts 1.1


-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 16, 2004 7:57 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate and table display

Vijay Vishvas Dharap wrote the following on 10/15/2004 9:41 PM:
 Hi all,
 
 I have following scenario.. 
 I have FormBean which has getter and setter for my VO object
 
 In VO I have a list of another VO.
 
 Now on this form I want to display the contents of the list using
 logic.iterate tags.
 
 I will make matter simpler saying...
 
 aFormBean has aVO which as list of bVO. bVO has attributes like xAttr,
 yAttr, zAttr.
 
 now aForm should show on the page table where contents of list of bVO
 will be giving one one row of the table.

You can do this with struts logic and bean:write,I'm used to JSTL so 
here it is...

c:forEach items=${yourFormName.aVo.bVOlist} var=bVOitem
c:out value='${bVOitem.xAttr}'/
%-- or JSP2.0 just ${bVOitem.xAttr} --%
c:out value='${bVOitem.yAttr}'/
/c:forEach

with logic iterate within your html:form tags (I 'think' this is
right?)

//use the EL struts tags if not using JSP2.0 Container

logic:iterate property=aVo.bVOlist id=bVOitem
bean:write name=bVOitem property=xAttr/
 bean:write name=bVOitem property=yAttr/
/logic:iterate

Obviously you would surround the above with table tags etc. Or you could

also use the display tag (search google or archives) that will do this 
for you.

-- 
Rick

-
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: About Action Form

2004-10-16 Thread Michael McGrady
Frank is definitely right.  You will have to decide.  You can store data 
in a database too.  If you have a situation where the data is 
particularly session oriented, then storing in the session makes sense.  
However, remember the odd things that can happen with things like 
popups, frames, etc.  I personally prefer to use an application level 
multithreaded program that does this stuff, relying on my own algorithms 
and not upon session management in the container. 

Frank W. Zammetti wrote:
Session is probably the way to go.  For things like this, i.e., data 
that is transient on the whole but needs to persists across a number 
of requests, session is probably the right choice.

Why WOULDN'T it be the right choice?  If your storing a lot of data, 
session can become a problem, especially if you might deploy to a 
distributed environment.  Second, if you expect a very large number of 
requests, you may find server resources being chewed up more than 
you'd like and performance might ultimately suffer.  Also, if you need 
the capability of saving the steps of the wizard for later, you'll 
need a more permanent persistence mechanism.  These are just some of 
the concerns.

All that being said, from what you describe, I'm thinking session 
without hesitation.  Not much data, your entire process takes a couple 
of steps then some final result (which may be more permanently 
persisted, I don't know)... Session coding will be very easy, and 
unless your going to have a huge load, there shouldn't be any 
problem.  Only you know all the details though, so you'll have to make 
the real determination.


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


RE: Exposing ActionForm and MVC fields

2004-10-16 Thread Leandro Melo
Well, i actually end up doing the update only on the
required fields on my ejb layer. This way, i don't
need to worry about the exposure of the ActionForm
fields.



 --- Freddy Villalba A. [EMAIL PROTECTED]
escreveu: 
 Hi,
 
 
 I believe you shouldn't abuse neither from the MVC
 pattern or the Struts'
 framework. All the issues regarding buyer's actions
 as well as seller's are
 part of an specific area: workflow management.
 
 Implement a basic WF Management subsystem (or
 integrate one into your
 application), define the roles (buyer / seller /
 whatever...), the actions
 (along with the corresponding pre- and post-), the
 nodes, etc... and yes,
 have your presentation layer (Struts) integrate with
 it. I know it's not
 simple or cheap... yet, I'm almost convinced that,
 at the end, it would've
 been a good investment for you and your project.
 
 Save yourself from trying to convert Struts into an
 all-mighty-god-who-knows-and-solves-everything tool.
 
 For me, that's the bottom-line for all these issues.
 
 Again, just my oppinion. HTH.
 
 Cheers,
 Freddy.
 
 
 -Mensaje original-
 De: David Suarez [mailto:[EMAIL PROTECTED]
 Enviado el: viernes, 15 de octubre de 2004 17:06
 Para: [EMAIL PROTECTED]; Struts Users Mailing List
 Asunto: RE: Exposing ActionForm and MVC fields
 
 
 How about creating a hash/digest when you send the
 page down with your
 read-only fields and save it to session/hidden (you
 know the +/-), then
 compare it on the re-submit to see if any of the
 values have changed.
 If so, throw SecurityException or something similar?
 
 Would that work for you...djsuarez
 
 -Original Message-
 From: Lee Harrington [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 15, 2004 8:52 AM
 To: Struts Users Mailing List
 Subject: Re: Exposing ActionForm and MVC fields
 
   In this case, i`m still suceptible to be
  hacked by javascript, because of the ActionForm
 fields
  exposure.
  What about that???
 
 Different actions.  I'd reccomend a dispatch action
 class...with
 different methods depending on whether the buyer or
 seller submitted.
 That way, in the seller method, even if they did
 hack the submit form
 you action would not be doing anything with those
 fields.
 
 Lee
 
 

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



Help ! Question regarding Action and Form Bean!

2004-10-16 Thread t t
Hi,all,

My action is triggered in one jsp file, and will end
up in another JSP file, both have a form bean inside.
And the action has to deal with both form beans. 
Question: How can I associate both form bean to one
action? 
Thanks in advance!

Tong



__
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: Help ! Question regarding Action and Form Bean!

2004-10-16 Thread Joe Hertz
It would help if you described this in more detail. I hope this explains it
for you.

If you have a JSP that submits a form using html:form, you have to have
that action associated to that form, otherwise you will get an exception
when that JSP is loaded.

If you have a JSP that wants to display data in a form bean (or any other
bean really) but doesn't need to submit it to an action, you don't need to
do anything special. You can generate the data your action and pass it to
the JSP using request.setAttribute(String, Object). Your JSP just needs to
refer to it by the name you passed into it. I often use formBeans for this
purpose just because DynaBeans are easy to define, and with Hubert Rabago's
FormDef plugin, it's pretty trivial to get DynaForm beans instantiated and
populated with exactly what I need on the display side.

 -Original Message-
 From: t t [mailto:[EMAIL PROTECTED]
 Sent: Saturday, October 16, 2004 7:36 PM
 To: [EMAIL PROTECTED]
 Subject: Help ! Question regarding Action and Form Bean!


 Hi,all,

 My action is triggered in one jsp file, and will end
 up in another JSP file, both have a form bean inside.
 And the action has to deal with both form beans.
 Question: How can I associate both form bean to one
 action?
 Thanks in advance!

 Tong



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



Help ! Question regarding Action and Form Bean(in detail )!

2004-10-16 Thread t t

Hi, Joe,
Thank you for your answer.Let me describe it in
detail. I have two jsp files, let me name them j1 and
j2.j1 has form f1, and j2 f2. In f2, there is a
checkbox. f1 triggers an action (a1) which will look
at the data in f1 and end up in j2. Currently, I let
a1 associate f1, and forward to another action a2, a2
associate with f2. But the server always says no
getter mathod for the checkbox. But there is a getter
method in form bean f2.
Any help will be appreciated!

tong

--- Joe Hertz [EMAIL PROTECTED] wrote:

 It would help if you described this in more detail.
 I hope this explains it
 for you.
 
 If you have a JSP that submits a form using
 html:form, you have to have
 that action associated to that form, otherwise you
 will get an exception
 when that JSP is loaded.
 
 If you have a JSP that wants to display data in a
 form bean (or any other
 bean really) but doesn't need to submit it to an
 action, you don't need to
 do anything special. You can generate the data your
 action and pass it to
 the JSP using request.setAttribute(String, Object).
 Your JSP just needs to
 refer to it by the name you passed into it. I often
 use formBeans for this
 purpose just because DynaBeans are easy to define,
 and with Hubert Rabago's
 FormDef plugin, it's pretty trivial to get DynaForm
 beans instantiated and
 populated with exactly what I need on the display
 side.
 
  -Original Message-
  From: t t [mailto:[EMAIL PROTECTED]
  Sent: Saturday, October 16, 2004 7:36 PM
  To: [EMAIL PROTECTED]
  Subject: Help ! Question regarding Action and Form
 Bean!
 
 
  Hi,all,
 
  My action is triggered in one jsp file, and will
 end
  up in another JSP file, both have a form bean
 inside.
  And the action has to deal with both form beans.
  Question: How can I associate both form bean to
 one
  action?
  Thanks in advance!
 
  Tong
 
 
 
  __
  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]
 
 


__
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: logic:iterate and table display

2004-10-16 Thread Erik Weber
Unfortunately, the Struts documentation isn't much help this department 
(unless I'm missing something), except that I think it tells you which 
Struts tags *don't* support the EL.

But this page ought to help:
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL4.html
There is also a blurb about using the EL in the Struts FAQ entry on 
indexed properties.

If you look in your Struts distribution, you'll see the EL-related stuff 
in the contrib directory. You use the Struts EL tags the same way as you 
use the regular Struts tags (except you use the EL instead of using the 
old-fashioned runtime expression language).

For example:
bean-el:size collection=${someBean.someCollection} id=numItems/
This Struts tag assumes there is a bean called someBean which exposes 
a collection via the no-arg method getSomeCollection. It makes the 
size of the collection available via the numItems variable, which can 
be used subsequently like this, for example:

c:when test=${numItems  0}/
There may be more efficient ways to do the same thing, but this gives 
you an example of a Struts tag and a JSTL tag that each use the EL.

I recommend the book JSTL by Sue Spielman (Morgan Kaufmann, 
0-12-656755-7). It's only $20 new and worth it. It discusses the JSTL 
tags and the EL in depth and is based on example. I have found that 
using a combination of the Struts tags and JSTL tags made my JSPs the 
nicest, but I think there's not much the Struts tags do that the JSTL 
tags can't do.

Hope that helps,
Erik

Vijay Vishvas Dharap wrote:
Can you tell how to use EL code.
Am kind of newbie to Struts and and not much aware of EL tags.
But my containier is only JSP 1.2
Also I am using struts 1.1
-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 16, 2004 7:57 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate and table display

Vijay Vishvas Dharap wrote the following on 10/15/2004 9:41 PM:
 

Hi all,
I have following scenario.. 
I have FormBean which has getter and setter for my VO object

In VO I have a list of another VO.
Now on this form I want to display the contents of the list using
logic.iterate tags.
I will make matter simpler saying...
aFormBean has aVO which as list of bVO. bVO has attributes like xAttr,
yAttr, zAttr.
now aForm should show on the page table where contents of list of bVO
will be giving one one row of the table.
   

You can do this with struts logic and bean:write,I'm used to JSTL so 
here it is...

c:forEach items=${yourFormName.aVo.bVOlist} var=bVOitem
c:out value='${bVOitem.xAttr}'/
%-- or JSP2.0 just ${bVOitem.xAttr} --%
c:out value='${bVOitem.yAttr}'/
/c:forEach
with logic iterate within your html:form tags (I 'think' this is
right?)
//use the EL struts tags if not using JSP2.0 Container
logic:iterate property=aVo.bVOlist id=bVOitem
bean:write name=bVOitem property=xAttr/
bean:write name=bVOitem property=yAttr/
/logic:iterate
Obviously you would surround the above with table tags etc. Or you could
also use the display tag (search google or archives) that will do this 
for you.

 

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


RE: Help ! Question regarding Action and Form Bean(in detail )!

2004-10-16 Thread Joe Hertz
What you want is for A1 to forward to J2. Not A2.

J2 will display and then submit F2 to A2.

Forwarding from one action to another is almost always bad (Okay, I admit
that I've done it in some cases where I *know* the Action won't ever care
about the request parameters. This clearly isn't one of those cases.)

-Joe


 Hi, Joe,
 Thank you for your answer.Let me describe it in
 detail. I have two jsp files, let me name them j1 and
 j2.j1 has form f1, and j2 f2. In f2, there is a
 checkbox. f1 triggers an action (a1) which will look
 at the data in f1 and end up in j2. Currently, I let
 a1 associate f1, and forward to another action a2, a2
 associate with f2. But the server always says no
 getter mathod for the checkbox. But there is a getter
 method in form bean f2.
 Any help will be appreciated!

 tong

 --- Joe Hertz [EMAIL PROTECTED] wrote:

  It would help if you described this in more detail.
  I hope this explains it
  for you.
 
  If you have a JSP that submits a form using
  html:form, you have to have
  that action associated to that form, otherwise you
  will get an exception
  when that JSP is loaded.
 
  If you have a JSP that wants to display data in a
  form bean (or any other
  bean really) but doesn't need to submit it to an
  action, you don't need to
  do anything special. You can generate the data your
  action and pass it to
  the JSP using request.setAttribute(String, Object).
  Your JSP just needs to
  refer to it by the name you passed into it. I often
  use formBeans for this
  purpose just because DynaBeans are easy to define,
  and with Hubert Rabago's
  FormDef plugin, it's pretty trivial to get DynaForm
  beans instantiated and
  populated with exactly what I need on the display
  side.
 
   -Original Message-
   From: t t [mailto:[EMAIL PROTECTED]
   Sent: Saturday, October 16, 2004 7:36 PM
   To: [EMAIL PROTECTED]
   Subject: Help ! Question regarding Action and Form
  Bean!
  
  
   Hi,all,
  
   My action is triggered in one jsp file, and will
  end
   up in another JSP file, both have a form bean
  inside.
   And the action has to deal with both form beans.
   Question: How can I associate both form bean to
  one
   action?
   Thanks in advance!
  
   Tong
  
  
  
   __
   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]
 
 


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



Where is the html:label tag???

2004-10-16 Thread Leandro Melo
Hi,
what is the reason for not having a html:label tag?

Leandro.





___ 
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! 
http://br.acesso.yahoo.com/

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


Re: Where is the html:label tag???

2004-10-16 Thread Craig McClanahan
'Cause nobody ever thought about it and proposed it?  :-)

Actually, I'm not sure how much value add there would really be, since
you can already do things like:

  label for=...bean:message ...//label

to create a localized field label.

Craig

On Sat, 16 Oct 2004 16:44:41 -0300 (ART), Leandro Melo
[EMAIL PROTECTED] wrote:
 Hi,
 what is the reason for not having a html:label tag?
 
 Leandro.
 
 
 ___
 Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! 
 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]