Re: Dynaform Type Conversion

2004-03-25 Thread Hubert Rabago
It does for the nightly build and Struts 1.2.0, though I can't recall the
name of the method.  For pre-1.2, you'll need to write code to do that. 
There was a thread that discussed this, with the last few messages (of that
thread) still coming in today.  Just look for that.  Richard Yee pasted code
there on how to instantiate a Dyna Bean.  I also pointed to an archive where
I pasted the code I use in my apps to instantiate a Dyna Bean. 

--- Joe Hertz <[EMAIL PROTECTED]> wrote:
> Well, I was using copyProperties...or rather I\'d want to. I\'m just trying
> 
> to 
> avoid having to declare my Transfer Objects the hard way.
> 
> Say I use Mark Lowe\'s idea of the Nested Form Bean (makes sense in alot of
> 
> ways), but I want to do it dynamically. i.e. DynaForm A has a List property
> 
> of what will be a bunch of DynaBean B\'s.
> 
> So riddle me this, how do I instantiate a DynaBean myself as it is defined
> in 
> the struts-config.xml?  When it\'s passed in to the Action as the form,
> it\'s 
> all prepped and ready to go. If I instantiate an instance of the class 
> myself, it\'s got no dynaproperties. I know BeanUtils will provide 
> functionality to do this, but I would hope there\'s an exposed method that 
> does based straight out of the contents struts-config.
> 
> Does Struts provide a method where I provide it the name of the bean
> defined 
> in the struts-config.xml and it return me an instance of the appropriate 
> class, with all the dyna properties set up?
> 
> -Joe
> 
> > -Original Message-
> > From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, March 25, 2004 8:38 AM
> > To: Struts Users Mailing List
> > Subject: Re: DynaForm Type Conversion
> > 
> > 
> > Take a look at BeanUtils.copyProperties.  By default, though, 
> > it doesn\'t support conversion of dates, since it wouldn\'t 
> > know how you\'d want your dates formatted.  Check the archives 
> > of this list, there\'s been some discussion on that.  Another 
> > archive you can check is that of the commons-user list.
> > 
> > If you\'re looking for further reduction in code, take a look 
> > at http://www.rabago.net/struts/formdef which I\'m working on. 
> >  It\'s alpha, but an initial release is coming real soon (and 
> > I\'m looking for folks to help me develop/maintain it).
> > 
> > I believe the Struts dev team has plans to include 
> > functionality like this in a future version of Struts.  For 
> > now, we either make do with BeanUtils, or do the conversion 
> > ourselves, or through third party plugins like what I\'m 
> > working on.  If you feel strongly enough about it, you can 
> > rant some more on 
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321 
> > though like I said, the dev team has plans for supporting 
> > this functionality in a future version.  How near or far into 
> > the future might be influenced by user requests.  :)
> > 
> > 
> > --- Joe Hertz <[EMAIL PROTECTED]> wrote:
> > > 
> > > I have a bean I persist with Hibernate. It\'s properties are:
> > > 
> > > 2 Floats
> > > 1 Integer (the key)
> > > 2 Dates
> > > 
> > > Now, relying on my handy dandy copies of Struts KickStart, 
> > Struts In 
> > > Action, and all of the Web, I\'m apparently supposed to 
> > declare these 
> > > methods in the
> > > 
> > > Form I am using as Strings since automatic type conversion 
> > can fubar 
> > > them.
> > > 
> > > But Since the JSP I am using is getting these fields with html:text 
> > > fields, I apparently am supposed to have methods in form to do the 
> > > type conversion for
> > > me. Okay, that\'s light years better than putting this in 
> > the business
> > > layer, 
> > > but fine.
> > > 
> > > Is there an Automatic way I can get a DynaBean to do this for me? 
> > > Maybe a Get (prop, type) and get(prop, type, value) for the 
> > types youd 
> > > find in java.lang?
> > > 
> > > If not, there should be, because it limits what a DynaBean 
> > can do in a 
> > > big
> > > kinda way. Why have a type declaration in the DTD if youre 
> > only ever going
> > > to 
> > > want to use String and String[] ? :-)
> > > 
> > > I mean, it\'s not like I couldnt add such a set of methods to my
> > > DynaValidatorActionForm subclass, but what I\'d want 

Re: DynaForm Type Conversion

2004-03-25 Thread Hubert Rabago
Take a look at BeanUtils.copyProperties.  By default, though, it doesn't
support conversion of dates, since it wouldn't know how you'd want your dates
formatted.  Check the archives of this list, there's been some discussion on
that.  Another archive you can check is that of the commons-user list.

If you're looking for further reduction in code, take a look at
http://www.rabago.net/struts/formdef which I'm working on.  It's alpha, but
an initial release is coming real soon (and I'm looking for folks to help me
develop/maintain it).

I believe the Struts dev team has plans to include functionality like this in
a future version of Struts.  For now, we either make do with BeanUtils, or do
the conversion ourselves, or through third party plugins like what I'm
working on.  If you feel strongly enough about it, you can rant some more on
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27321 though like I said,
the dev team has plans for supporting this functionality in a future version.
 How near or far into the future might be influenced by user requests.  :)


--- Joe Hertz <[EMAIL PROTECTED]> wrote:
> 
> I have a bean I persist with Hibernate. It's properties are:
> 
> 2 Floats
> 1 Integer (the key)
> 2 Dates
> 
> Now, relying on my handy dandy copies of Struts KickStart, Struts In
> Action, 
> and all of the Web, I'm apparently supposed to declare these methods in the
> 
> Form I am using as Strings since automatic type conversion can fubar them.
> 
> But Since the JSP I am using is getting these fields with html:text fields,
> I 
> apparently am supposed to have methods in form to do the type conversion
> for 
> me. Okay, that's light years better than putting this in the business
> layer, 
> but fine.
> 
> Is there an Automatic way I can get a DynaBean to do this for me? Maybe a
> Get
> (prop, type) and get(prop, type, value) for the types youd find in
> java.lang?
> 
> If not, there should be, because it limits what a DynaBean can do in a big 
> kinda way. Why have a type declaration in the DTD if youre only ever going
> to 
> want to use String and String[] ? :-)
> 
> I mean, it's not like I couldnt add such a set of methods to my 
> DynaValidatorActionForm subclass, but what I'd want is for the framework to
> 
> use them for me without me needing to know about it. (I dont ask for much,
> do 
> I???).
> 
> If not, I'd like to continue to use my Subclassed DynaValidatorActionForm 
> anyway, but I am wondering if it is going to be self-defeating to declare 
> custom getters and setters for properties that are declared in struts
> config? 
> Should I just use it as a non-dyna form?
> 
> Maybe I've been up too late (okay, I have) but it's the little things like 
> this that makes me feel like Struts is creating work for me rather than 
> saving me from it. 
> 
> 
> Tx for indulging my sleepy rant.
> -Joe
> 
> 

__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: redirect="true" and Tiles; does it work?

2004-03-24 Thread Hubert Rabago
> > And you're saying that with
> > "http://localhost:8080/test/showInvalidTokenMessage.do"; on the address
> bar,
> > the user clicks on refresh and causes TestProcessAction to execute again?
> 
> TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between
> these messages I thought I should give IE try and on IE 6.0.2800 the action
> is not called neither do I see the confrimation message of posting again!
> 
> Boils down to Browser?

That's the way I see it.  My interpretation of how it should work is the
browser should refresh the last request, and the server already told the
browser to request "/showInvalidTokenMessage.do" and in fact that's what's on
the address bar.  If my interpretation is incorrect, somebody please let me
know.  If this is a browser bug, maybe it's time to upgrade to Firefox 0.8.

,
Hubert

--- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> See inline, please.
> 
> - Original Message - 
> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 24, 2004 3:56 PM
> Subject: Re: redirect="true" and Tiles; does it work?
> 
> 
> > Is this correct?
> >
> > 1. User submits the form to /processTest.do
> 
> TRUE.
> >
> > 2. The action for /processTest.do, TestProcessAction, sees that the token
> is
> > invalid and returns an ActionForward that redirects to
> > /showInvalidTokenMessage.do
> 
> Actually to mapping.findForward("invalidToken") which is global forward to
> /showInvalidTokenMessage.do. So I assume the answer is TRUE; though i'm not
> sure.
> 
> >
> > 3. "/showInvalidTokenMessage.do" forwards to the
> "invalidTokenMessageTile"
> > tile, at which time the browser shows
> > "http://localhost:8080/test/showInvalidTokenMessage.do"; on the address
> bar
> 
> TRUE.
> 
> >
> > 4. The user sees the "invalidTokenMessageTile" tile and clicks on refresh
> >
> > And you're saying that with
> > "http://localhost:8080/test/showInvalidTokenMessage.do"; on the address
> bar,
> > the user clicks on refresh and causes TestProcessAction to execute again?
> 
> TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between
> these messages I thought I should give IE try and on IE 6.0.2800 the action
> is not called neither do I see the confrimation message of posting again!
> 
> Boils down to Browser?
> 
> >
> >


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: redirect="true" and Tiles; does it work?

2004-03-24 Thread Hubert Rabago
Is this correct?

1. User submits the form to /processTest.do

2. The action for /processTest.do, TestProcessAction, sees that the token is
invalid and returns an ActionForward that redirects to
/showInvalidTokenMessage.do

3. "/showInvalidTokenMessage.do" forwards to the "invalidTokenMessageTile"
tile, at which time the browser shows
"http://localhost:8080/test/showInvalidTokenMessage.do"; on the address bar

4. The user sees the "invalidTokenMessageTile" tile and clicks on refresh

And you're saying that with
"http://localhost:8080/test/showInvalidTokenMessage.do"; on the address bar,
the user clicks on refresh and causes TestProcessAction to execute again?


--- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> http://localhost:8080/test/processTest.do
> 
> and if and press Refresh here the url changes to:
> http://localhost:8080/test/showInvalidTokenMessage.do
> 
> ATTA
> - Original Message - 
> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 24, 2004 3:07 PM
> Subject: Re: redirect="true" and Tiles; does it work?
> 
> 
> >
> > --- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> > > TestProcessAction just forwards to "success" forward. But before it
> does
> > > that it check for the valid token and in the case of an invalid token
> it
> > > just forwards (redirects) to the "invalidToken" global forward.
> > >
> > > On invalid token message press refresh again calls the test action with
> the
> > > browser confirmation.
> >
> > After the redirect and before pressing refresh, what's the URL shown on
> the
> > browser?


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: redirect="true" and Tiles; does it work?

2004-03-24 Thread Hubert Rabago

--- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> TestProcessAction just forwards to "success" forward. But before it does
> that it check for the valid token and in the case of an invalid token it
> just forwards (redirects) to the "invalidToken" global forward.
> 
> On invalid token message press refresh again calls the test action with the
> browser confirmation.

After the redirect and before pressing refresh, what's the URL shown on the
browser?


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: redirect="true" and Tiles; does it work?

2004-03-24 Thread Hubert Rabago

--- atta-ur rehman <[EMAIL PROTECTED]> wrote:
> Any takers?
> 

I'll give it a shot.

> ATTA
> 
> - Original Message - 
> From: "atta-ur rehman" <[EMAIL PROTECTED]>
> 
> > 
> >  > redirect="true" />
> > 

I believe the path should begin with "/".  This should mean you have an
 somewhere in the same module.

> >
> > 
> > 
> > 
> >

Are you using this "success" forward as well?  You're redirecting to a tile
definition?  Not sure how that would work.

> > Its from within the test.TokenAction that I forward to global forward
> > "invalidToken".
> >
> > Again, thanks in anticipation for any help.
> >
> > ATTA


Hubert


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: Basic question about ActionForms

2004-03-24 Thread Hubert Rabago
Marco,

This could be caused by how your mappings are configured.  If you can send
more information, someone might spot the cause.

Hubert

--- Marco Mistroni <[EMAIL PROTECTED]> wrote:
> Hi all,
>   In my app I am using a  DynaActionForm with scope = session.
> When I am calling the action for the first time, obviously the 
> Form is 'emtpy', so I populate it with all the values..
> When I am redirected to the action class again, the actionform
> Should be in the session (in theory).
> However, what is in the session looks like an 'empty' actionform as it
> Was before.
> Now the question: if my actionform has scope of session, do I have to 
> Put the value in the session explicitly or struts will do it for me?
> 
> 
> IT LOOKS like all the values are erased all the time, no matter if I
> have
> Specified as scope session..
> 
> Anyone has any clues of what's going on?
> 
> Regards   
>   marco
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: pre-populating DynaValidatorForm

2004-03-23 Thread Hubert Rabago
See http://www.mail-archive.com/[EMAIL PROTECTED]/msg96035.html

hth,
Hubert

--- "Dean A. Hoover" <[EMAIL PROTECTED]> wrote:
> I am using struts 1.1, and I am directly instantiating a 
> DynaValidatorForm in
> my Action class. I am hesitant to embrace struts 1.2 at this time, 
> especially if
> the difference between 1.1 and 1.2 is as large as betwee 1.0 and 1.1. Is 
> there
> some other way to accomplish it?
> 
> Dean Hoover
> 
> Hubert Rabago wrote:
> 
> >What version of Struts are you using?  How are you instantiating your
> >Dyna*Form?  Struts 1.1 didn't really have direct support for instantiating
> >DyanForms from an Action object.  Struts 1.2.0/nightly build does.  Is it
> >possible that you're using 1.1 and instantiating the form incorrectly?  
> >
> >  
> >


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: pre-populating DynaValidatorForm

2004-03-23 Thread Hubert Rabago
What version of Struts are you using?  How are you instantiating your
Dyna*Form?  Struts 1.1 didn't really have direct support for instantiating
DyanForms from an Action object.  Struts 1.2.0/nightly build does.  Is it
possible that you're using 1.1 and instantiating the form incorrectly?  

--- "Dean A. Hoover" <[EMAIL PROTECTED]> wrote:
> I am using DynaValidatorAction and
> it works just fine, when starting "clean".
> However, when I attempt to pre-populate
> the object, the data never makes it to the
> form. Anyone know why? What follows
> is some snippets of files that should show
> what I am doing.
> 
> === struts-config.xml
> 
>  Struts Configuration 1.0//EN" 
> "http:/jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
> 
> 
>   
> 
> type="org.apache.struts.validator.DynaValidatorForm">
> type="java.lang.String"/>
> ...
> 
> ...
>   
> 
> 
> 
> ...
> 
> ...
>   
> 
>   
> ...
> 
>  type="fi.els.action.ChangeContactInfoSetup">
>   
>   
>   
> 
> 
>  type="org.apache.struts.actions.ForwardAction"
> parameter="tiles.changeContactInfo"/>
> 
>  type="fi.els.action.ChangeContactInfo"
> name="changeContactInfo"
> validate="true"
> input="tiles.changeContactInfo"
> parameter="method">
>   
>   
> 
> ...
>   
> ...
>   
>value="/WEB-INF/validator-rules.xml,
>  /WEB-INF/validation.xml"/>
>   
> 
> 
> === validation.xml
> 
>   
> ...
> 
> 
> depends="required,maxlength">
> 
> 
> 
>   maxlength
>   24
> 
>   
> ...
> 
>   
> 
> === ChangeContactInfoSetup.java
> package fi.els.action;
> ...
> public class ChangeContactInfoSetup extends Action
> {
> public ActionForward execute
> (
>   ActionMapping mapping,
>   ActionForm form,
>   HttpServletRequest request,
>   HttpServletResponse response
> ) throws Exception
> {
> User user = (User)request.getSession().getAttribute("user");
> 
> Connection connection = null;
> 
> try
> {
> DynaValidatorForm vForm = new DynaValidatorForm();
> ...
> connection = dataSource.getConnection();
> Client client = Client.load(connection, user.getId());
> ContactInfo contactInfo = client.getContactInfo();
> vForm.set("contactInfoWidgetsSubFormFirstName",
>  (contactInfo.getFirstName() != null) ?
>  contactInfo.getFirstName() : "");
> ...
> request.getSession().setAttribute("changeContactInfo", vForm);
> return mapping.findForward("success");
> }
> ...
> }
> }
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



RE: DynaActionForm caching issues?

2004-03-23 Thread Hubert Rabago
In my experience, it's not that the bean config is cached, it's that the form
itself is cached.  If your bean is not in request scope, it gets reused. 
Tomcat can keep a session alive between application and server restarts and
so your form can survive those.  What I've done when I modify my dyna forms
is to invalidate any existing sessions I have before proceeding with my
testing.

--- "Norris, David A. ERDC-CERL-IL Contractor"
<[EMAIL PROTECTED]> wrote:
> Note: JBoss 3.2.3 includes an integrated Tomcat 4.1.29, which is of course
> more likely to be relevant to this problem than JBoss itself...
> 
> 
> > -Original Message-
> > From: Norris, David A. ERDC-CERL-IL Contractor 
> > [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, March 22, 2004 4:45 PM
> > To: [EMAIL PROTECTED]
> > Subject: DynaActionForm caching issues?
> > 
> > 
> > Hello,
> > 
> > This message is in response to Geeta Ramani's post on March 4 
> > entitled "DynaActionForm IllegalArgumentException."
> > 
> > In short, I have a DynaActionForm defined in 
> > struts-config.xml. It's been around for a while, but I find 
> > that each time I make a change to it (for instance, adding a 
> > new property), I run into the same IllegalArgumentException 
> > (at the same file and line number) that Geeta described. I 
> > can work around the issue by undeploying my application, 
> > stopping my application server entirely (JBoss 3.2.3 on 
> > Linux), and then restarting and redeploying.
> > 
> > Is it possible that there are some caching issues, where 
> > Struts saves its configured DynaActionForms somewhere in the 
> > application server's memory and then doesn't realize it has 
> > to refresh that information when struts-config.xml changes?
> > 
> > Interestingly, the Struts and all Commons jar files are kept 
> > inside my application's war file, and are not stored in 
> > JBoss's shared library directory. I would think this would 
> > ensure a complete Struts reload upon each deployment, but it 
> > seems that is not the case.
> > 
> > I'm using Struts 1.1 final and the Commons jars included in 
> > that distribution. I have JBoss 3.2.3 running on Linux with 
> > Sun's j2sdk 1.4.2_04.
> > 
> > Thanks in advance for any suggestions,
> > --
> > David Norris
> > [EMAIL PROTECTED]
> > 
> 


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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



Re: Dummy ActionForms?

2004-03-19 Thread Hubert Rabago
The ClassCastException is in your Action code, so check your code and see
what you're casting.  Post the code so others can see, too.

--- Theodosios Paschalidis <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I am trying to execute an Action using only a dummy form (empty). I have
> successfully used this in other occasions but it seems to fail now.
> In my config I have
>  
>  
>  
> 
> 
>   name="closeOrderForm" scope="request" validate="false"
> input="/DisOrderDetail.jsp">
>
>  
>  parameter="/FindOrder.jsp" />
> But I get this exception thrown:
> 
> java.lang.ClassCastException
>   at app.CloseOrderAction.execute(Unknown Source)
>   at
>
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
> sor.java:446)
>   at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
> 
> I though it might have been the Input that messed things so i changed that
> as follows with no luck.
> 
> I am getting frustrated over this, am I missing something? I would be
> gratefull is somebody could give a hint on what the problem might be.
> 
> Thank you for your time,
> Theo
> 
> 
> name="closeOrderForm">
>
> 
>  
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: Struts cookbook

2004-03-18 Thread Hubert Rabago
Yup, sounds like something that the StrutsProjectPages can already fulfill.
:)

--- Andy Engle <[EMAIL PROTECTED]> wrote:
> Hubert Rabago <[EMAIL PROTECTED]> wrote:
> 
> > I've had this idea for months now and actually had some entries
> > already written (with full web apps to illustrate) and I've also
> > started collecting cookbook entries from responses to this mailing
> > list.
> 
> Ahh ok, good deal.
> 
> 
> > So yes, I'm interested and would certainly participate.  What did you
> > have in mind?
> 
> I thought it would be best if it is easy to use.  So, the index page
> would be an index, but more like a table of contents.  Everything would
> be broken down into sections, and then beneath each section would be
> the recipes that would be placed in that section, all of which would be
> links to the recipes.
> 
> 
> > Where do you plan to host this?
> 
> I have some space where we can host it.
> 
> 
> > What would the interface be?
> 
> Well, nothing more than HTML and perhaps a few graphics here and there
> to make it look decent.  But not too decent; this is, after all, a
> technical web site. :)
> 
> 
> > Would it contain just code samples or would there be some way to
> > also attach actual files/classes?
> 
> I thought it best to just have source code, and then perhaps a "links"
> page where visitors could go to download materials, such as a link to
> the Struts page, a link to reumann.net, and so on.  I really want to
> focus on the ease of use and usefulness aspects of the site. 
> 
> As far as receiving material is concerned, perhaps that could be best
> accomplished by a page with a form on it where we could collect the
> author's name, e-mail address, topic, and then a textarea where they
> could write their recipe.  From there, we'd receive it and simply post
> it onto the site, hopefully with very little/no editing involved.  When
> the recipe(s) are posted, the author's name will be included at the top
> of the page, along with maybe some sort of optional method to contact
> the author.
> 
> 
> Andy
> 
> 

__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: Struts cookbook

2004-03-18 Thread Hubert Rabago

--- Nick Heudecker <[EMAIL PROTECTED]> wrote:
> Wouldn't this be a great use of the (already existing) Struts Wiki?

That's right.  I don't think it supports attachments, though.  I really got
started thinking this way because I was thinking of a personal repository of
struts extensions I use in all my projects.  It started from that to a more
generic cookbook, and that's why the "attachments" remained in my mind
whenever I thought about it.

Of course from there it (in my mind) it grew to a cookbook containing helpful
code samples not just for Struts, but for other frameworks and libraries as
well, such as JSTL.  

Hubert

> On 2004-Mar-18 13:03, Hubert Rabago wrote:
> > I've had this idea for months now and actually had some entries already
> > written (with full web apps to illustrate) and I've also started
> collecting
> > cookbook entries from responses to this mailing list.  I was in the
> process
> > of writing the app to hold them late last year but got sidetracked.  
> > 
> > So yes, I'm interested and would certainly participate.  What did you
> have in
> > mind?  Where do you plan to host this?  What would the interface be? 
> Would
> > it contain just code samples or would there be some way to also attach
> actual
> > files/classes?
> > 
> > Hubert
> > 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: Struts cookbook

2004-03-18 Thread Hubert Rabago
I've had this idea for months now and actually had some entries already
written (with full web apps to illustrate) and I've also started collecting
cookbook entries from responses to this mailing list.  I was in the process
of writing the app to hold them late last year but got sidetracked.  

So yes, I'm interested and would certainly participate.  What did you have in
mind?  Where do you plan to host this?  What would the interface be?  Would
it contain just code samples or would there be some way to also attach actual
files/classes?

Hubert


--- Andy Engle <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I am a huge fan of O'Reilly's "cookbooks", which seem to contain a good
> deal of useful material for doing all sorts of different things.  Today
> I thought about the idea of making a Struts cookbook, although two
> things would be different from how O'Reilly does it:
> 
> 1. It wouldn't be a published book, but rather a web site, and
> 2. I'm not going to be writing all of it
> 
> With that in mind, I would like to ask all of you (who I have received
> some excellent advice from, by the way) if any of you would be
> interested in contributing material to such a web site.  I simply don't
> have the time or experience to come up with everything, but I'm sure
> that collectively we could put something together that could be pretty
> slick.  I could easily host the site, and perhaps simply organize all
> of the information I receive from you.  I appreciate all the
> information already available with Struts, but I also like it when I
> can simply "look it up" and be done with it.
> 
> I would like to see recipes posted there that cover everything from how
> to do stuff with tags, iBatis, tiles, and whatever else.  Even delving
> into other stuff like web services and how that ties in with Struts
> would be good.  I don't want to focus so much on concept as I would
> simply how to get something done quickly and easily.
> 
> What do you think?  Good idea?  Dumb idea?  I'm interested in your
> thoughts on such a thing.  Looking forward to hearing from you.
> 
> 
> Regards,
> Andy


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



RE: Hierarchical Lists

2004-03-17 Thread Hubert Rabago
If you just wanna do it using Javascript, then I can share with you something
I've used before.  I uploaded them here:

http://www.rabago.net/select/select.htm - has three levels.  The javascript
code is commented so you can follow what it does (in case you're not that
familiar with js)
http://www.rabago.net/select/simpler.htm - shows the same code but with only
two levels of data

Both of these require that you have all the needed data when the page shows. 
If you need to make a call to the server to get the data once a filter item
has been selected, check the link I sent earlier.

hth,
Hubert

--- "Scherger, Derek" <[EMAIL PROTECTED]> wrote:
> You might use something like 
> 
> ...
> 
> ... 
> ... 
> ... 
> ... 
> 
> Then in the onchange event of the parent-list you can call a javascript
> function that would do 
> 
>   list = document.getElementById(child)
>   list.style.display="";  // show list
>   list.style.display="none";  // hide list
> 
> as required.
> 
> You'll have to set the proper list to be visible when the page first loads
> and you'll have to keep track of which list is currently visible (in
> javascript) so that you can toggle it off and the next one on.
> 
> This type of thing seems to be working pretty well for me at the moment,
> although I haven't done exactly this.
> 
> Let mw know how it works out.
> 
> Cheers,
> Derek
> 
> 
> -Original Message-
> From: Randy Dillon [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 17, 2004 2:46 PM
> To: Struts Users Mailing List
> Subject: RE: Hierarchical Lists
> 
> 
> Derek,
> 
> That's an interesting concept.  My CSS skills are pretty basic though.  How
> could you use CSS to do it?  Would it work if the first list was
> multi-select with many different possible combinations?
> 
> :-> -Original Message-
> :-> From: Scherger, Derek [mailto:[EMAIL PROTECTED]
> :-> Sent: Wednesday, March 17, 2004 3:32 PM
> :-> To: 'Struts Users Mailing List'
> :-> Subject: RE: Hierarchical Lists
> :-> 
> :-> 
> :-> I've though of (but not done) the possibility of using css 
> :-> to hide and show
> :-> different versions of the second select list rather than 
> :-> adding/removing
> :-> elements with javascript. Not sure which would be a better 
> :-> way to go as they
> :-> both will require some scripting. The css hide/show 
> :-> version's script is
> :-> pertty trivial though.
> :-> 
> :-> Cheers,
> :-> Derek
> :-> 
> :-> -Original Message-
> :-> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> :-> Sent: Wednesday, March 17, 2004 12:54 PM
> :-> To: [EMAIL PROTECTED]
> :-> Subject: RE: Hierarchical Lists
> :-> 
> :-> 
> :-> Short of a reload, I believe only a JavaScript/DHTML 
> :-> function can provide
> :-> this behavior.
> :-> 
> :-> 
> :-> -Original Message-
> :-> From: Randy Dillon [mailto:[EMAIL PROTECTED]
> :-> Sent: Wednesday, March 17, 2004 2:48 PM
> :-> To: Struts Users Mailing List
> :-> Subject: Hierarchical Lists
> :-> 
> :-> 
> :-> Say I have 2 (or more) lists that are part of a hierarchy, 
> :-> such that the
> :-> first list is a category (say Food Groups) and the second 
> :-> list contains
> :-> children of each of the first list's items (for this 
> :-> example, let's say Food
> :-> Types).  
> :-> 
> :-> How do I get the second list to be filtered based on the 
> :-> selection in the
> :-> first list?  I know this can be done by reloading the page 
> :-> each time the
> :-> selection is changed in the first list, but is there a way 
> :-> to do this
> :-> without the page reload?
> :-> 
> :-> To add more detail to the example:
> :-> 
> :-> Food Groups   Food Types
> :-> ---   --
> :-> Meat&DairyBeef
> :->   Chicken
> :->   Milk
> :->   Eggs
> :-> Fruit&Veg Melons
> :->   Apples
> :->   Oranges
> :->   Lettuce
> :-> .   . 
> :-> .   .
> :-> .   .
> :-> 
> :-> If Meat&Dairy is selected in the Food Groups list, can the 
> :-> second Food Types
> :-> list be filtered to only the Meat&Dairy food types without 
> :-> a page reload?
> :-> 
> :-> 
> :-> 
> :-> -
> :-> 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: [

Re: Hierarchical Lists

2004-03-17 Thread Hubert Rabago
Try this:
http://www.oreillynet.com/pub/a/javascript/2002/02/08/iframe.html

--- Randy Dillon <[EMAIL PROTECTED]> wrote:
> Say I have 2 (or more) lists that are part of a hierarchy, such that the
> first list is a category (say Food Groups) and the second list contains
> children of each of the first list's items (for this example, let's say
> Food Types).  
> 
> How do I get the second list to be filtered based on the selection in the
> first list?  I know this can be done by reloading the page each time the
> selection is changed in the first list, but is there a way to do this
> without the page reload?
> 
> To add more detail to the example:
> 
> Food Groups   Food Types
> ---   --
> Meat&DairyBeef
>   Chicken
>   Milk
>   Eggs
> Fruit&Veg Melons
>   Apples
>   Oranges
>   Lettuce
> .   . 
> .   .
> .   .
> 
> If Meat&Dairy is selected in the Food Groups list, can the second Food
> Types list be filtered to only the Meat&Dairy food types without a page
> reload?
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?)

2004-03-16 Thread Hubert Rabago
My suggestion is to familiarize yourself with how Struts works, and apply
that knowledge when editing your config file.  From my experience, WSAD gets
a lot of things wrong.  If it complains about something you believe should
work, try it out yourself.  If you're pretty confident that you're correct,
and your tests prove it, and yet WSAD still complains, ignore it.  [You can
also do what I do -- filter out WSAD's Struts complaints :) ]

Hubert

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> Just as I suspected.  I'm forced to use WSAD where I work, and I've turned
> off a whole bunch of validations by it, including Struts.  It complains of
> a
> lot of things that either it doesn't know about or it's just plain wrong
> about.  Fortunately, I only have to run the app there, and not have to do
> any
> serious coding with it.  My teammates aren't as fortunate, though.
> 
> Hubert
> 
> --- [EMAIL PROTECTED] wrote:
> > WSSD 5.0.1
> > (WebSphere Studio Site Developer)
> > 
> > 
> > 
> > 
> > 
> > Hubert Rabago <[EMAIL PROTECTED]>
> > 03/16/2004 12:58 PM
> > Please respond to "Struts Users Mailing List"
> > 
> >  
> > To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
> > cc: 
> > Subject:RE: Should I be able to put a path of a Action
> > Class in a global forward?
> > 
> > 
> > Are you getting this from Struts or the container, or from your IDE? 
> What
> > IDE are you using?  Some IDEs that try to support Struts aren't really 
> > *that*
> > in touch with what a developer can do with Struts.  If you have a doubt, 
> > try
> > running the app and see if it behaves the way you (and not your IDE) 
> > expects
> > it to behave.
> > 
> > Hubert
> > 
> > --- [EMAIL PROTECTED] wrote:
> > > Everytime I put the global forward in the config-struts.xml document I 
> > get 
> > > the following error
> > > 
> > > Warning Target /contentView.do does not exist in the following modules:
> 
> > /
> > > 
> > > It is like the contentView.do can not be resolved.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > <[EMAIL PROTECTED]>
> > > 03/16/2004 12:32 PM
> > > Please respond to "Struts Users Mailing List"
> > > 
> > > 
> > > To: <[EMAIL PROTECTED]>
> > > cc: 
> > > Subject:RE: Should I be able to put a path of a Action
> > > Class in a global forward?
> > > 
> > > 
> > > 
> > > Yes you can
> > > 
> > > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > > 
> > > Sent: Tuesday, March 16, 2004 11:02 PM
> > > To: Struts Users Mailing List
> > > Subject: Should I be able to put a path of a Action Class in a global
> > > forward?
> > > 
> > > 
> > > Should I be able to put a path of a Action Class in a global forward?
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 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]
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Mail - More reliable, more storage, less spam
> > http://mail.yahoo.com
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail - More reliable, more storage, less spam
> http://mail.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



RE: WSAD problems with Struts (was: Should I be able to put a path of a Action Class in a global forward?)

2004-03-16 Thread Hubert Rabago
Just as I suspected.  I'm forced to use WSAD where I work, and I've turned
off a whole bunch of validations by it, including Struts.  It complains of a
lot of things that either it doesn't know about or it's just plain wrong
about.  Fortunately, I only have to run the app there, and not have to do any
serious coding with it.  My teammates aren't as fortunate, though.

Hubert

--- [EMAIL PROTECTED] wrote:
> WSSD 5.0.1
> (WebSphere Studio Site Developer)
> 
> 
> 
> 
> 
> Hubert Rabago <[EMAIL PROTECTED]>
> 03/16/2004 12:58 PM
> Please respond to "Struts Users Mailing List"
> 
>  
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> cc: 
> Subject:RE: Should I be able to put a path of a Action
> Class in a global forward?
> 
> 
> Are you getting this from Struts or the container, or from your IDE?  What
> IDE are you using?  Some IDEs that try to support Struts aren't really 
> *that*
> in touch with what a developer can do with Struts.  If you have a doubt, 
> try
> running the app and see if it behaves the way you (and not your IDE) 
> expects
> it to behave.
> 
> Hubert
> 
> --- [EMAIL PROTECTED] wrote:
> > Everytime I put the global forward in the config-struts.xml document I 
> get 
> > the following error
> > 
> > Warning Target /contentView.do does not exist in the following modules: 
> /
> > 
> > It is like the contentView.do can not be resolved.
> > 
> > 
> > 
> > 
> > 
> > 
> > <[EMAIL PROTECTED]>
> > 03/16/2004 12:32 PM
> > Please respond to "Struts Users Mailing List"
> > 
> > 
> > To: <[EMAIL PROTECTED]>
> > cc: 
> > Subject:RE: Should I be able to put a path of a Action
> > Class in a global forward?
> > 
> > 
> > 
> > Yes you can
> > 
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > 
> > Sent: Tuesday, March 16, 2004 11:02 PM
> > To: Struts Users Mailing List
> > Subject: Should I be able to put a path of a Action Class in a global
> > forward?
> > 
> > 
> > Should I be able to put a path of a Action Class in a global forward?
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 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]
> > 
> > 
> > 
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail - More reliable, more storage, less spam
> http://mail.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



RE: Should I be able to put a path of a Action Class in a global forward?

2004-03-16 Thread Hubert Rabago
Are you getting this from Struts or the container, or from your IDE?  What
IDE are you using?  Some IDEs that try to support Struts aren't really *that*
in touch with what a developer can do with Struts.  If you have a doubt, try
running the app and see if it behaves the way you (and not your IDE) expects
it to behave.

Hubert

--- [EMAIL PROTECTED] wrote:
> Everytime I put the global forward in the config-struts.xml document I get 
> the following error
> 
> Warning Target /contentView.do does not exist in the following modules: /
> 
> It is like the contentView.do can not be resolved.
> 
> 
> 
> 
> 
> 
> <[EMAIL PROTECTED]>
> 03/16/2004 12:32 PM
> Please respond to "Struts Users Mailing List"
> 
>  
> To: <[EMAIL PROTECTED]>
> cc: 
> Subject:RE: Should I be able to put a path of a Action
> Class in a global forward?
> 
> 
> 
> Yes you can
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> 
> Sent: Tuesday, March 16, 2004 11:02 PM
> To: Struts Users Mailing List
> Subject: Should I be able to put a path of a Action Class in a global
> forward?
> 
> 
> Should I be able to put a path of a Action Class in a global forward?
> 
> 
> 
> 
> 
> 
> 
> 
> 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]
> 
> 
> 
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



RE: What is the best way to pass a parameter to a forward?

2004-03-16 Thread Hubert Rabago
I wrote an extension to help me do this.  I use this in all my projects.
http://www.rabago.net/struts/redirect

hth,
Hubert

--- Jay Glanville <[EMAIL PROTECTED]> wrote:>
> I'm trying to solve a problem, but I'm not sure my solution 
> is the best
> way.  Basically, I want to set a parameter on a forward within the
> action's execute.
> 
> I'm in my action's execute method.  I've just successfully performed
> some work, and I now want to forward/redirect to the next page.  So,
> I've got some code that looks like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   return goto;
>}
> 
> With an action mapping that looks like this:
> 
>   path="/EntrySave"
>   type="com.package.EntrySaveAction"
>   name="EntryForm"
>   validate="true"
>   input="/Entry.do">
>   
>   
>
> 
> Basically, if I left the EntrySaveAction.execute do what's doing right
> now, then upon successful completion, it would redirect to
> "/Container.do".  However, what I want it to do is redirect to
> "/Container.do?id=45", where 45 is the id of the container that I want
> to go to.  The value of "45" is dynamic, and is know at the 
> time of the
> EntrySaveAction.execute command.
> 
> The way I'm currently doing it is something like this:
> 
>public ActionForward execute(ActionMapping.) {
>   // do some work
>   ActionForward goto = mapping.findForward( "success" );
>   String path = goto.getPath();
>   path += "?id=" + container.getId();
>   goto.setPath( path );
>   return goto;
>}
> 
> Is this the correct way to do this?  Is there a better way?
> 
> Thanks in advance
> 
> JDG
> 
> 
> --
> Jay Glanville


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: Using optionsCollection - LabelValueBean

2004-03-14 Thread Hubert Rabago

The  needs to be provided with the property it's associated to,
the one on your form bean that will hold the actual value selected.





"mySelectValue" should be a property on your form bean.

hth,

Hubert



--- Timo_Tjäder <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have problems with optionsCollection, when used with 
> custom tag.
> 
> 1. I set up in a bean LabelValueBean object in a Vector
> 2. pass it back to form and try to create a 
> 
> This part should display a combo box with options, but
> it just does not work. It does not display anything.
> 
> Html code is as follows:
> 
> 
>  property="totalNumOfPagesCollection"/>
> 
> 
> I have checked using struts "bean:write" the contents of 
> the object. Bean write claims that totalNumOfPages really 
> contains LabelValueBean-objects (14 peaces).
> LabelValueBean[1, 1], LabelValueBean[2, 2], LabelValueBean[3, 3], 
> ...
> 
> So, does anyone know how to reference to this object correctly.
> Current solution does not diaplay anything to the screen.
> 
> Thanks,
> 
> Timo
> 
> So what I'd like to do is display a selection list of
> all availabele pages from which user choose one and press
> a goTo page button. This is quite common web control in
> any web pages.
> 
> 
> 
>  value="add-total-num-of-pages-collection">
>  property="LabelValueBean"/>  
> 
> 
>  property="totalNumOfPagesCollection"/>
> 
> 
>   
> 
> 
> [1]  2 3 4 5 next »  Result 14 pages. 
> 
> ÄLabelValueBeanÄ1, 1Å, LabelValueBeanÄ2, 2Å, LabelValueBeanÄ3, 3Å, 
> LabelValueBeanÄ4, 4Å, LabelValueBeanÄ5, 5Å, LabelValueBeanÄ6, 6Å, 
> LabelValueBeanÄ7, 7Å, LabelValueBeanÄ8, 8Å, LabelValueBeanÄ9, 9Å, 
> LabelValueBeanÄ10, 10Å, LabelValueBeanÄ11, 11Å, LabelValueBeanÄ12, 
> 12Å, LabelValueBeanÄ13, 13Å, LabelValueBeanÄ14, 14ÅÅ
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: "" does not mean 0 [in my app] :)

2004-03-13 Thread Hubert Rabago
That's the expected behavior.  At the bottom of
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_action_form_classes:

"And, of course, while the DynaActionForm may support various binary types,
properties used with the html:text tag should still be String properties."

Hubert

--- Craig Tataryn <[EMAIL PROTECTED]> wrote:
> Hi there, is there a configuration setting for Struts which tells it to set
> a property on a form
> bean of type "Integer" (not int) to null instead of "new Integer(0)" when
> the corresponding value
> coming in from the user's form is an empty string?
> 
> I had to create a plugin that had the following in it's init() method:
> 
> ConvertUtils.register(new IntegerConverter(null),Integer.class);
> 
> Thanks,
> 
> Craig.
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

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



Re: (pre)populating DynaActionForm

2004-03-12 Thread Hubert Rabago
Thanks for the clarification, Joe.  The copy of RequestUtils I really studied
was from late Dec/early Jan, so I just missed that method.  I remember
reading the message you linked to and I've been meaning to ask, what did you
mean by "prefilling forms with non-request data"?  Is it similar to one of
the issues I'm trying to solve with the formdef
http://www.rabago.net/struts/formdef/ plugin I'm working on?  

Hubert

--- Joe Germuska <[EMAIL PROTECTED]> wrote:
> At 12:09 PM -0800 3/12/04, Hubert Rabago wrote:
> >As far as I can tell, there really isn't any support for prepopulating a
> >DynaActionForm.  The ff is from
>
>http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_action_form_classes
> >
> >"DynaActionForms are not a drop-in replacement for ActionForms. If you
> need
> >to access ActionForm properties in your Action, you will need to use the
> >map-style accessor, like myForm.get("name"). If you actively use the
> >ActionForm object in your Action, then you may want to use conventional
> >ActionForms instead.
> >
> >What I did was copy the code that RequestUtils uses to instantiate a
> >DynaActionForm, and put it in a method that I can call like this:
> >DynaActionForm dynaForm = createDynaActionForm("formName",
> >mapping.getModuleConfig());
> 
> Since 1/24/2004, RequestUtils has exposed a public method that allows 
> you to get an ActionForm instance using a FormBeanConfig and an 
> ActionServlet.  This is discussed in a bit of detail in 
> http://article.gmane.org/gmane.comp.jakarta.struts.user/78441
> 
> This method does not do any scope searching -- it just makes a new 
> instance -- but it helps.
> 
> I've been holding off on exposing any more of the form bean pieces 
> until I got some more feedback. I'm waiting to hear from some other 
> people who find it as annoying as I do to help elaborate the problem 
> and the solution (or waiting until it annoys me enough to come up 
> with a solution on my own...)   As noted in the above-referenced 
> post, we have an internal solution at work that puts us in a pretty 
> good spot relating to pre-filling forms, so the itch has been 
> scratched, so to speak.
> 
> Joe
> 
> -- 
> Joe Germuska
> [EMAIL PROTECTED]  
> http://blog.germuska.com
>"Imagine if every Thursday your shoes exploded if you tied them 
> the usual way.  This happens to us all the time with computers, and 
> nobody thinks of complaining."
>  -- Jef Raskin
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: (pre)populating DynaActionForm

2004-03-12 Thread Hubert Rabago
My bad.  I didn't read your mail through; only saw the top portion.  
In your setupUserAction, after you prepopulate the form, set it as a request
attribute:

> > from SetUpUserAction.execute()
> > DynaActionForm userForm = (DynaActionForm)form;
> >
> > userForm.set("userName",user.getUserName());
> > userForm.set("password",user.getPassword());
> > userForm.set("fullName",user.getFullName());
> > userForm.set("email",user.getEmail());
> > userForm.set("status",new Integer(1));
request.setAttribute("userForm",userForm);
> >   
> > forward = mapping.findForward("Success");
> > return forward;

It works when the form is in session scope because that will make the whole
session deal with one form instance.

hth,
Hubert

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> As far as I can tell, there really isn't any support for prepopulating a
> DynaActionForm.  The ff is from
>
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_action_form_classes
> 
> "DynaActionForms are not a drop-in replacement for ActionForms. If you need
> to access ActionForm properties in your Action, you will need to use the
> map-style accessor, like myForm.get("name"). If you actively use the
> ActionForm object in your Action, then you may want to use conventional
> ActionForms instead. 
> 
> "DynaActionForms cannot be instantiated using a no-argument constructor. In
> order to simulate the extra properties, there is a lot of machinery
> involved
> in their construction. You must rely on Struts to instantiate a
> DynaActionForm for you, via the ActionMapping."
> 
> What I did was copy the code that RequestUtils uses to instantiate a
> DynaActionForm, and put it in a method that I can call like this:
> DynaActionForm dynaForm = createDynaActionForm("formName",
> mapping.getModuleConfig());
> 
> 
> 
> /**
>  * Create the [EMAIL PROTECTED] DynaActionForm} instance identified by the
> given
>  * formName.
>  * 
>  * @param formName the name used to identify the form
>  * @param moduleConfig the configuration for the current module
>  * @return the DynaActionForm identified by formName
>  */
> public static DynaActionForm createDynaActionForm(
> String formName,
> ModuleConfig moduleConfig) {
> DynaActionForm dynaForm;
> try {
> // the code here is based on [copied from? :) ]
> //  RequestUtils.createActionForm()
> FormBeanConfig formBeanConfig =
> moduleConfig.findFormBeanConfig(formName);
> 
> DynaActionFormClass dynaClass =
> DynaActionFormClass.createDynaActionFormClass(
> formBeanConfig);
> 
> dynaForm = (DynaActionForm) dynaClass.newInstance();
> 
> if (logger.isTraceEnabled()) {
> logger.trace("inside findDynaActionForm() where dynaForm="
> +
>   dynaForm + " and formBeanConfig=" +
> formBeanConfig);
> }
> 
> initializeDynaForm(formName, dynaForm, moduleConfig);
> } catch (Exception e) {
> logger.error("Exception [" + e + "," + e.getMessage() + "]",
> e);
> // TODO what to do if we get an error initializing the form?
> // -> right now we're just returning null
> dynaForm = null;
> }
> return dynaForm;
> }
> 
> /**
>  * Initialize all bean properties to their initial values, as
> specified
>  * in the [EMAIL PROTECTED] FormPropertyConfig} elements associated with the
>  * definition of this DynaActionForm.  Based on the
>  * DynaActionForm.initialize() method.
>  * 
>  *
>  * @param dynaForm the DynaActionForm to be initialized
>  * @param moduleConfig the ModuleConfig under which this dynaForm
>  *
>  */
> protected static void initializeDynaForm(String name,
>  DynaActionForm dynaForm,
>  ModuleConfig moduleConfig) {
> 
> FormBeanConfig config = moduleConfig.findFormBeanConfig(name);
> if (config == null) {
> return;
> }
> FormPropertyConfig props[] = config.findFormPropertyConfigs();
> for (int i = 0; i < props.length; i++) {
>  

Re: (pre)populating DynaActionForm

2004-03-12 Thread Hubert Rabago
As far as I can tell, there really isn't any support for prepopulating a
DynaActionForm.  The ff is from
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_action_form_classes

"DynaActionForms are not a drop-in replacement for ActionForms. If you need
to access ActionForm properties in your Action, you will need to use the
map-style accessor, like myForm.get("name"). If you actively use the
ActionForm object in your Action, then you may want to use conventional
ActionForms instead. 

"DynaActionForms cannot be instantiated using a no-argument constructor. In
order to simulate the extra properties, there is a lot of machinery involved
in their construction. You must rely on Struts to instantiate a
DynaActionForm for you, via the ActionMapping."

What I did was copy the code that RequestUtils uses to instantiate a
DynaActionForm, and put it in a method that I can call like this:
DynaActionForm dynaForm = createDynaActionForm("formName",
mapping.getModuleConfig());



/**
 * Create the [EMAIL PROTECTED] DynaActionForm} instance identified by the given
 * formName.
 * 
 * @param formName the name used to identify the form
 * @param moduleConfig the configuration for the current module
 * @return the DynaActionForm identified by formName
 */
public static DynaActionForm createDynaActionForm(
String formName,
ModuleConfig moduleConfig) {
DynaActionForm dynaForm;
try {
// the code here is based on [copied from? :) ]
//  RequestUtils.createActionForm()
FormBeanConfig formBeanConfig =
moduleConfig.findFormBeanConfig(formName);

DynaActionFormClass dynaClass =
DynaActionFormClass.createDynaActionFormClass(
formBeanConfig);

dynaForm = (DynaActionForm) dynaClass.newInstance();

if (logger.isTraceEnabled()) {
logger.trace("inside findDynaActionForm() where dynaForm=" +
  dynaForm + " and formBeanConfig=" +
formBeanConfig);
}

initializeDynaForm(formName, dynaForm, moduleConfig);
} catch (Exception e) {
logger.error("Exception [" + e + "," + e.getMessage() + "]", e);
// TODO what to do if we get an error initializing the form?
// -> right now we're just returning null
dynaForm = null;
}
return dynaForm;
}

/**
 * Initialize all bean properties to their initial values, as
specified
 * in the [EMAIL PROTECTED] FormPropertyConfig} elements associated with the
 * definition of this DynaActionForm.  Based on the
 * DynaActionForm.initialize() method.
 * 
 *
 * @param dynaForm the DynaActionForm to be initialized
 * @param moduleConfig the ModuleConfig under which this dynaForm
 *
 */
protected static void initializeDynaForm(String name,
 DynaActionForm dynaForm,
 ModuleConfig moduleConfig) {

FormBeanConfig config = moduleConfig.findFormBeanConfig(name);
if (config == null) {
return;
}
FormPropertyConfig props[] = config.findFormPropertyConfigs();
for (int i = 0; i < props.length; i++) {
dynaForm.set(props[i].getName(), props[i].initial());
}
}

hth,
Hubert

--- Danko Desancic <[EMAIL PROTECTED]> wrote:
> I am newbie to Struts and have a problem with  populating 
> DynaActionForm. I have two actions: one to set up userForm and one to 
> process it. 1st one is suposed to grab user info and populate the form. 
> The second one updates user info after the form is submitted. The 
> problem is that the from is not populated. Moreover changing the scope 
> to "session" in action "/user/setUp"  results in form being populated 
> with appropriate data. What am I doing wrong in here?
> 
> Thanks
> Danko
> 
> from struts-config.xml
>  type="org.apache.struts.action.DynaActionForm">that
> 
> 
> 
> 
>  initial="0"/>
> 
> 
>  path="/user/setUp"
> type="myPackage.user.SetUpUserAction"
> name="userForm"
> scope="request"
> validate="false">
>  path="/WEB-INF/jsp/user/userForm.jsp"/>
> 
>
>  path="/user/update"
> type="myPackage.user.UpdateUserAction"
> name="userForm"
> scope="request"
> validate="true"
> input="/WEB-INF/jsp/user/userForm.jsp">
> 
>  
> 
> from SetUpUserAction.execute()
> DynaActionForm userForm = (DynaActionForm)form;
>
> userForm.set("userName",user.getUserName());
> userForm.set("password",user.getPassword());
> userForm.set("fullName",user.getFullName());
>   

Re: (again)help me about indexed properties

2004-03-11 Thread Hubert Rabago

--- Mu Mike <[EMAIL PROTECTED]> wrote:
>(QUESTION: what do name property ,id ,indexID mean here? what value can 
> I set to them?)
>  I searched online only fail to find any doc that give detailed 
> explaination about  these proeprties>
> property='<%= "labelValue[" + ctr + "].label" %>' />
> (QUESTION:what do name and propetry mean here? what value can I set 
> to them?)

You can always consult the Struts home page for info on tags and attributes.
http://jakarta.apache.org/struts/userGuide/index.html
http://jakarta.apache.org/struts/userGuide/struts-logic.html
http://jakarta.apache.org/struts/userGuide/struts-html.html

Hubert


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: Strange behaviour?

2004-03-11 Thread Hubert Rabago
You can put log statements in your form bean's setter methods to verify that
they are being called.  My guess is that your configuration is causing struts
to reinitialize the form somehow and that resets the form values.  All I can
do is guess, though, since I have no idea how your mappings are configured.

Hubert

--- Frank Burns <[EMAIL PROTECTED]> wrote:
> I have a validate() method in my ActionForm class that includes some
> cleanup
> (removes redundant whitespace) of some of the ActionForm bean's properties.
> The related Action has validate="true" set in struts-config. So validate()
> should always be called.
> 
> The Action class then uses the ActionsForm's getters to read these
> properties and saves them.
> 
> However, the saved properties have only been cleaned when errors are found
> by the validate() method.
> 
> Why?
> 
> The validate() method is ALWAYS called and executes the cleanup methods on
> the properties whether validate() discover errors or not, right?
> 
> Specifically, in the code below, the answer1, answer2, etc., are only
> "cleaned" if there is an error found in the email address.
> 
> /*** code snippet ***/
> 
>  public ActionErrors validate(
>   ActionMapping mapping,
>   HttpServletRequest request) {
> 
>   /* clean redundant whitespace from answers properties */
>   answer1 = cleanWhitespace(answer1);
>   answer2 = cleanWhitespace(answer2);
>   answer3 = cleanWhitespace(answer3);
> 
>   ActionErrors errors = new ActionErrors();
> 
>   /*** validate email address ***/
> 
>   /* check is email address is not empty */
>   if ((emailAddr == null) || (emailAddr.length() < 1)){
>errors.add("emailaddressempty",
> new ActionError("errors.required.emailaddress"));
>   }
> 
> ...
> 
> return errors;
> }
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: [OT] PDF generation (was: Reporting + Struts)

2004-03-11 Thread Hubert Rabago

--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> Hubert Rabago wrote:
> > My current users are Excel lovers, so I generate formatted Excel docs
> > (through POI) that they can edit or print directly.
> 
> Do you have a small example?  I'm currently sending a CSV from my Struts
> app, but there is a huge demand for Excel.  I've started experimenting
> with the XML structure of an Excel Workbook, but I don't know how far
> that's going to get me.

I found this really helpful:
http://jakarta.apache.org/poi/hssf/quick-guide.html 
It's their "Busy Developers' Guide to HSSF Features" and it gives you the
complete needed to produce a worksheet to see each feature, one at a time.
I got 95% of what I needed there, and the rest by studying the method
signatures of the different classes.

Hubert


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



[OT] PDF generation (was: Reporting + Struts)

2004-03-11 Thread Hubert Rabago

--- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> I ended up ditching it and creating reports using iText to create pdf files
> directly.
> 
>  http://www.lowagie.com/iText/
> 
> BTW, I wasn't doing it in a web environment and the pdf generation is slow,
> can take up to 30 seconds for a large report. I am going to be putting

If you think that is slow, wait till you try Apache's FOP.  It's been a
while, but IIRC, when my reports went five pages or more, I believe it took
around 30 secs.  With 50 pages, my users started calling and asking if the
app was still running.

My current users are Excel lovers, so I generate formatted Excel docs
(through POI) that they can edit or print directly.

I was gonna use IText the next time I needed PDFs.  If that's slow too, are
there other alternatives?



__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Changing position of nested beans

2004-03-11 Thread Hubert Rabago
Not sure if you're looking different ways to do Move Up/Move Down or just a
way to make your "one button for each item" work.  If it's the former, you
can include a radio button beside each item and have one Move Up and one Move
Down button for the whole form.  The radio button will have the index of the
item it's sitting next to.  When a Move button is pressed, you'll have one
non-indexed field containing the index of the item to either move up or down,
and you can react appropriately.  Hmm... the question is, how do you get the
value of 's indexId to the value of your  without
using <%= %>?  Could I have been on the crack, too, and not know it?

Hubert


-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 11, 2004 10:05 AM
To: Struts Users Mailing List
Subject: Re: Changing position of nested beans


Crack smoking gags aside..

I've tried hacking around the problem using the unspecified method to  
no avail. Looks like storing in session and using links.

Unless I have any sudden rushes of blood to the head.

On 11 Mar 2004, at 13:21, Niall Pemberton wrote:

> You know before I read you messages, I would have understood "crack" 
> programmer as a compliment - now I'm thinking it could be a support
> group
> for those of us who spend too much time on lists like this :-).
>
>
> - Original Message -
> From: "Mark Lowe" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, March 11, 2004 11:51 AM
> Subject: Re: Changing position of nested beans
>
>
>> The only reason why dispatch action appeals is that i can map the 
>> form to one action and have several buttons within a form without needing
>> to
>> change to form action with javascript or anything grotty like that.
>>
>> I'm not especially keen dispatch actions . Just this business of 
>> using links and the request being cleared leaves me scoping to 
>> session and using a link, again i'm not that against scoping to 
>> session but I thought someone in the anti httpsession brigade would 
>> have a solution for this common problem.
>>
>> I don't think I'm tree-barking but ruminating on dispatch action 
>> (although i'm not certain).
>>
>> I'm trying various ways and seeing what happens. But indexed handler 
>> parameters seem like the sort of thing that would be required to do 
>> such a thing, but seem to be more the consequence of a crack induced 
>> state of derangement than something that struts supports.
>>
>>
>> On 11 Mar 2004, at 12:19, Niall Pemberton wrote:
>>
>>> Mark,
>>>
>>> Seems to me you have already worked out the solution, except why do 
>>> you need a lookup dispatch action - rather than a "roll your own" - 
>>> you have
>>> two
>>> methods right - "Move Up" and "Move Down"?
>>>
>>> Your jsp will populate a (foo?) List with either "Move Up" or "Move 
>>> Down" (depending on the button pressed) in the appropriate index 
>>> position - so you
>>> loop through them until you find a none null entry and call the
>>> appropriate
>>> method depending on the value with the index position you're at.
>>>
>>> trying to use look up dispatch action seems to be overly 
>>> complicating things to me.
>>>
>>> Niall
>>>
>>>
>>> - Original Message -
>>> From: "Mark Lowe" <[EMAIL PROTECTED]>
>>> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>>> Sent: Thursday, March 11, 2004 9:31 AM
>>> Subject: Changing position of nested beans
>>>
>>>
 I was wondering if anyone has found any slick, no javascript
 dependent
 solution to the following situation. My question in short is, is  
 there
 a way of having an indexed dispatch action, or have i been on the
 crack
 again?

 I have a form of nested beans which are ordered according to a 
 position stored in the model. I don't do any sorting in the web 
 tier nor do i want to, other than rejigging the indices of some 
 indexed properties until such a time as the user is ready to save 
 his/her changes to
 the
 model.

 
 
 
 
 

 Now when i save I'll save the index as a field called position, 
 thus all that's fine and dandy.

 So lets say I want the use to define the position by having a move
 up
 and move down, but rather than using an indexed link i want to use a
 button.

 I've a lookup dispatch action with a moveup method and all that
 jazz.

 
  >>> name="foo" property="name" indexed="true" /> >>> property="method" indexed="true"> >>> /> 
 
 

 So the rendered html would like like this

 
 >>> name="method[0]" value="Move Up"> //and so on
 

 Of course if i submit this to a lookupdispatch action, its gonna
 call
 me a crazy fool. So i need to have some means of having an indexed  
 map
 key in my key method map, or something to cross the same bridge i'm
 trying to cross.

 Any ideas? I know i can do this in ja

Formatting in message resources (was: bean:message format ssn)

2004-03-11 Thread Hubert Rabago
Yes, the default MessageResources implementation uses the Java Format object,
so in some of my messages, I have:

my.msg.key=No was found for {0,date,MM}

Cool, ain't it?  Not sure a lot of people know about it.  So you won't have
to mess with source code when all you wanna do is change data formatting.
Problem is, the JSP tags can only accept string values, so my particular
example (date formatting) only works on messages created in my Action
objects, not in my JSPs.  I'm pretty sure it'll work for Strings, though.


--- Andreas Solarik <[EMAIL PROTECTED]> wrote:
> Ah, I guess I misunderstood your previous post. Maybe this will help you
> along?
> 
> 
> Use the formatKey attribute if you want to pull it from message resources.
> Have
> a look at java.text.DecimalFormat for an explanation of formatting patterns
> for
> decimal numbers.
> 
> 
> The above code came from http://www.junlu.com/msg/45833.html. I didn't even
> know that this was possible. Lets see if I need it some day!
> 
> 
> Andreas
> 
> -Ursprungliche Nachricht-
> Von: Kumar M [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 11. Marz 2004 17:30
> An: Struts Users Mailing List
> Betreff: Re: AW: bean:message format ssn
> 
> 
> 
> Thanks for your replies.
> 
> There seems to be a way to format using . If you look at
> the following article from Ted Husted:
> 
> http://www.jguru.com/faq/view.jsp?EID=915891
> 
>  From the article:
> 
> "ordering.authorized.range.staff=Staff is only authorized to requisition
> supplies that cost less than ${0,number} USD"
> 
> would convert argument 0 to the number format. Isn't that nice!
> 
> I was wondering if there is anyway we could extend this for things like
> ssn. I am looking at the MessageFormat class and all but was wondering
> if some one has come across this already.
> 
> Thanks!
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> >Hi Kumar,
> >
> >when you look at the documentation for bean:write
> >(http://jakarta.apache.org/struts/userGuide/struts-bean.html#write) you
> can
> >find that it allows formating. Bean:message looks like it does not support
> >this feature - which kind of makes sense when you consider what its used
> for
> >(lookup of strings in the resources -> supporting parameterized
> >replacement).
> >
> >The format of the format string is something like
> >
> >
> >  -  
> >  -   <%= pageContext.getAttribute("test7.value") %>
> >  -[#,000.00]  >format="#,000.00"/>
> >  -[]  >name="test7.value"
> >formatKey="format.pattern"/>
> >  -  
> >
> >
> >The preceeding code came from
> >http://www.mail-archive.com/[EMAIL PROTECTED]/msg20743.html
> >
> >Andreas
> >
> >-Ursprungliche Nachricht-
> >Von: Kumar M [mailto:[EMAIL PROTECTED]
> >Gesendet: Donnerstag, 11. Marz 2004 16:45
> >An: Struts Users Mailing List
> >Betreff: bean:message format ssn
> >
> >
> >
> >Hi all,
> >
> >I am wondering if there is an easy way to format the ssnn. What I have
> >is a String '123456789' but the users would like to see '123-45-6789'.
> >Is there an easy way of doing this using bean:write or bean:message or
> >any other tag?
> >
> >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]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: How to set the selected value in an select rendered by optionsCollection

2004-03-10 Thread Hubert Rabago

--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > because of the fact, that i´ve got no access to this bean in my 
> > preprocessing action. testSelect is a member of the upcoming 
> > DynaActionValidatorForm with is initiatet during the 
> >  tag of my JSP.
> 
> Nope.  It goes request->form creation->action.  You are being passed the
> form in the signature of ActionForm.execute(), all you have to do is cast
> it to the right type:
> 
>   DynaActionForm dForm = (DynaActionForm) form;

This would only be true if the action that was called specified that form in
its mapping.  If this is a preprocessing action (that's being called to
provide an HTML form with data to show), and there's no "name" attribute to
tie a form to it, Struts will not create/populate a form (because it wouldn't
know what form to create).  

You can make the form available to this action if you specify the form you
want in the "name" attribute in this action's mapping.  However, this would
not be good practice since the preprocessing action could itself require a
form of a different type. 

> 
> Now set whatever properties of dForm you need to, then forward to the JSP.
> 
> > You are right the sbBean and the DynaActionValidatorForm have exactly 
> > the same members which seems to be a big design failure in my 
> > application. I should get rid of the sbBean and initiate the 
> > DynaActionValidatorForm earlier in my preprocessing action.
> 
> Not recommended.  They might be the same *now* but if your business object
> changes in the future, you don't want that to be tied so closely to your
> webapp.  Since you're using dyanamic forms, it's not THAT much trouble to
> maintain a business object plus some lines of XML.  Or you can use a tool
> to generate all the get/set methods for a regular ActionForm.
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: Header for errors (no HTML in the .properties file)

2004-03-05 Thread Hubert Rabago
Check the  and  and see if
they do the trick for you.

- Hubert

--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> I'm using this to display errors:
>
>  
>
>  
>
>  
>
> 
> How do I put the old "Validation ErrorYou must correct the following
> error(s) before proceeding:" text at the top if there are indeed errors
> to be displayed?  That used to happen magically with 
> using the errors.header & errors.footer in the
> ApplicationResources.properties file.
> 
> I started to write  check for emptiness.  
> 
> I see that the errors are in request scope under the key
> org.apache.struts.action.ERROR but all sorts of variations of this break
> my page:
> 
> 
> It's late on Friday, I'm probably missing something really simple...
> 
> -- 
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: throws exception

2004-03-05 Thread Hubert Rabago
If you're using 1.1, try passing ActionError objects instead of ActionMessage
objects.  The syntax should be the same, you'll just use a different object.

Hubert

--- Max Kovalenkov <[EMAIL PROTECTED]> wrote:
> Hi!
> 
> I have a custom validator which works fine, but when the  
> tag is being executed, it throws a ClassCastException. My validator has 
> the following line for adding to error messages:
> 
> errors.add( field.getKey(), new ActionMessage("errors.dates", date1, 
> date2));
> 
> If validation passes, the above line is not executed, and everything 
> works(even if there are errors in other fields of the form), the tag 
> prints errors normally.
> I am puzzled. Could anyone suggest the reason for this exception? Thanks.
> 
> Max
> 
> 

__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Reset all form bean elements in one shot

2004-03-05 Thread Hubert Rabago
You can also check if the form bean's reset() method can do the job for you.

--- [EMAIL PROTECTED] wrote:
> 
> How to remove the form bean element from the session if that's the case
> 
> -Original Message-
> From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 06, 2004 2:14 AM
> To: Struts Users Mailing List
> Subject: Re: Reset all form bean elements in one shot
> 
> 
> Anant: So a brand new form bean won't do the job..?
> Geeta
> 
> [EMAIL PROTECTED] wrote:
> 
> > Hi,
> >
> > I wanted to know if there is any way in which we can reset all the
> > elements of the form bean without giving individual resets all the
> > time
> >
> > for e.g I have 4 elements in my form bean. say A,B,C,D I am interested
> 
> > in resetting all the four without giving
> >
> > resetAllElements() {
> > A = null
> > B = null
> > C = null
> > D = null
> > }
> >
> > Note: My form bean has session scope(I need it)
> >
> > Regards
> >
> > Anant
> >
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: [OT] JSF RI Final is out!

2004-03-05 Thread Hubert Rabago
Btw, Craig, thank you very much for removing those underscores.

Hubert

--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> Quoting Janarthan Sathiamurthy <[EMAIL PROTECTED]>:
> 
> > Hi,
> >  
> > How do i get started wiith JSF ?. 
> > Any books ?
> > Please advice
> >  
> 
> JavaServer Faces Home Page:
>   http://java.sun.com/j2ee/javaserverfaces/
> 
> Download Page:
>   http://java.sun.com/j2ee/javaserverfaces/download.html
> 
> Support Forum (free registration required):
>   http://forums.java.sun.com/forum.jsp?forum=427
> 
> The download includes some example applications that illustrate its use. 
> An
> update to the JavaServer Faces Tutorial is in progress, and will be posted
> shortly.
> 
> No books have been published about JavaServer Faces yet (to my knowledge),
> although I know of at least five that are nearing completion, and should be
> published very soon.
> 
> Nightly builds of an integation library for using JavaServer Faces and
> Struts
> together are available, but it's still based on the beta version.  I'm
> debugging the updates as I type, and will post messages here when the
> nightly
> builds have been updated to work with the final version.
> 
> 
> > Regards,
> > Janarthan S
> > 
> 
> Craig McClanahan
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Returning fully-stocked Actions/JSPs from other Actions

2004-03-05 Thread Hubert Rabago
How about putting some log statements around the code which sets the request
attribute?  That'll assure you that the code is getting executed, and that
the data you're putting there actually has values in them.  

Have you tried re-requesting home.do after a successful login?  Does the data
show then?  Also, have you considered redirecting to home.do instead of
chaining the two actions?  There were a lot of discussion about the problems
with chaining actions sometime last year, but I wasn't around for most of it.

Hubert

--- Andy Engle <[EMAIL PROTECTED]> wrote:
> Gopalakrishnan, Jayesh wrote:
> 
> > Andy,
> > 
> > Just to understand your page flow
> > 
> > The first request goes to /home.do, which puts "junkbean"
> > into the request scope, forwards to index.jsp.
> > On submit of the form on index.jsp, /login.do is invoked
> > which then forwards to /home.do.
> > 
> > Is this understanding correct..?
> 
> Yes, that's exactly how I have it setup.
> 
> 
> > Which action/page gives you "Cannot find bean junkbean in any scope"?
> 
> This happens when I forward back to /home.do after the trip to
> /login.do.  I know that the bean has data during the first load of
> /home.do, which is what I want.  Then I submit to /login.do (bean no
> longer present, of course), and then I forward back to /home.do.  When
> I forward to /home.do that second time, I expect the bean to be filled
> with data once again because I have /home.do mapped to an action which
> puts data in the bean, then puts the bean back in at request scope. 
> The thing I am confused with is that the bean *isn't* being populated
> with data when it seems to me that it should be.
> 
> 
> Andy
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: Real URL in action forward

2004-03-05 Thread Hubert Rabago
Try redirecting to getOperations.do.  A redirect tells the browser to send
another request.  This way, the browser is aware of what it's viewing, and as
a bonus you won't have to couple/chain your saveXXX and getXXX actions.

hth,
Hubert

--- Julio Cesar De Salvo <[EMAIL PROTECTED]> wrote:
> Hi, my question is:
> I have a form that sends some
> information to store in the database to a saveOperation.do action class.
> Then this action forwards to another action getOperations.do to get the
> list of operations, and this action returns to the jsp for viewing.
>  
> But when the jsp is displayed the
> URL path does not show: getOperations.do instead it shows
> saveOperation.do so when I refresh the form is resubmitted.
>  
> Any ideas how to get this working?
>  
> Thanks, Julio
>  
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: IFrame and resources bundle problem

2004-03-05 Thread Hubert Rabago
Front your page with an ActionMapping:




then instead of specifying viewBrief.jsp, specify viewBrief.do (or whatever
your action servlet mapping/extension is).

hth,
Hubert

--- "news.gmane.org" <[EMAIL PROTECTED]> wrote:
> Hi,
> I am using struts, tile and iframe for displaying 2 screen. The problem
> is when i display the data in the iframe set, the resource bundle seem not
> working n can not find the key anymore, pls help...
> 
> in my Tile config:
> 
> 
> 
> 
> 
> 
> in my updateFrameSet.jsp
> 
>  style="border-collapse: collapse">
> 
> 
>  src="<%=request.getContextPath()%>/jsp/ABC/viewBrief.jsp" width=570
> height=390 scrolling=yes frameborder=0>
>   
>   
>src="<%=request.getContextPath()%>/jsp/ABC/entryBrief.jsp" width=400
> height=390 scrolling=no frameborder=0>
> 
> 
> 
> 
> if my viewBrief.jsp
> 
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> 
> 
> 
>  
> 
>  
>   
>  
>   
>   
>   ...
> 
> but when displaying on screen, the following error occured:
> 
> org.apache.jasper.JasperException: Missing message for key "label.cBrief"
>  at
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
> 48)
>  at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
>  at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
>  at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:260)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
>  at
>
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
> 46)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
>  at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
> )
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
>  at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:170)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
>  at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
> )
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
>  at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :174)
>  at
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
>  at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> ction(Http11Protocol.java:386)
>  at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
>  at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:530)
>  at java.lang.Thread.run(Thread.java:536)
> 
> 
> 
>  Any help will be much appreaciate
> 
> -- 
> 
> Vincent Ho
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAI

Re: redirects / actionErrors

2004-03-05 Thread Hubert Rabago
Struts 1.2 has a feature you can use that allows you to store your
ActionMessages in session variables, then have it removed once they're
accessed.  I haven't used this yet, but you can probably build on this by
storing your errors before you redirect, then have them displayed by the
resource your redirected to.
Another option is the extensions at http://www.rabago.net/struts/redirect
which actually adds your messages (error or not) to the url paramters and
puts them back on the ActionMessages queue upon redirection.

hth,
Hubert
--- mucus snot <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am using action errors as a means of passing messages to the request:
> 
> e.g.
> 
> in Action, execute method...
> 
> errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("message.to.user"));
> saveErrors(request, errors);
> return mapping.findForward(Constants.REDIRECT_KEY);
> 
> But if I redirect from this action to another forward that is also an 
> action, the actionError is out of scope.
> 
> I would be interested to know if
> (a) this is good practice - to forward to another forward (it seems to work
> 
> for me)
> (b) there is an easy way to carry the actionError forward within storing in
> 
> the session, and saving it in the redirected request.
> 
> Hope I'm making sense,
> 
> Thanks, al 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: JSF RI Final is out!

2004-03-04 Thread Hubert Rabago
Oops, yeah, that was part of my point, though I forgot to add it. :)
To emphasize that the download is 1.0 final, not 1.0 RC1.

--- Paul Stanton <[EMAIL PROTECTED]> wrote:
> for emphasis
> 
> Daniel Joshua wrote:
> 
> >>1.0 *final* version
> > 
> > 
> > Why are there '*'s around the word 'final' ?
> > 
> > 
> > Regards,
> > Daniel
> > 
> > 
> > -Original Message-
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> > Sent: Friday, 05 March, 2004 2:03 AM
> > To: Struts Users Mailing List
> > Subject: RE: JSF RI Final is out!
> > 
> > 
> > Quoting Jitender Kumar C <[EMAIL PROTECTED]>:
> > 
> > 
> >>Just a small doubt...
> >>Is this a new release?
> >>sorry if I put a wrong query...
> >>
> > 
> > 
> > The main JavaServer Faces page on the web site is still not updated
> (talking
> > to
> > our web admins about it now), but the download page does indeed point at
> the
> > 1.0 *final* version of JavaServer Faces.
> > 
> > Craig
> > 
> > 
> >>-Original Message-
> >>From: Christian Bollmeyer [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, March 04, 2004 3:15 PM
> >>To: Struts Users Mailing List
> >>Subject: JSF RI Final is out!
> >>
> >>
> >>http://java.sun.com/j2ee/javaserverfaces/download.html
> >>
> >>-- Chris
> >>
> >>-
> >>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]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: JSF RI Final is out!

2004-03-04 Thread Hubert Rabago
Because the previous ones were 1.0 RCx (Release Candidate x).

--- Daniel Joshua <[EMAIL PROTECTED]> wrote:
> >1.0 *final* version
> 
> Why are there '*'s around the word 'final' ?
> 
> 
> Regards,
> Daniel
> 
> 
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Friday, 05 March, 2004 2:03 AM
> To: Struts Users Mailing List
> Subject: RE: JSF RI Final is out!
> 
> 
> Quoting Jitender Kumar C <[EMAIL PROTECTED]>:
> 
> > Just a small doubt...
> > Is this a new release?
> > sorry if I put a wrong query...
> >
> 
> The main JavaServer Faces page on the web site is still not updated
> (talking
> to
> our web admins about it now), but the download page does indeed point at
> the
> 1.0 *final* version of JavaServer Faces.
> 
> Craig
> 
> > -Original Message-
> > From: Christian Bollmeyer [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 04, 2004 3:15 PM
> > To: Struts Users Mailing List
> > Subject: JSF RI Final is out!
> >
> >
> > http://java.sun.com/j2ee/javaserverfaces/download.html
> >
> > -- Chris
> >
> > -
> > 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]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: IndexedPropertyDescriptor has null readMethod/writeMethod

2004-03-04 Thread Hubert Rabago
There was some discussion a few days back about a case similar to yours,
where the accessor methods are overloaded.  IIRC, that's what's causing the
problem.  I haven't seen this problem myself, just repeating what's been said
here on the list.  Check the archives and/or rename your accessors.

--- Paul Stanton <[EMAIL PROTECTED]> wrote:
> hi. i am trying use work with an indexed property in struts 1.1.
> i have set up my form bean as follows:
> code
> public class WelcomeForm extends ActionForm
> {
>   List things = new ArrayList();
> 
>   public List getThings()
>   {
>   return things;
>   }
> 
>   public void setThings(List things)
>   {
>   this.things = things;
>   }
> 
>   public SampleBean getThings(int i)
>   {
>   return (SampleBean) things.get(i);
>   }
> 
>   public void setThings(int i, SampleBean thing)
>   {
>   while (things.size() >= i)
>   things.add(new SampleBean());
>   things.set(i, thing);
>   }
> }
> /code
> 
> my form is populated and on the request when it gets to my jsp, which 
> has the following lines somewhere in the body
> 
> code
>  indexId="beanIndex"><%
>   String colProp = "things[" + beanIndex.intValue() + "].color";
>   String foodProp = "things[" + beanIndex.intValue() + "].food";
>   String numProp = "things[" + beanIndex.intValue() + "].number";%>
> 
>   color:
>   food:
>   number:
> 
> /code
> 
> this looks fine to me and i'm sure i've done it before.. anyway, when 
> run i get: "javax.servlet.jsp.JspException: No getter method for 
> property things of bean /WelcomeForm"
> 
> from breakpointing etc i have identified the problem: an 
> IndexedPropertyDescriptor is created for the 'things' property, however 
> the 'readMethod' and 'writeMethod' fields are null. i would expect the 
> IndexedPropertyDescriptor to find my indexed methods and my non-indexed 
> methods.. why is this happening?
> 
> thanks.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Action not forwarding to another Action

2004-03-03 Thread Hubert Rabago
If you decide to do a forward, look at Struts transaction tokens to ensure
that the delete operation doesn't get executed when the user hits refresh on
the resulting page.  Of course there may no longer be any data to delete, but
you might reservations about allowing DB operations to be retried after
they've already executed.


--- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> Thanks Vincent and Hubert, I will try both your suggestions
> 
> -Original Message-
> From: Vincent Lin [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 03, 2004 11:01 PM
> To: Struts Users Mailing List
> Subject: RE: Action not forwarding to another Action
> 
> 
> It is my opinion. Please correct me if I am wrong.
> 
> The JSP "DeleteOrder.jsp" submits to
> "/app/DeleteOrder.exe", 
> Therefore the parameter "orderNumber" can be seen in
> "/app/DeleteOrder.exe".
> After the part is deleted the action "/app/DeleteOrder.exe" forwards the
> page to "/app/ListOfOrder.exe". It is another http request, because the
> path
> attribute specified in  is only "/app/ListOfOrder.exe". Not
> "/app/ListOfOrder.exe?orderNumber=123".
> (You wouldn't know what the orderNumber will be when
> you write struts-config.xml)
> So the action "/app/ListOfOrder.exe" has no idea of "orderNumber".
> 
> A simple way to solve this problem is that
> you can save the "orderNumber" to request scope in "/app/DeleteOrder.exe".
> 
> request.setAttribute("orderNumber", new
> Integer(orderNumber));
> 
> And then retrieve it in "/app/ListOfOrder.exe".
> 
> Integer orderNumber = (Integer) request.getAttribute("orderNumber");
> 
> Regards,
> Vincent
> 
> --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> 
> > Bascaily what I would like to accomplish is to
> > delete a "part" from an order
> > form and then re-query the database to display the
> > list of parts.
> >  
> > "DeleteOrder.jsp":
> > - is a screen to confirm to delete part "XZY".
> > - it is of type OrderForm
> > - action = "/app/DeleteOrder"
> > - "orderNumber is a hidden field and is equal to
> > "123".  This is the key to
> > re-query the database later.
> > 
> > "OrderSearchAction":
> > - is the Action class to re-query the database with "orderNumber" 
> > after the deletion and re-display the list of parts on the
> > next screen.
> > I have this statement at the beginning of the Action
> > class to retrieve
> > "orderNumber ": 
> > String nbr = request.getParameter("orderNumber");
> > 
> > 
> > Struts-config.xml:
> > >   
> > type="com.cat.action.OrderMaintainAction"
> >name="OrderFormBean"
> >   scope="request"
> >validate="false">
> >  > path="/app/ListOfOrder.exe" />
> > 
> > 
> > 
> >  >   
> > type="com.cat.action.OrderSearchAction"
> >name="OrderSearchFormBean"
> >   scope="request"
> >validate="false">
> >  > path="/app/ListOfOrder.jsp"/>
> >  > path="/app/OrderError.jsp"/>
> > 
> > 
> > 
> > So when I hit 'submit' on "DeleteOrder.jsp", I
> > expect "orderNumber " to be
> > visible in "OrderSearchAction" in the Request object
> > but it is not.
> > Thanks for any help.   
> > 
> 
> 
> 
> -
> ÿÌ춼 Yahoo!ÆæĦ
> º£µÄîÉ«¡¢ïLµÄšâÏ¢¡¢ÛÄãµÄœØ¶È£¬±MÔÚÐżˆµ×ˆD
> http://tw.promo.yahoo.com/mail_premium/stationery.html
> 
> -
> 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!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: FileUpload and ActionForward

2004-03-03 Thread Hubert Rabago
There is a sample application that ships with Struts (struts-upload.war)
which shows how they wrapped commons-fileupload to work with ActionForms.  

Hubert

--- Tim Coy <[EMAIL PROTECTED]> wrote:
> I am trying to use
> org.apache.commons.fileupload within an ActionForward()
> to upload files.
> 
> Having created a
> DiskFileUpload fu = new DiskFileUpload();
> 
> And parsed it with
> 
> List fileItems = fu.parseRequest(request);
> 
> I find that fileItems.size() = 0
> 
> I seemed to be not able to get the required information out of the request,
> it appears to be empty.
> 
> Is it possible to do, will someone point me to an example?
> 
> 
> -- 
> Tim Coy
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Action not forwarding to another Action

2004-03-03 Thread Hubert Rabago
May I humbly suggest doing a redirect after you do your delete?

inside OrderMaintainAction, after the deletion:

// get the path we specified for "Content" in struts-config.xml
String path = mapping.findForward("Content").getPath();

// create the redirecting ActionForward we'll return
ActionForward redirect = new ActionForward();
redirect.setRedirect(true);
// append the order number that should be shown
redirect.setPath(path + "?orderNumber=" + nbr);
return redirect;

:)

Hubert

--- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> Bascaily what I would like to accomplish is to delete a "part" from an
> order
> form and then re-query the database to display the list of parts. 
>  
> "DeleteOrder.jsp":
> - is a screen to confirm to delete part "XZY".
> - it is of type OrderForm
> - action = "/app/DeleteOrder"
> - "orderNumber is a hidden field and is equal to "123".  This is the key to
> re-query the database later.
> 
> "OrderSearchAction":
> - is the Action class to re-query the database with "orderNumber" after the
> deletion and re-display the list of parts on the next screen.
> I have this statement at the beginning of the Action class to retrieve
> "orderNumber ": 
> String nbr = request.getParameter("orderNumber");
> 
> 
> Struts-config.xml:
>type="com.cat.action.OrderMaintainAction"
>name="OrderFormBean"
>   scope="request"
>validate="false">
> 
> 
> 
> 
> type="com.cat.action.OrderSearchAction"
>name="OrderSearchFormBean"
>   scope="request"
>validate="false">
> 
>   
> 
> 
> 
> So when I hit 'submit' on "DeleteOrder.jsp", I expect "orderNumber " to be
> visible in "OrderSearchAction" in the Request object but it is not.
> Thanks for any help.   
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: processForwardConfig / freeze() / IllegalStateException

2004-03-02 Thread Hubert Rabago
Instead of modifying an existing forward (not sure you shoulda been doing
that, anyway), you can try creating a new one.  Copy the properties of the
one you received, then pass that one on.

> if(userAgentHeader.lastIndexOf("Windows CE") != -1){
> // normal JSP forward Path (for non PIE browsers)
> String path = forward.getPath();
> 
> // append the suffix to the name of the JSP (index.jsp =>
> index_s.jsp)
> String modifiedPath = path.substring(0,path.lastIndexOf('.'));
> modifiedPath += symbolJspSuffix+
> path.substring(path.lastIndexOf('.'));
> 
> // set modifiedPath in the ForwardConfig
> //forward.setPath(modifiedPath);
  ForwardConfig temp = new ForwardConfig();
  temp.setPath(modifiedPath);
  // copy other properties
  forward = temp;
> }
> super.processForwardConfig(request, response, forward);


Hubert

--- Marc Logemann <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> i developed my own RequestProcessor (by inheritance and overriding) for
> some custom
> behavior. Actually this exactly:
> 
>protected void processForwardConfig(HttpServletRequest request,
> HttpServletResponse response, ForwardConfig forward) throws IOException,
> ServletException {
> 
> final String symbolJspSuffix = "_s";
> 
> String userAgentHeader = request.getHeader("User-Agent");
> if(userAgentHeader.lastIndexOf("Windows CE") != -1){
> // normal JSP forward Path (for non PIE browsers)
> String path = forward.getPath();
> 
> // append the suffix to the name of the JSP (index.jsp =>
> index_s.jsp)
> String modifiedPath = path.substring(0,path.lastIndexOf('.'));
> modifiedPath += symbolJspSuffix+
> path.substring(path.lastIndexOf('.'));
> 
> // set modifiedPath in the ForwardConfig
> forward.setPath(modifiedPath);
> }
> super.processForwardConfig(request, response, forward);
> }
> 
> ---
> 
> As you can see, i have two version of my JSPs and the alternate version of
> them
> is used on Windows CE devices. With my first action (a struts forward
> action),
> its running quite nice, but after going to the second, i get an
> IllegalStateException.
> 
> After reading some code, i discovered that the "configured" attribute is
> set
> and that i cant make any changes to the forward.path anymore, but this
> breaks
> my little nice routine. So when does the freeze() method gets called and
> how to avoid that?
> 
> When are ActionForwards "configured" and not modifiable anymore?
> I really like the hook in processFOrwardConfig and dont want to give it up.
> 
> Thanks for infos 
> 
> marc
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



RE: Action class calling other Action class

2004-03-01 Thread Hubert Rabago
Try changing updateSuccess path to reflect your actual relative URL:



- or whatever extension you're using.

--- Ramadoss Chinnakuzhandai <[EMAIL PROTECTED]> wrote:
> When I try to call actionA from actionB by forwarding to the path which
> mapped to actionA it is not actually invoking actionA.
> 
> I dont know what is wrong with my codefollowing is piece of my code
> 
>   path="/myaccount/domains"> 
> />  
>  
> 
> 
>  path="/myaccount/domains"> 
>  redirect="true" />
>  path="myaccount.dmdetails.dns.registered"/>
> 
> 
> Note: I hv tried  in the
> actionA but was getting exception from the server saying the bean does not
> contain the property secure.
> 
> Can you help me where Im doing wrong?
> 
> Tnx,
> 
> -Ramadoss
>   
> 
> 
> -Original Message-
> From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 27, 2004 5:18 PM
> To: Struts Users Mailing List
> Subject: RE: Action class calling other Action class
> 
> 
> You could do this by just forwarding to an action mapping entry for
> ActionClassB.
> 
> In you action mapping for ActionClassA, have multiple forwards.
> And the logic in ActionClassA would forward to whichever, with 1 of them
> being ActionClassB.
> 
>  type="ActionClassA"
>   name="form"
>   scope="request">
>/>
>   
>   
>  
> 
>  type="ActionClassB"
>   name="form"
>   scope="request">
>/>
>   
>path="/anyOther.jsp" />
>   
> 
> 
> hth
> -jayash
> 
> -Original Message-
> From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 27, 2004 12:29 PM
> To: [EMAIL PROTECTED]
> Subject: Action class calling other Action class
> 
> 
> Hi,
>   
> I hv ActionClassA ==>Display JSP of ActionClassA having a link to Edit
> JSP of ActionClassB==>ActionClassB=>Edit JSP of
> ActionClassB==>ActionClassB(Update records)=>dispatch control over
> to ActionClassA.
> 
> 
> My question is that  Can I forward my control to ActionClassA from
> ActionClassB? or is there any better approach/alternative??
> 
> Tnx in advance,
> 
> -Ramadoss
> 
> 
> 
> 
> 
> -
> 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]
> 


__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



Re: Capture array from form bean into struts action class

2004-03-01 Thread Hubert Rabago
Tons of samples with discussion in the archives.
http://marc.theaimsgroup.com/?l=struts-user&w=2&r=1&s=indexed&q=b
http://marc.theaimsgroup.com/?l=struts-user&m=107600405406119&w=2

--- as as <[EMAIL PROTECTED]> wrote:
> Any samples?
> Thanks
>  
> (BAsically I am trying to get list of shoping cart items from my jsp and
> retrieve them like an array to later send it to my ItemDeleteAction.java
> class for deleeion.But how to stor the delete array in request or
> session?Request.setParameter or session permits only String right? and not
> String array?
> Thanks.
> 
> 
> -
> Do you Yahoo!?
> Get better spam protection with Yahoo! Mail


__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



Re: Missing bean when validating

2004-02-28 Thread Hubert Rabago
http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg94386.html

hth,
Hubert

--- Martin Gross <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a form with a dropdown list:
>  labelProperty="name" />
> 
> The collection is set by an action which redirects to this form.
> 
>  type="de.evolt.newsletter.webgui.CampaignAction"  scope="request">
> 
> 
> 
> 
> 
> I use Validator to check the values of this form when submitting it.
> 
>  type="de.evolt.newsletter.webgui.CampaignAction" name="campaignForm" 
> scope="request" input="edit.campaign"  >
> 
> 
> 
> The problem is that I get an "Cannot find bean campaignList" error when 
> validation detects that a required field was not filled.
> 
> I could solve the problem putting campaignList into session scope. But 
> is there another solution without putting campaignList into session 
> scope (e.g. request scope)?
> 
> Regards,
> Martin
> 
> 

__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



RE: html:link action - how to append query string

2004-02-27 Thread Hubert Rabago
Have you tried
 
?

--- Leticia Golubov <[EMAIL PROTECTED]> wrote:
> I just don't understand why the 3rd option doesn't work for me...
> 
> I've tried all possible variations of it but I just can't seem to be able
> to
> parse
> <%value%> to the query string... does anybody know why?
> 
> so  doesn't work nor
> does
>  
> regards
> 
> -Original Message-
> From: Paul, R. Chip [mailto:[EMAIL PROTECTED]
> Sent: 27 February 2004 15:59
> To: 'Struts Users Mailing List'
> Subject: RE: html:link action - how to append query string
> 
> 
> You have I think three choices, in preferred order:
> 
> 1.  Use the paramName, paramScope, and paramProperty attributes of
> 
>   (see
> http://jakarta.apache.org/struts/userGuide/struts-html.html#link)
> This may not work with the page scoped variable defined the way you've
> done it, I don't know.
> 
> 2.  Use Struts-EL and add ${value} into your link string
> 
> 3.
> I think your core problem is to pass an variable without the param
> attributes you need to contstuct and send a URL, not the name of an action?
> 
> 
> 
> -Original Message-
> From: Leticia Golubov [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 27, 2004 9:50 AM
> To: Struts User Mailing List
> Subject: html:link action - how to append query string
> 
> 
> I have a simple question, for a change... :)
> 
> Given
> 
> <% String value="some Value" %>
> 
> and
> 
> 
> 
> how do I append the java var 'value' to the end of the action?
> 
> If I hardcode it, it works and the behaviour is as expected, i.e.:
> 
> 
> 
> Note I have tried the following and failed:
>
> Also searched on internet but didn't find anything as yet...
> 
> regards
> 
> NOTE: I don't want to use 
> in
> this instance...
> 
> 
> -
> 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]
> 


__
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools

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



RE: Problem in nested tags- Very Urgent - Please Help

2004-02-26 Thread Hubert Rabago
IIRC, you also need it in reset():

public class LazyListExampleForm extends ActionForm {
private List actionList;
 
public LazyListExampleForm () {
initLists();
}

public void reset(ActionMapping mapping, 
  HttpServletRequest request) {
super.reset(mapping, request);
initLists();
}
 
private void initLists() {
Factory factory = new Factory() {
public Object create() {
return new ActionListBean();
}
};
this.actionList = ListUtils.lazyList(new ArrayList(), factory);
}

// Getter/setters for list omitted
}

- Hubert

--- "Paul, R. Chip" <[EMAIL PROTECTED]> wrote:
> Note: I think this is likely different in current versions of the commons
> collections lib, but this works for the version we are dependent on.
> 
> import java.util.ArrayList;
> import java.util.List;
> import org.apache.commons.collections.Factory;
> import org.apache.commons.collections.ListUtils;
> // Nonrelevant imports ommitted
> 
> public class LazyListExampleForm extends ActionForm {
>   private List actionList;
> 
>   public LazyListExampleForm ()
>   {
>   Factory factory = new Factory() {
>public Object create() {
>return new ActionListBean();
>}
>};
>this.actionList = ListUtils.lazyList(new ArrayList(),
> factory);
>   }
> 
>   // Getter/setters for list omitted
> }
> 
> -Original Message-
> From: Mark Lowe [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 26, 2004 8:49 AM
> To: Struts Users Mailing List
> Subject: Re: Problem in nested tags- Very Urgent - Please Help
> 
> 
> wouldn't mind an example of how to use lazy list if you have one.
> 
> 
> On 26 Feb 2004, at 15:33, Paul, R. Chip wrote:
> 
> > Or use the Commons Collections LazyList which handles this problem 
> > automatically.
> >
> > -Original Message-
> > From: Mark Lowe [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 26, 2004 8:09 AM
> > To: Struts Users Mailing List
> > Subject: Re: Problem in nested tags- Very Urgent - Please Help
> >
> >
> > shirish posted this a few times.
> >
> > if you're scoping to request you'll need a while loop in your 
> > getFoo(int index)  method
> >
> > public class OrgManagementForm extends ActionForm {
> >
> > private List addressList = new ArrayList();
> >
> > public Address getAddress(int index) {
> > 
> > while(index >= addressList.size() ) {
> > this.addressList.add( new Address() );
> > }
> >
> > return (Address) addressList.get(index);
> > }
> >
> > bla bla.
> >
> > }
> >
> > look like it could be your problem.
> >
> >
> > On 26 Feb 2004, at 14:57, Parthasarathy Kesavaraj wrote:
> >
> >> I am having an OrganzationVO inside my form-bean.
> >>
> >> The OrganzationVO has a collection of AddressVOs.
> >>
> >> I am using nested tags like this.
> >>
> >>
> >> 
> >>
> >> >> styleClass="inputmand" tabindex="" />
> >>
> >>
> >>
> >>
> >>  >> styleClass="inputmand" tabindex="" />
> >>
> >>
> >>
> >> 
> >>
> >> while submitting the form I am getting an exception like this.
> >>
> >>
> >> 2004-02-26 18:17:08,133 [ExecuteThread: '12' for queue: 
> >> 'weblogic.kernel.Default'] DEBUG org.apache. 
> >> commons.beanutils.BeanUtils - 
> >> setProperty([EMAIL PROTECTED], orgVO.a 
> >> ddresses[0].company1, [get populated])
> >> getAddrVOAL-->[]
> >> 
> >> <[ServletContext(id=1735147,name=gbs,conte
> >> xt-path=/gbs)] Root cause of ServletException. 
> >> java.lang.ArrayIndexOutOfBoundsException
> >> at java.lang.reflect.Array.get(Native Method)
> >> at 
> >> org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Propert
> >> y
> >> U
> >> tils.
> >> java:525)
> >> at
> >> org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(Property 
> >> U
> >> tils.
> >> java:428)
> >> at
> >> org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyU 
> >> t
> >> ils.j
> >> ava:770)
> >> at
> >> org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.j 
> >> a
> >> va:80
> >> 1)
> >> at
> >> org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881)
> >> at
> >> org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
> >> at
> >> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
> >> at
> >> org.apache.struts.action.RequestProcessor.processPopulate(RequestProce 
> >> s
> >> sor.j
> >> ava:821)
> >> at
> >> org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav 
> >> a
> >> :254)
> >> at
> >> com.puma.gbs.action.RequestProcessor.process(RequestProcessor.java: 
> >> 133)
> >> at
> >> org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
> >> 1482)
> >> at
> >> org.apache.struts.action.ActionServl

Re: need help converting from session to request scope

2004-02-24 Thread Hubert Rabago

--- Janice <[EMAIL PROTECTED]> wrote:
> The only glitch is when validation fails, since my drop-downs come back
> empty.  So I'm thinking that I can get around this, but it'll mean extra
> database calls and be a performance problem that way instead of just
> hogging the session memory.  I guess this is why I was told this stuff had
> to be in the session... it all makes sense now.

That's where the three options come in.  You can leave the drop-down values
in the session, in the application scope, or in the request scope but use
input="/mySetupAction".  

Whether the form itself is in session or request scope doesn't affect how the
drop-downs get populated.

hth,
Hubert



__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: need help converting from session to request scope

2004-02-24 Thread Hubert Rabago
> off the phone for an hour!  The joy of telecommuting...)
 --> And I'm in an office, and it's nearing the end of the day, so we may
have to continue this later...


> the action mapping
> where I set up the scope=request is the same action mapping that does both
> ActionA (showForm) and ActionB (submitForm).  
 --> Cool.  I've done stuff like this, where it's the same action preparing
and processing forms.


> So why can't my .jsp find the stuff in my form?
 --> What's missing?  From what I understood, you were missing stuff like
options for a  control.  Can you elaborate?


> After reading Hubert's second email: Sorry, but could you clarify:
 --> I will, but first I need to make sure I made the correct assumptions
about what the issues are.  Won't be the first time I offered solutions to
the wrong problem.  :)


> "I can pass a formBean from ActionA via request to the .jsp to use and then
> when the user submits I will get a new formBean back via request"?
 --> Correct.


Hubert


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: need help converting from session to request scope

2004-02-24 Thread Hubert Rabago
Okay, I'll add a bit more since nobody else is.
>From what I understand, some of your scenarios are like this.  You have
ActionA to set up your Strings and ArrayLists etc to display FormA, and FormA
gets submitted to ActionB.  So, your config for these look something like:







To use request scope, you can either:
1) Leave your Strings/ArrayLists in session scope
2) Put them in application scope
3) Put them in request scope, then change your ActionB mapping to use ActionA
as input.  You'll need to make sure you don't reset FormA's values in ActionA
when it's for a redisplay.

I'm pretty sure this has been discussed in the list before, and that I've
typed the text for #3 before.
Anyway, choose one solution above (it's up to you and your reqts/situation)
and try it for one form.  If it works, try it for another form.

Hubert

--- Janice <[EMAIL PROTECTED]> wrote:
> Hi Gang,
> 
> I've been doing things badly... putting everything in session scope.  The
> good news is that everything works beautifully :)  But now that I've got
> 100+ actions I've decided to go put stuff into request scope.  The bad news
> is that everything grinds to a halt.
> 
> Here's an example of where I've added the scope to an action mapping:
> <--- snip --->
> input=".yearlyAllocationForm"
>parameter="action"
>type="ca.bc.gov.srm.bart.actions.YearlyAllocationActions"
>scope="request"
>name="yearlyAllocationForm"
>validate="false">
>   
>   
>/>
> 
> 
> Previously I'd left the scope line out.
> 
> So my now jsp page can't find my form goodies on the page.  It falls apart
> here:
> <--- snip --->
>   
>  value="yearCode" />
>   
> 
> with a NullPointerException.  But it did make it past here:
> <--- snip --->
>name="yearlyAllocationForm"
>   type="org.apache.struts.validator.DynaValidatorForm"
>   focus="yearCode">
> 
> which I guess I'm surprised at.
> 
> I'd love to put up all kinds of code, but I'm using DispatchActions, tiles,
> DynaValidatorForms, etc, so I'm not really sure where to start cutting and
> pasting.  If anyone has any requests for more info, I'd be happy to oblige.
> 
> Oh, this one looks important: in my method where I set up the form before
> passing it to the .jsp, I set up my form all pretty with lots of Strings
> and
> ArrayLists and then I do one of these:
> <--- snip --->
>   if ( "request".equals(mapping.getScope()) ) {
> request.setAttribute(mapping.getAttribute(), form);
>   } else {
> HttpSession session = request.getSession();
> session.setAttribute(mapping.getAttribute(), form);
>   }
> 
> which I thought was designed to handle this.
> 
> So, to make a long story short, what else do I need to do to switch from
> putting all my form beans in session scope to putting them in request
> scope?
> Do I need to tell the .jsp page to look somewhere else or something?
> 
> Thanks very much in advance,
> Janice
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: need help converting from session to request scope

2004-02-24 Thread Hubert Rabago
I'm just here to give my opinion on your "this one looks important" item.
Let's say you have ActionA to setup your form with lots of Strings and
ArrayLists as you said, and ActionB to which the form you're setting up
eventually gets submitted to.

In your ActionA, you're calling "request".equals(mapping.getScope()).  The
mapping object you have at this point is for ActionA, but the form's scope is
defined in ActionB, so mapping.getScope() doesn't give you the scope of the
form you're after.  That's why it's not working as you expected.

 - Hubert

--- Janice <[EMAIL PROTECTED]> wrote:
> Oh, this one looks important: in my method where I set up the form before
> passing it to the .jsp, I set up my form all pretty with lots of Strings
> and
> ArrayLists and then I do one of these:
> <--- snip --->
>   if ( "request".equals(mapping.getScope()) ) {
> request.setAttribute(mapping.getAttribute(), form);
>   } else {
> HttpSession session = request.getSession();
> session.setAttribute(mapping.getAttribute(), form);
>   }
> 
> which I thought was designed to handle this.
> 
> Thanks very much in advance,
> Janice
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: url pattern /do/* and modules

2004-02-23 Thread Hubert Rabago
No prob.
You may wanna take a look at the cool changes in Struts 1.2 as far as
switching modules are concerned.  Check the bottom of the "What's new?" in 
http://jakarta.apache.org/struts/userGuide/release-notes.html.  I haven't
used it yet, but from what I understand you can specify a "module=/xyz" in
your  to switch modules.  It was one of the last things added.

hth,
Hubert

--- Craig Laverty <[EMAIL PROTECTED]> wrote:
> Hubert Rabago  yahoo.com> writes:
> 
> > 
> > From the Struts user guide:
> > "WARNING - If you are using the new module support in Struts 1.1, you
> should
> > be aware that only extension mapping is supported."
> > 
> > http://jakarta.apache.org/struts/userGuide/configuration.html
> > Look for "5.4.2 Configure the Action Servlet Mapping" and check the
> warnings
> > at the bottom.
> > 
> > - Hubert
> 
> Thank you for the quick response and pointing out that only extension
> mapping 
> is supported for modules.  Now that I know it won't work as is, I may spend
> a 
> bit more time trying to trick it with my own SwitchAction.
> 
> Thanks Again,
> 
> Craig.
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



RE: Must have action="....." in tag?

2004-02-23 Thread Hubert Rabago
That's what I have on one of my forms right now.  I have a form which points
to one of my actions, and there are some links (column headings/filter
options) that the user can select so the form will get submitted to another
action.
  
The requirement that Roy Paul said must be met: the two actions must be using
the same form.  And as Roy suggested, you might also want to take a look at
DispatchAction.  That might make it easier for you to make this work, and
will also ensure that you're using the same form for both logic branches.

If you wanna try to make the javascript approach work, make sure you get the
URL correct, and that it points to the URL of the action as the browser would
see it.  This means including any extension or path that you use to map to
the Struts ActionServlet.  If you're using .do, you might try
"/app/fdd/shopWorkOrder/fromCreateShopWorkOrder.do"

hth,
Hubert


--- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> Paul and Hubert:
> If I do the following, just choose one of the paths to be the  action="...">, you mean the form action can still be "dynamically
> overwritten" by what is actually picked in the submitForm() action?  I
> thought I tried that and didn't work.
> 
> > > 
> > > function submitForm(frm)
> > > {
> > >var whichAction=frm.elements("whichAction")
> > > 
> > >if (whichAction == "create")
> > >{
> > >   document.theForm.action =
> > > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder";
> > >}
> > >else
> > >{
> > >   document.theForm.action =
> > > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder";
> > >}
> > > 
> > >return true;
> > > }
> > > 
> > > 
> > > 
> > >  > >  
> > > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
> > >  action="/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder" method="post"
> onSubmit="return submitForm(document.theForm)">
> 
> 
> -Original Message-
> From: Paul, R. Chip [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 5:23 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Must have action="." in  tag?
> 
> 
> You can't.
> 
> Correct me if I'm wrong, but the  property is what
> let's struts know which Form object to map your .jsp to.  I'm don't think
> this will work for you unless all the possible urls you'd submit to share
> the same Form.
> 
> What you may want to do instead then is look at something along the lines
> of
> DispatchAction, and pass a parameter that tells Struts which logical action
> it should forward to after hitting the for submit action (which would be a
> subclass of DispatchAction or something similar).
> 
> Of course you could do as the previous poster said and change the action to
> submit to in your javascript onSubmit function:
> 
> 
> function onSubmit() {
>   forms[0].action="/Some/New/Action.do";
>   return true;
> }
> 
> And then you'd put logic to decide where to actually submit to inside the
> onSubmit function.
> 
> -Original Message-
> From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 4:13 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Must have action="." in  tag?
> 
> 
> But I don't always want "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to
> be my action all the time.   I want the action for the form to be "dynamic"
> and depends on the form field "whichAction".  That's why I created the
> javascript function submitForm(frm) to pick the action "dynamically".  In
> other words, I have  in my struts-config.xml file for both
> path "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and
> "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder".  But I want whichever one
> to be chosen to be "dynamically". So  how I do that all within the
>  tag?
> 
> -Original Message-
> From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 4:58 PM
> To: Struts Users Mailing List
> Subject: RE: Must have action="." in  tag?
> 
> 
> I never said anything close to what you're asking me.
> All I said is choose one of your two possible outcomes (doesn't matter
> which
> one), take the path that you gave it in the struts-config.xml, then use
> that
> in your .  
> Let's say you have the

Re: url pattern /do/* and modules

2004-02-23 Thread Hubert Rabago
>From the Struts user guide:
"WARNING - If you are using the new module support in Struts 1.1, you should
be aware that only extension mapping is supported."

http://jakarta.apache.org/struts/userGuide/configuration.html
Look for "5.4.2 Configure the Action Servlet Mapping" and check the warnings
at the bottom.

- Hubert

--- Craig Laverty <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am looking for advice on how to get a struts application using the url-
> pattern /do/* to work for multiple modules.
> 
> Using the simple-modules-example I was able to get the default .do to work,
> 
> but the Ted Husted way /do/* does not.
> 
> works
> 
> path="/mod1/showIndex.do"/>
> 
> doesn't
> 
>path="/do/mod1/showIndex"/>
> 
> 
> This actually works, but it goes directly to a jsp and not through an
> action 
> mapping. I need it to go to an action mapping so I can setup my tiles.
> 
>   path="/do/switchToMod1?prefix=/mod1&page=/index.jsp"/>
> 
> Thanks in advance,
> 
> Craig.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



RE: Must have action="....." in tag?

2004-02-23 Thread Hubert Rabago
Isn't that what the onsubmit attribute in your  is for?

> --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:

But I don't always want "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to
be my action all the time.   I want the action for the form to be "dynamic"
and depends on the form field "whichAction".  That's why I created the
javascript function submitForm(frm) to pick the action "dynamically".  In
other words, I have  in my struts-config.xml file for both
path "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and
"/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder".  But I want whichever one
to be chosen to be "dynamically". So  how I do that all within the
 tag?


--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> I never said anything close to what you're asking me.
> All I said is choose one of your two possible outcomes (doesn't matter
> which
> one), take the path that you gave it in the struts-config.xml, then use
> that
> in your .  
> Let's say you have the ff entry in your struts-config:
> 
>  name="theForm">
> 
> 
> 
> then in your html:form, specify that action:
> 
> method="post" 
>onsubmit="return submitForm(document.theForm)">
> ...
> 
> 
> You do have 's associated with fromCreateShopWorkOrder and
> fromUpdateShopWorkOrder, right?
> 
>  - Hubert
> 
> 
> --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> > Hubert:
> > Can you elaborate that In othe words, how do I do everything that the
> > function submitForm() does to dynamically pick an action all within the
> >  tag? 
> > 
> > -Original Message-
> > From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, February 23, 2004 4:36 PM
> > To: Struts Users Mailing List
> > Subject: Re: Must have action="." in  tag?
> > 
> > 
> > Specify the Action associated with "fromCreateShopWorkOrder" or
> > "fromUpdateShopWorkOrder" in the  attribute.
> > 
> > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> > > Hi:
> > > My  tag doesn't allow me to skip an 'action' attribue.   If
> > you
> > > look at my code below, I move the assignment of the 'form action'  to 
> > > the javascript function so which action to take is dynamically depends 
> > > on the form element 'whichAction'.  But the compiler insist I have to 
> > > have the 'action' property right inside the  tag.  But that
> > doesn't allow
> > > me to choose the action dynamically.   Does anyone have any suggestion?
> > > 
> > > 
> > > function submitForm(frm)
> > > {
> > >var whichAction=frm.elements("whichAction")
> > > 
> > >if (whichAction == "create")
> > >{
> > >   document.theForm.action = 
> > > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder;
> > >}
> > >else
> > >{
> > >   document.theForm.action = 
> > > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder;
> > >}
> > > 
> > >return true;
> > > }
> > > 
> > > 
> > > 
> > >  > >  
> > > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
> > > 
> > > 
> > > 
> > > I got the following error with the above code:
> > > Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed:
> > > /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute
> 'action'
> > > not specified for tag 'form'
> > > probably occurred due to an error in
> > > /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28:
> > > 
> > > 
> > > 
> > > 
> > > 
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Mail SpamGuard - Read only the mail you want.
> > http://antispam.yahoo.com/tools
> > 
> > -
> > 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!?
> Yahoo! Mail SpamGuard - Read only the mail you want.
> http://antispam.yahoo.com/tools
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



RE: Must have action="....." in tag?

2004-02-23 Thread Hubert Rabago
I never said anything close to what you're asking me.
All I said is choose one of your two possible outcomes (doesn't matter which
one), take the path that you gave it in the struts-config.xml, then use that
in your .  
Let's say you have the ff entry in your struts-config:





then in your html:form, specify that action:


...


You do have 's associated with fromCreateShopWorkOrder and
fromUpdateShopWorkOrder, right?

 - Hubert


--- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> Hubert:
> Can you elaborate that In othe words, how do I do everything that the
> function submitForm() does to dynamically pick an action all within the
>  tag? 
> 
> -Original Message-
> From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 4:36 PM
> To: Struts Users Mailing List
> Subject: Re: Must have action="." in  tag?
> 
> 
> Specify the Action associated with "fromCreateShopWorkOrder" or
> "fromUpdateShopWorkOrder" in the  attribute.
> 
> --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> > Hi:
> > My  tag doesn't allow me to skip an 'action' attribue.   If
> you
> > look at my code below, I move the assignment of the 'form action'  to 
> > the javascript function so which action to take is dynamically depends 
> > on the form element 'whichAction'.  But the compiler insist I have to 
> > have the 'action' property right inside the  tag.  But that
> doesn't allow
> > me to choose the action dynamically.   Does anyone have any suggestion?
> > 
> > 
> > function submitForm(frm)
> > {
> >var whichAction=frm.elements("whichAction")
> > 
> >if (whichAction == "create")
> >{
> >   document.theForm.action = 
> > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder;
> >}
> >else
> >{
> >   document.theForm.action = 
> > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder;
> >}
> > 
> >return true;
> > }
> > 
> > 
> > 
> >  >  
> > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
> > 
> > 
> > 
> > I got the following error with the above code:
> > Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed:
> > /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action'
> > not specified for tag 'form'
> > probably occurred due to an error in
> > /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28:
> > 
> > 
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Mail SpamGuard - Read only the mail you want.
> http://antispam.yahoo.com/tools
> 
> -
> 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!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: Must have action="....." in tag?

2004-02-23 Thread Hubert Rabago
Specify the Action associated with "fromCreateShopWorkOrder" or
"fromUpdateShopWorkOrder" in the  attribute.

--- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote:
> Hi:
> My  tag doesn't allow me to skip an 'action' attribue.   If you
> look at my code below, I move the assignment of the 'form action'  to the
> javascript function so which action to take is dynamically depends on the
> form element 'whichAction'.  But the compiler insist I have to have the
> 'action' property right inside the  tag.  But that doesn't allow
> me to choose the action dynamically.   Does anyone have any suggestion?
> 
> 
> function submitForm(frm)
> {
>var whichAction=frm.elements("whichAction")
> 
>if (whichAction == "create")
>{
>   document.theForm.action =
> "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder;
>}
>else
>{
>   document.theForm.action =
> "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder;
>}
> 
>return true;
> }
> 
> 
> 
>   
> class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/>
> 
> 
> 
> I got the following error with the above code:
> Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: 
> /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action'
> not specified for tag 'form'
> probably occurred due to an error in
> /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28:
> 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: Urgent repost: How to avoid to print null on the screen

2004-02-23 Thread Hubert Rabago
I don't use bean:write a lot, so I'm not sure if there's a solution for this.
 It doesn't look like anyone else either.  If there aren't any alternatives,
and it's as urgent as your reposts suggest, why not subclass the tag and make
a new one which does what you want?  That would be much faster than waiting
3-4 days in the mailing list for a response.

--- [EMAIL PROTECTED] wrote:
> 
> 
> 
> 
> Hi,
> 
> 
> I am using  in a lot of places in my jsp's, Whenever the
> form bean property is null It prints "null" on the screen,  I was hoping
> if there could be some way in which I can force all null values to be
> printed as "" in my jsp's. I have tried giving  initial="" in my form
> property but If my Data Holder object contains null and I set it to the
> form bean then it still prints null.
> 
> 
> 
> I know one way of achieving this is using  every where
> but that's a huge amount change in jsp's we have 150 of them, If anybody
> can suggest a shortcut It would be of a great help
> 
> 
> Any help is greatly appreciated
> 
> 
> 
> Regards
> 
> 
> Anant
> 
> 
> 
> 
> 
> 
> 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.
> 
> 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]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: PlugIn TimerTask

2004-02-23 Thread Hubert Rabago
How are you creating your Timer() object?  If you're passing true ("new
Timer(true)") then the jvm will kill your timer task when then app ends.  If
you're just using "new Timer()" or passing false, well, then maybe you can
ask the Tomcat list.  :)

--- Guifre <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have implemented an automatic process in
> Struts/Tomcat by starting a Timer and scheduling a
> TimerTask in the init() method of a PlugIn class.
> 
> It works pretty well, except for one thing: if I stop
> Tomcat while the task is running, according to the
> Timer specification the task should be allowed to
> finish, but in fact it is ended in the middle of its
> process.
> 
> Is this a Struts effect? Can someone figure out how to
> fix this?
> 
> Thanks!
> 
> Guifre
> 

__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: ActionForms Thread Safe

2004-02-21 Thread Hubert Rabago
Different clients use different requests and different sessions.  Therefore,
different users end up with different AF instances.  If you use request scope
for your AF, then even different requests from the same client will be using
different AF instances.
hth,
Hubert

--- Amish Patel <[EMAIL PROTECTED]> wrote:
> Hello All,
> 
> I am new to struts.  I have been reading about it and they way I understand
> 
> the framework instantiate ActionForm is as follows. ..
> 
> 1) Check to see if an instance of the ActionForm already has been created.
> 
> 2) If an ActionForm instance is present in the appropriate scope and it's 
> the same type as needed for the new request, reuse it.
> Otherwise, create a new instance of the required ActionForm and store it in
> 
> the appropriate scope (set by the scope attribute for the action element).
> 
> 
> If this is case then ActionForm are not thread-safe.  Because Two request 
> from different client can simultaneous come in and use the same ActionForm 
> instance?
> 
> I know this is not the case, but I cannot figure out how is it thread safe?
> 
> Please help!
> Thanks
> -Semplice
> 
> _
> Get a FREE online computer virus scan from McAfee when you click here. 
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: multiple records in one form

2004-02-21 Thread Hubert Rabago
http://marc.theaimsgroup.com/?l=struts-user&m=107600405406119&w=2

--- "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi List, 
> 
> I would like to create a form, with which the user fills in a number of 
> say 10 records, in one and the same form. When clicking submit, 
> all of the 10 records (with each 4 fields) should be updated to the 
> database simulataneously. 
> 
> I found an item in the archives about this, but the answer, a single 
> phrase  "use indexed properties" was too cryptic for me as a 
> newby to struts. 
> 
> I know I have to use String array properties (String[])  in stead of 
> normal String properties, and use a tag, but I cannot 
> seem to get it to work. I am not sure how to set the exact 
> attributes of the logic:iterate tag, and how to point them to which 
> Collection, and I seem to have problems too with the id attribute of 
> logic:iterate: though I set it, the following  does not seem to connect to this id attribute - which it should if I 
> understand it well. I get an error that the bean with this name is 
> unknown.
> 
> Does somebody have a working example for me available, which I 
> could try out? I am real new to this, so I am afraid that short cryptic 
> answers won't do for me :-(  but working examples will help a lot 
> more... :-)
> 
> 
> thanks, Rinke
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: Problem in population of VO

2004-02-21 Thread Hubert Rabago
Not entirely certain but it sounds like you need to use ListUtils.lazyList()
for you type Y collection, and you'll need to override your form's reset()
method to do this as well.

- Hubert 

--- Parthasarathy Kesavaraj <[EMAIL PROTECTED]> wrote:
> 
> Hi
> 
> I am having a form bean that contains a VO(Say X)
> 
> This VO again contains an arraylist of VOs of type Y
> 
> While displaying I am getting VO - X and from that I am getting collection
> of Y, iterating it and displaying it in Text fields.
> 
> But when I again submit the form the collection of Y vos is not
> repopulating
> and the size is empty.
> 
> How can I do it?? Thanks in Advance.. 
> 
> 
> 
> With Regards
> 
> Partha
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: non-default init-params and default ActionServlet

2004-02-20 Thread Hubert Rabago
I might be missing something here, but why not get it inside the servlet
context initialized handler method?

public void contextInitialized(ServletContextEvent event) {
System.out.println("[contextInitialized] inside
contextInitialized()");
System.out.println(" +-> context=" + event.getServletContext());
ServletContext context = event.getServletContext();
Enumeration enumeration = context.getInitParameterNames();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
String value = context.getInitParameter(name);
System.out.println("init param: [" + name + "=" + value + "]");
}
}

public void contextDestroyed(ServletContextEvent event) {
System.out.println("[contextDestroyed] inside contextDestroyed()");
System.out.println(" +-> context=" + event.getServletContext());
}


--- exnihilo <[EMAIL PROTECTED]> wrote:
> I need the variables in a ServletContextListener that gets invoked once 
> on startup and once on shutdown of the application, and don't need them 
> anywhere else. I used to have a subclassed ActionServlet, where I did 
> initialization and shutdown using a couple of init-params in the 
> web.xml, but then I realized that using the default ActionServlet and 
> using a ServletContextListener was cleaner, except that now the 
> init-params no longer work. Ideally, I would like something as simple as 
> including them in the web.xml..
> 
> Does anybody know the justification for preventing non-default 
> init-params from being seen when using the default ActionServlet? It 
> seems like a very easy solution to a very common need.
> 
> thanks,
> 
> n.
> 
> Hubert Rabago wrote:
> 
> >Where do you need the values?  There are a lot of options, including using
> >servlet context variables and a simple Struts plugin.
> >
> >--- exnihilo <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>hi,
> >>
> >>I have 2 init-params that I need to do pass into my struts app (that are
> >>only used in a listener that gets called upon webapp startup and
> >>shutdown). I did the obvious and included them in the web.xml, but it
> >>seems that the default ActionServlet does not pick up any other
> >>init-params than the ones it expects (if I read the javadocs correctly),
> >>and that I need to subclass ActionServlet if I want to use other
> >>init-params than the default ones.
> >>
> >>Are there other options? It seems like overkill in this case, because
> >>the default ActionServlet is totally sufficient for my needs in all
> >>other regards. There is a probably a much better solution that I am not
> >>finding.
> >>
> >>Any ideas or pointers to more info?
> >>
> >>thanks,
> >>
> >>n.
> >>
> >>
> >>
> >>
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: non-default init-params and default ActionServlet

2004-02-20 Thread Hubert Rabago
Where do you need the values?  There are a lot of options, including using
servlet context variables and a simple Struts plugin.

--- exnihilo <[EMAIL PROTECTED]> wrote:
> hi,
> 
> I have 2 init-params that I need to do pass into my struts app (that are
> only used in a listener that gets called upon webapp startup and
> shutdown). I did the obvious and included them in the web.xml, but it
> seems that the default ActionServlet does not pick up any other
> init-params than the ones it expects (if I read the javadocs correctly),
> and that I need to subclass ActionServlet if I want to use other
> init-params than the default ones.
> 
> Are there other options? It seems like overkill in this case, because
> the default ActionServlet is totally sufficient for my needs in all
> other regards. There is a probably a much better solution that I am not
> finding.
> 
> Any ideas or pointers to more info?
> 
> thanks,
> 
> n.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: Extra Lines in Compiled JSP

2004-02-20 Thread Hubert Rabago
Try this:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"; prefix="bean"
%><%@ taglib uri="/display" prefix="display" 
%><%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html"
%><%@ taglib uri="http://jakarta.apache.org/struts/tags-nested";
prefix="nested" 
%><%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"; prefix="tiles"
%><%@ page language="java" 
%><%@ page contentType="text/html; charset=UTF-8" %>

The idea being you try to contain the \r\n inside the tags and outside the
template text.

--- Jerry Jalenak <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I should know how to fix this, but am at a loss.  At the top of my JSP I
> have the following lines:
> 
> 
> When I look at the compiled JSP, there are seven blank lines (i.e.
> out.write("\r\n"); ).  Is there anyway to have the JSP compiler (were
> running Tomcat 5.0.18 Stable) NOT generate these lines?  I guess they come
> from the <% %> sources lines, but it really screws up my generated HTML
> code
> 
> 
> Thanks!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be confidential
> and
> is intended solely for the use of the individual or entity to which it is
> addressed. If you are not the intended recipient or the person responsible
> for
> delivering the transmission to the intended recipient, be advised that you
> have received this transmission in error and that any use, dissemination,
> forwarding, printing, or copying of this information is strictly
> prohibited.
> If you have received this transmission in error, please immediately notify
> LabOne at the following email address: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: N by N multiboxes !!!

2004-02-18 Thread Hubert Rabago
Study the tutorials at www.keyboardmonkey.com for using the  Struts
tags.

--- Lawrence Williams <[EMAIL PROTECTED]> wrote:
>  
> Hi,
> 
> I am trying to generate a form allowing attributes in a catalog to be set
> on
> or off for particular products.
> 
> So depending on the state of the Database there will be N Attributes each
> with M slectable values (as attributes are added and new styles become
> available N and M will vary:
> 
> E.g. 
> 
> Color (red,blue.. N .., green)
> Size  (s,m,l,xl)
> .
> .
> N
> .
> .
> Weight (1,2,3)
> 
> 
> I want a jsp form to display all options for all defined attributes. I
> currently have a form:
> 
>  name="modifyAttributesForm"
> type="myproj.product.AttributeForm">
>  type="java.lang.String[]"/>
>  type="java.lang.Object[]"/>
> 
> 
> Where each attributeValues object array entry has in it a LabelValueBean[]
> array storing the values for each attribute.
> 
> At present ive got the form of checkboxes rendering using standard html
>  
>  varStatus="i">
>  var="valuePairs" varStatus="j">
>value="${valuePairs.value}">${valuePairs.label}
> 
> 
> 
> 
> I of course now want to use the struts multibox tag to handle all the
> repopulation for me. However, it seems to me the multibox control is only
> going to work for a single String[] array of populated values, I need a 2
> dimensional structure. 
> 
> I cant see how I can do this - perhaps I have hit a common pattern here - ?
> Any Ideas?
> 
> Lawrence
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.590 / Virus Database: 373 - Release Date: 16/02/2004
>  
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



Re: How to look up a global forward to get its "path" attribute

2004-02-18 Thread Hubert Rabago
Haven't tried this yet myself, but maybe you can:

ModuleConfig moduleConfig = RequestUtils.getModuleConfig(pageContext);
ForwardConfig forward = moduleConfig.findForwardConfig("login");
String path = forward.getPath();

RequestUtils has been refactored in the nightly build/Struts 1.2 so you might
need to adjust your getModuleConfig() call if you're using a post-1.1
version.

 - Hubert

--- "OFlaherty, Colm" <[EMAIL PROTECTED]> wrote:
> I have the following entry in my struts-config.xml file: 
> 
> 
>   
>   ...
> 
> 
> 
> 
> In a Tag Library, I have a String "login", and I want to get the string
> "/public_login.do" (ie, I want to look up the global forward to see the
> path it refers to).
> 
> What is the best way to do this??  
> 
> Thanks..
> 
> 
> **
> This message is sent in confidence for the addressee
> only.  The contents are not allowed to be disclosed to
> anyone other than the addressee.  Unauthorised 
> recipients must preserve this confidentiality and should 
> please advise the sender immediately of any error in
> transmission.
> **
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools

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



RE: Problem Dynamically creating form properties

2004-02-18 Thread Hubert Rabago
Yes, it would be a plugin like Tiles and Validator.  You provide an xml so
it'll know what forms to create.  When the plugin gets called by Struts at
startup, it digests the xml and looks for the business objects you've listed.
 It creates FormBeanConfig objects (the internal Struts descriptor for a
form-bean) based on them, then registers them in Struts. 

--- Marco Mistroni <[EMAIL PROTECTED]> wrote:
> Hi Hubert,
>   I would be very interested in it...or at least
> If u can describe me how the whole process works..
> By plugin you mean struts-plugin? 
> 
> Regards   
>   marco
> 
> -Original Message-
> From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> Sent: 17 February 2004 19:24
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
> 
> As long as we're sharing... =)
> 
> I wrote a plug-in which defines my DynaActionForms based on my DTOs.  So
> if I
> have an employee DTO, it will define a DynaActionForm for me with the
> fields
> from my employee DTO.  It helps me cut down on the repetition when my
> DTO
> closely matches my form beans.  The form bean definition can add onto
> the
> definition to allow it to hold non-DTO values such as submit buttons and
> other values.
> 
> It also knows to convert between the fields of the DTO to and from the
> form
> bean, kinda like BeanUtils.copyProperties.
> 
> It can also support formatting the data, so my users can enter dates or
> formatted numbers such as "123,456.00" instead of "123456.00" without me
> having to format the data in my action objects and parse it back upon
> submission.
> 
> And to further cut down on the repetition, I've also moved all form-bean
> definitions and form validation rules into one XML, so all the form
> information is together instead of in separate config files.
> 
> I'm looking to share this if anybody's interested.  I'm finishing up
> unit
> tests and docs for it.
> 
> - Hubert
> 
> --- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> > I have a version of DynaBean based on the MutableDynaClass interface
> which
> > allows properties to be added dynamically - which anyone would be free
> to
> > use (I tried to attach here but struts-user rejected the mail saying
> "we
> > don't accept executable content" ). We have also equivalent versions
> of the
> > DynaValidatorForm and DynaValidatorActionForm based on this  "dynamic"
> > DynaBean.
> > 
> > Advantages - no more ActionForm declarations, but it still the
> "standard"
> > DynaBean and can plug into the Validator framework.
> > 
> > LazyDynaBean - "dynamic" DynaBean
> > LazyDynaClass - implements the MutableDynaClass interface
> > 
> > LazyValidatorForm - etension of ValidatorForm which is backed by
> > LazyDynaBean (equivalent to DynaValidatorForm)
> > LazyValidatorActionForm - path based LazyValidatorForm (equivalent to
> > DynaValidatorActionForm)
> > 
> > I can email this directly to anyone who wants it - or even better if
> > someone
> > could offer/suggest a site to load it up to.
> > 
> > Niall
> > 
> > 
> > 
> > - Original Message - 
> > From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 17, 2004 2:07 PM
> > Subject: RE: Problem Dynamically creating form properties
> > 
> > 
> > > Actually, not today, because this development we made is not Open
> > > Source, but who knows... may we remake it and open it for free use.
> > >
> > > Cheers.
> > > Guillermo
> > >
> > > -Original Message-
> > > From: Paul-J Woodward [mailto:[EMAIL PROTECTED]
> > > Sent: Martes, 17 de Febrero de 2004 10:41 a.m.
> > > To: Struts Users Mailing List
> > > Subject: RE: Problem Dynamically creating form properties
> > >
> > >
> > > That sounds excellent, is it available for use?
> > >
> > > Paul
> > > 
> > > Global Equity Derivatives Technology
> > > Deutsche Bank [/]
> > > 
> > >
> > >
> > >
> > >
> > > "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > 17/02/2004 09:43
> > > Please respond to "Struts Users Mailing List"
> > >
> > >
> > >

Re: File Upload and DynaActionForm?

2004-02-17 Thread Hubert Rabago

Did you change the form definition to enctype="multipart/form-data" yet?

--- Carl-Eric Menzel <[EMAIL PROTECTED]> wrote:
> 
> Hello,
> 
> I'm having trouble getting file upload working when using a DynaAction
> form. Here are the relevant parts:
> 
>  name="pollForm"
> type="org.apache.struts.action.DynaActionForm"
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  type="java.lang.String"/>
> 
>  type="org.apache.struts.upload.FormFile"/>
> 
> 
> ...and in the tile: 
> 
> It worked before, only without the file upload stuff - that is a new
> addition. Now that I added this FormFile property, I get the following
> from the tile:
> [ServletException in:/pages/editor/editPoll.jsp] No getter method for
> property tickets of bean org.apache.struts.taglib.html.BEAN'
> 
> Any ideas on what I might be doing wrong?
> 
> Thanks
> Carl-Eric
> -- 
> Carl-Eric Menzel * OpenPGP KeyID 808F4A8E * Encrypted Messages Preferred
> | "Of course, on the system *I* administrate, vi is symlinked to   |
> |  ed. Emacs has been replaced by a shell script which 1) Generates a  |
> |  syslogmessage at level LOG_EMERG; 2) reduces the user's disk quota  |
> |  by 100K; and 3) RUNS ED!" - Patrick J. LoPresti |
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Problem Dynamically creating form properties

2004-02-17 Thread Hubert Rabago
Cool!  I'll write something up tonight that'll provide more info and send it
to you so you can see where it's at.

--- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> Your stuff sounds interesting and I'm up for a bit of collaboration.
> 
> Niall
> - Original Message - 
> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 17, 2004 7:31 PM
> Subject: Re: Problem Dynamically creating form properties
> 
> 
> > I meant to say "I wonder if we can combine what we have."
> >
> > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > > Niall,
> > >
> > > I wonder if we can what we have.
> > > I wonder what that would look like.
> > > Could be interesting.
> > >
> > > Hubert
> > >
> > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > > > As long as we're sharing... =)
> > > >
> > > > I wrote a plug-in which defines my DynaActionForms based on my DTOs.
> So
> > > if
> > > > I
> > > > have an employee DTO, it will define a DynaActionForm for me with the
> > > > fields
> > > > from my employee DTO.  It helps me cut down on the repetition when my
> DTO
> > > > closely matches my form beans.  The form bean definition can add onto
> the
> > > > definition to allow it to hold non-DTO values such as submit buttons
> and
> > > > other values.
> > > >
> > > > It also knows to convert between the fields of the DTO to and from
> the
> > > form
> > > > bean, kinda like BeanUtils.copyProperties.
> > > >
> > > > It can also support formatting the data, so my users can enter dates
> or
> > > > formatted numbers such as "123,456.00" instead of "123456.00" without
> me
> > > > having to format the data in my action objects and parse it back upon
> > > > submission.
> > > >
> > > > And to further cut down on the repetition, I've also moved all
> form-bean
> > > > definitions and form validation rules into one XML, so all the form
> > > > information is together instead of in separate config files.
> > > >
> > > > I'm looking to share this if anybody's interested.  I'm finishing up
> unit
> > > > tests and docs for it.
> > > >
> > > > - Hubert
> > > >
> > > > --- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> > > > > I have a version of DynaBean based on the MutableDynaClass
> interface
> > > > which
> > > > > allows properties to be added dynamically - which anyone would be
> free
> > > to
> > > > > use (I tried to attach here but struts-user rejected the mail
> saying
> > > "we
> > > > > don't accept executable content" ). We have also equivalent
> versions
> of
> > > > the
> > > > > DynaValidatorForm and DynaValidatorActionForm based on this
> "dynamic"
> > > > > DynaBean.
> > > > >
> > > > > Advantages - no more ActionForm declarations, but it still the
> > > "standard"
> > > > > DynaBean and can plug into the Validator framework.
> > > > >
> > > > > LazyDynaBean - "dynamic" DynaBean
> > > > > LazyDynaClass - implements the MutableDynaClass interface
> > > > >
> > > > > LazyValidatorForm - etension of ValidatorForm which is backed by
> > > > > LazyDynaBean (equivalent to DynaValidatorForm)
> > > > > LazyValidatorActionForm - path based LazyValidatorForm (equivalent
> to
> > > > > DynaValidatorActionForm)
> > > > >
> > > > > I can email this directly to anyone who wants it - or even better
> if
> > > > > someone
> > > > > could offer/suggest a site to load it up to.
> > > > >
> > > > > Niall
> > > > >
> > > > >
> > > > >
> > > > > - Original Message - 
> > > > > From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > > > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > > > > Sent: Tuesday, February 17, 2004 2:07 PM
> > > > > Subject: RE: Problem Dynamically creating form 

RE: Problem Dynamically creating form properties

2004-02-17 Thread Hubert Rabago
Yes, they were going to be my first option, too.

--- Guillermo Meyer <[EMAIL PROTECTED]> wrote:
> We could ask to struts.sourceforge.net guys if they are interested in
> this kind of Struts extension.
> 
> -Original Message-----
> From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
> Sent: Martes, 17 de Febrero de 2004 04:31 p.m.
> To: Struts Users Mailing List
> Subject: Re: Problem Dynamically creating form properties
> 
> 
> I meant to say "I wonder if we can combine what we have."
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > Niall,
> > 
> > I wonder if we can what we have.
> > I wonder what that would look like.
> > Could be interesting.
> > 
> > Hubert
> > 
> > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > > As long as we're sharing... =)
> > > 
> > > I wrote a plug-in which defines my DynaActionForms based on my DTOs.
> 
> > > So
> > if
> > > I
> > > have an employee DTO, it will define a DynaActionForm for me with 
> > > the fields from my employee DTO.  It helps me cut down on the 
> > > repetition when my DTO closely matches my form beans.  The form bean
> 
> > > definition can add onto the definition to allow it to hold non-DTO 
> > > values such as submit buttons and other values.
> > > 
> > > It also knows to convert between the fields of the DTO to and from 
> > > the
> > form
> > > bean, kinda like BeanUtils.copyProperties.
> > > 
> > > It can also support formatting the data, so my users can enter dates
> 
> > > or formatted numbers such as "123,456.00" instead of "123456.00" 
> > > without me having to format the data in my action objects and parse 
> > > it back upon submission.
> > > 
> > > And to further cut down on the repetition, I've also moved all 
> > > form-bean definitions and form validation rules into one XML, so all
> 
> > > the form information is together instead of in separate config 
> > > files.
> > > 
> > > I'm looking to share this if anybody's interested.  I'm finishing up
> 
> > > unit tests and docs for it.
> > > 
> > > - Hubert
> > > 
> > > --- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> > > > I have a version of DynaBean based on the MutableDynaClass 
> > > > interface
> > > which
> > > > allows properties to be added dynamically - which anyone would be 
> > > > free
> > to
> > > > use (I tried to attach here but struts-user rejected the mail 
> > > > saying
> > "we
> > > > don't accept executable content" ). We have also equivalent 
> > > > versions of
> > > the
> > > > DynaValidatorForm and DynaValidatorActionForm based on this  
> > > > "dynamic" DynaBean.
> > > > 
> > > > Advantages - no more ActionForm declarations, but it still the
> > "standard"
> > > > DynaBean and can plug into the Validator framework.
> > > > 
> > > > LazyDynaBean - "dynamic" DynaBean
> > > > LazyDynaClass - implements the MutableDynaClass interface
> > > > 
> > > > LazyValidatorForm - etension of ValidatorForm which is backed by 
> > > > LazyDynaBean (equivalent to DynaValidatorForm) 
> > > > LazyValidatorActionForm - path based LazyValidatorForm (equivalent
> 
> > > > to
> > > > DynaValidatorActionForm)
> > > > 
> > > > I can email this directly to anyone who wants it - or even better 
> > > > if someone could offer/suggest a site to load it up to.
> > > > 
> > > > Niall
> > > > 
> > > > 
> > > > 
> > > > - Original Message -
> > > > From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, February 17, 2004 2:07 PM
> > > > Subject: RE: Problem Dynamically creating form properties
> > > > 
> > > > 
> > > > > Actually, not today, because this development we made is not 
> > > > > Open Source, but who knows... may we remake it and open it for 
> > > > > free use.
> > > > >
> > > > > Cheers.
> > > > > Guillermo
> > > > >
> > > > > -Original Message-

Re: Problem Dynamically creating form properties

2004-02-17 Thread Hubert Rabago
I meant to say "I wonder if we can combine what we have."

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> Niall,
> 
> I wonder if we can what we have.
> I wonder what that would look like.
> Could be interesting.
> 
> Hubert
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > As long as we're sharing... =)
> > 
> > I wrote a plug-in which defines my DynaActionForms based on my DTOs.  So
> if
> > I
> > have an employee DTO, it will define a DynaActionForm for me with the
> > fields
> > from my employee DTO.  It helps me cut down on the repetition when my DTO
> > closely matches my form beans.  The form bean definition can add onto the
> > definition to allow it to hold non-DTO values such as submit buttons and
> > other values.
> > 
> > It also knows to convert between the fields of the DTO to and from the
> form
> > bean, kinda like BeanUtils.copyProperties.
> > 
> > It can also support formatting the data, so my users can enter dates or
> > formatted numbers such as "123,456.00" instead of "123456.00" without me
> > having to format the data in my action objects and parse it back upon
> > submission.
> > 
> > And to further cut down on the repetition, I've also moved all form-bean
> > definitions and form validation rules into one XML, so all the form
> > information is together instead of in separate config files.
> > 
> > I'm looking to share this if anybody's interested.  I'm finishing up unit
> > tests and docs for it.
> > 
> > - Hubert
> > 
> > --- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> > > I have a version of DynaBean based on the MutableDynaClass interface
> > which
> > > allows properties to be added dynamically - which anyone would be free
> to
> > > use (I tried to attach here but struts-user rejected the mail saying
> "we
> > > don't accept executable content" ). We have also equivalent versions of
> > the
> > > DynaValidatorForm and DynaValidatorActionForm based on this  "dynamic"
> > > DynaBean.
> > > 
> > > Advantages - no more ActionForm declarations, but it still the
> "standard"
> > > DynaBean and can plug into the Validator framework.
> > > 
> > > LazyDynaBean - "dynamic" DynaBean
> > > LazyDynaClass - implements the MutableDynaClass interface
> > > 
> > > LazyValidatorForm - etension of ValidatorForm which is backed by
> > > LazyDynaBean (equivalent to DynaValidatorForm)
> > > LazyValidatorActionForm - path based LazyValidatorForm (equivalent to
> > > DynaValidatorActionForm)
> > > 
> > > I can email this directly to anyone who wants it - or even better if
> > > someone
> > > could offer/suggest a site to load it up to.
> > > 
> > > Niall
> > > 
> > > 
> > > 
> > > - Original Message - 
> > > From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, February 17, 2004 2:07 PM
> > > Subject: RE: Problem Dynamically creating form properties
> > > 
> > > 
> > > > Actually, not today, because this development we made is not Open
> > > > Source, but who knows... may we remake it and open it for free use.
> > > >
> > > > Cheers.
> > > > Guillermo
> > > >
> > > > -Original Message-
> > > > From: Paul-J Woodward [mailto:[EMAIL PROTECTED]
> > > > Sent: Martes, 17 de Febrero de 2004 10:41 a.m.
> > > > To: Struts Users Mailing List
> > > > Subject: RE: Problem Dynamically creating form properties
> > > >
> > > >
> > > > That sounds excellent, is it available for use?
> > > >
> > > > Paul
> > > > 
> > > > Global Equity Derivatives Technology
> > > > Deutsche Bank [/]
> > > > 
> > > >
> > > >
> > > >
> > > >
> > > > "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > > 17/02/2004 09:43
> > > > Please respond to "Struts Users Mailing List"
> > > >
> > > >
> > > > To: "'Struts Users Mailing List'"
> &

Re: Problem Dynamically creating form properties

2004-02-17 Thread Hubert Rabago
Niall,

I wonder if we can what we have.
I wonder what that would look like.
Could be interesting.

Hubert

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> As long as we're sharing... =)
> 
> I wrote a plug-in which defines my DynaActionForms based on my DTOs.  So if
> I
> have an employee DTO, it will define a DynaActionForm for me with the
> fields
> from my employee DTO.  It helps me cut down on the repetition when my DTO
> closely matches my form beans.  The form bean definition can add onto the
> definition to allow it to hold non-DTO values such as submit buttons and
> other values.
> 
> It also knows to convert between the fields of the DTO to and from the form
> bean, kinda like BeanUtils.copyProperties.
> 
> It can also support formatting the data, so my users can enter dates or
> formatted numbers such as "123,456.00" instead of "123456.00" without me
> having to format the data in my action objects and parse it back upon
> submission.
> 
> And to further cut down on the repetition, I've also moved all form-bean
> definitions and form validation rules into one XML, so all the form
> information is together instead of in separate config files.
> 
> I'm looking to share this if anybody's interested.  I'm finishing up unit
> tests and docs for it.
> 
> - Hubert
> 
> --- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> > I have a version of DynaBean based on the MutableDynaClass interface
> which
> > allows properties to be added dynamically - which anyone would be free to
> > use (I tried to attach here but struts-user rejected the mail saying "we
> > don't accept executable content" ). We have also equivalent versions of
> the
> > DynaValidatorForm and DynaValidatorActionForm based on this  "dynamic"
> > DynaBean.
> > 
> > Advantages - no more ActionForm declarations, but it still the "standard"
> > DynaBean and can plug into the Validator framework.
> > 
> > LazyDynaBean - "dynamic" DynaBean
> > LazyDynaClass - implements the MutableDynaClass interface
> > 
> > LazyValidatorForm - etension of ValidatorForm which is backed by
> > LazyDynaBean (equivalent to DynaValidatorForm)
> > LazyValidatorActionForm - path based LazyValidatorForm (equivalent to
> > DynaValidatorActionForm)
> > 
> > I can email this directly to anyone who wants it - or even better if
> > someone
> > could offer/suggest a site to load it up to.
> > 
> > Niall
> > 
> > 
> > 
> > - Original Message - 
> > From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> > To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 17, 2004 2:07 PM
> > Subject: RE: Problem Dynamically creating form properties
> > 
> > 
> > > Actually, not today, because this development we made is not Open
> > > Source, but who knows... may we remake it and open it for free use.
> > >
> > > Cheers.
> > > Guillermo
> > >
> > > -Original Message-
> > > From: Paul-J Woodward [mailto:[EMAIL PROTECTED]
> > > Sent: Martes, 17 de Febrero de 2004 10:41 a.m.
> > > To: Struts Users Mailing List
> > > Subject: RE: Problem Dynamically creating form properties
> > >
> > >
> > > That sounds excellent, is it available for use?
> > >
> > > Paul
> > > 
> > > Global Equity Derivatives Technology
> > > Deutsche Bank [/]
> > > 
> > >
> > >
> > >
> > >
> > > "Guillermo Meyer" <[EMAIL PROTECTED]>
> > > 17/02/2004 09:43
> > > Please respond to "Struts Users Mailing List"
> > >
> > >
> > > To: "'Struts Users Mailing List'"
> > > <[EMAIL PROTECTED]>
> > > cc:
> > > Subject:RE: Problem Dynamically creating form
> properties
> > >
> > >
> > > I previuosly posted a mail to this list asking why DynaForms are called
> > > Dynamic if you have to declare them statically in Struts-Config. But
> > > there was no answer :(
> > >
> > > We created in our project a DynamicBean (previous DynaBean release and
> > > when Struts 1.1 was no available) and extended ActionForm to be a
> holder
> > > of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
>

Re: Problem Dynamically creating form properties

2004-02-17 Thread Hubert Rabago
As long as we're sharing... =)

I wrote a plug-in which defines my DynaActionForms based on my DTOs.  So if I
have an employee DTO, it will define a DynaActionForm for me with the fields
from my employee DTO.  It helps me cut down on the repetition when my DTO
closely matches my form beans.  The form bean definition can add onto the
definition to allow it to hold non-DTO values such as submit buttons and
other values.

It also knows to convert between the fields of the DTO to and from the form
bean, kinda like BeanUtils.copyProperties.

It can also support formatting the data, so my users can enter dates or
formatted numbers such as "123,456.00" instead of "123456.00" without me
having to format the data in my action objects and parse it back upon
submission.

And to further cut down on the repetition, I've also moved all form-bean
definitions and form validation rules into one XML, so all the form
information is together instead of in separate config files.

I'm looking to share this if anybody's interested.  I'm finishing up unit
tests and docs for it.

- Hubert

--- Niall Pemberton <[EMAIL PROTECTED]> wrote:
> I have a version of DynaBean based on the MutableDynaClass interface which
> allows properties to be added dynamically - which anyone would be free to
> use (I tried to attach here but struts-user rejected the mail saying "we
> don't accept executable content" ). We have also equivalent versions of the
> DynaValidatorForm and DynaValidatorActionForm based on this  "dynamic"
> DynaBean.
> 
> Advantages - no more ActionForm declarations, but it still the "standard"
> DynaBean and can plug into the Validator framework.
> 
> LazyDynaBean - "dynamic" DynaBean
> LazyDynaClass - implements the MutableDynaClass interface
> 
> LazyValidatorForm - etension of ValidatorForm which is backed by
> LazyDynaBean (equivalent to DynaValidatorForm)
> LazyValidatorActionForm - path based LazyValidatorForm (equivalent to
> DynaValidatorActionForm)
> 
> I can email this directly to anyone who wants it - or even better if
> someone
> could offer/suggest a site to load it up to.
> 
> Niall
> 
> 
> 
> - Original Message - 
> From: "Guillermo Meyer" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 17, 2004 2:07 PM
> Subject: RE: Problem Dynamically creating form properties
> 
> 
> > Actually, not today, because this development we made is not Open
> > Source, but who knows... may we remake it and open it for free use.
> >
> > Cheers.
> > Guillermo
> >
> > -Original Message-
> > From: Paul-J Woodward [mailto:[EMAIL PROTECTED]
> > Sent: Martes, 17 de Febrero de 2004 10:41 a.m.
> > To: Struts Users Mailing List
> > Subject: RE: Problem Dynamically creating form properties
> >
> >
> > That sounds excellent, is it available for use?
> >
> > Paul
> > 
> > Global Equity Derivatives Technology
> > Deutsche Bank [/]
> > 
> >
> >
> >
> >
> > "Guillermo Meyer" <[EMAIL PROTECTED]>
> > 17/02/2004 09:43
> > Please respond to "Struts Users Mailing List"
> >
> >
> > To: "'Struts Users Mailing List'"
> > <[EMAIL PROTECTED]>
> > cc:
> > Subject:RE: Problem Dynamically creating form properties
> >
> >
> > I previuosly posted a mail to this list asking why DynaForms are called
> > Dynamic if you have to declare them statically in Struts-Config. But
> > there was no answer :(
> >
> > We created in our project a DynamicBean (previous DynaBean release and
> > when Struts 1.1 was no available) and extended ActionForm to be a holder
> > of DynamicBean (somethind like this: ((DynamicForm)form).getModel()
> > returns a DynamicBean with all properties.)
> >
> > So, we add html:text fields to the JSP and these are populated to this
> > DynamicForm without the need of declaring this property anywhere. And we
> > have optionall Contract asserter to verify properties in a DynamicBean
> > when needed (usually when using DynamicBean as a DTO between Actions and
> > Business delegates)
> >
> > Cheers.
> > Guillermo.
> >
> >
> > -Original Message-
> > From: Bernard Gaughran [mailto:[EMAIL PROTECTED]
> > Sent: Martes, 17 de Febrero de 2004 07:11 a.m.
> > To: [EMAIL PROTECTED]
> > Subject: Problem Dynamically creating form properties
> >
> >
> > Can someone PLEASE help?
> >
> > I need to create a User Interface (in JSP) which
> > presents the user with a number of input fields. The
> > number of input fields is not known until run-time
> > (based on user selections in a previous screens).
> >
> > The 2 issues I see are:
> > 1. generating the JSP dynamically with the correct
> > number of properties
> > 2. accessing these form fields in the action class.
> >
> > Normally, form property definitions need to be
> > defined at compile time (whether you use Action Forms
> > or DynaForms)
> >
> > Ideally, I'd like to use the struts framew

Re: Persisting Messages/Errors when redirect="true"

2004-02-12 Thread Hubert Rabago

It's at http://www.rabago.net/struts/redirect/ .

I think I use this similar to how you described your situation.

I have an Action which would do an insert/update/delete and on a successful
operation I like to redirect to a list/view page with an success/error
message.  That way my users don't get that annoying "Re-post form?" box when
they refresh, and I'm not chaining actions that do different things.

Not sure if it matters to you, but the last guy who asked for it (Manjunath)
needed several error messages with their property names preserved.  I didn't
need that but promised him I'll change it for him.  If you need several error
messages with different property names, I'll probably have that version ready
next week.  If not, this should work fine for you.

 - Hubert

--- David Erickson <[EMAIL PROTECTED]> wrote:
> Ya I'd be interested to see your code if at all possible =)
> Thanks,
> David
> 
> - Original Message - 
> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, February 09, 2004 7:49 PM
> Subject: Re: Persisting Messages/Errors when redirect="true"
> 
> 
> > There's no built-in support for this at the moment.  I add code to my
> > projects to add that support.  I can share the code with you if you want.
> >
> > - Hubert
> >
> > --- David Erickson <[EMAIL PROTECTED]> wrote:
> > > Is it possible to persist Messages/Errors around your site through the
> > > request when setting redirect="true" on an action mapping?  An example
> I
> > > have right now is I have a delete action that forwards to a
> listContacts.do
> > > action on success.. however its persisting url parameters from my
> delete
> > > request that is interfering with my listcontacts action. If i set
> > > redirect='true' though it empties my request =(.  Help!
> > > Thanks
> > > -David
> > >
> > > (Plus I can't be the only one forwarding from action->action.. and it
> gets
> > > really annoying seeing the old action url listed in the url even though
> > > your
> > > on a new one)
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Finance: Get your refund fast by filing online.
> > http://taxes.yahoo.com/filing.html
> >
> > -
> > 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!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Errors or messages or??

2004-02-10 Thread Hubert Rabago
The deprecation is for the nightly build/Struts 1.2 distribution.  If you're
using 1.1 (like I am), there's no saveErrors(request, actionMessages) just
yet.

Once you start using 1.2 (or the nightly build), you can use the saveErrors()
that accepts ActionMessages; the one which accepts ActionErrors has been
marked deprecated there.

hth,
Hubert

--- Mark Lowe <[EMAIL PROTECTED]> wrote:
> I was in the same boat, thinking that html:errors tag was up for 
> deprecation, but no. Just ActionErrors are, ActionMessages can be 
> rendered using html:errors.
> 
> 
> On 10 Feb 2004, at 17:10, Slattery, Tim - BLS wrote:
> 
> >> With Struts 1.1, we have support for both error messages and
> >> non-error messages.  We use saveMessages() for non-error and
> >> saveErrors() for error messages.  In our JSPs, we can use the
> >>  tag to display them:
> >
> > OK, that helps. But can you tell me why I can't use saveErrors with an
> > ActionMessages object?
> >
> > I have something like this:
> >
> > ActionMessage newError = new ActionMessage("error.generic.placeholder",
> > msg);
> > ActionMessages errors = new ActionMessages();
> > errors.add( ActionMessages.GLOBAL_MESSAGE, newError );
> > saveErrors( request, errors );
> >
> > And I get this error message:
> >
> > saveErrors(javax.servlet.http.HttpServletRequest,
> > org.apache.struts.action.ActionErrors) in 
> > org.apache.struts.action.Action
> > cannot be applied to (javax.servlet.http.HttpServletRequest,
> > org.apache.struts.action.ActionMessages)
> >
> > According to the javadoc, there's a deprecated saveErrors that takes an
> > ActionErrors object, and a non-deprecated one that takes an 
> > ActionMessages
> > object. This message is apparently telling me that the non-deprecated 
> > one
> > doesn't exist. I'm using Struts 1.1.
> >
> >
> > --
> > Tim Slattery
> > [EMAIL PROTECTED]
> >

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Errors or messages or??

2004-02-10 Thread Hubert Rabago
With Struts 1.1, we have support for both error messages and non-error
messages.  We use saveMessages() for non-error and saveErrors() for error
messages.  In our JSPs, we can use the  tag to display them:









The  tag gives  access to the individual messages
(you can specify a property name for more specific messages).  To
differentiate error and non-error messages, you set the "message" attribute. 
It defaults to false (IIRC), so  ...
 will iterate through the error messages.

Hope that didn't get you even more confused.  =)

- Hubert

--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]> wrote:
> I'm still trying to figure out the new method for reporting errors to the
> user. We  create an ActionMessage (instead of an ActionError), we add that
> to an ActionMessages object (instead of ActionErrors) and we use
>  in the JSP instead of . Right so far?
> 
> In the javadoc for the Action object, it shows a saveMessages method. The
> description says:
> 
> Save the specified messages keys into the appropriate request attribute for
> use by the  tag (if messages="true" is set), if any messages
> are required. Otherwise, ensure that the request attribute is not created. 
> 
> What's this about "messages=true"? Where does that get set? 
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: unsuccessful in keyboard monkey's nesting tutorial... please help :)

2004-02-09 Thread Hubert Rabago
The latest  tags are already included with the Struts 1.1
distribution.

--- mariel hizon <[EMAIL PROTECTED]> wrote:
> 
> Hi! Actually, i just downloaded the nest extension tutorial war file from
> www.keyboardmonkey.com and tried to make it work.  This jsp code (the
>  Apparently it's not, because when i changed the   extension that won't run. I browsed a lot of mail archives and saw that
> some people also had a problem with it, though their solution doesn't work
> for me. 
> 
> I'm wondering if it's possible that the nested-tags.tld and the
> nested_tags.jar included in the war tutorial are not compatible with the
> jars that i have? I hope someone can help me. Thanks!
> 
> part of tutorial.jsp ... everything's fine if i just change the
>  find bean null in any scope" with  
> 
>   Monkey Name: 
>   Monkey Age: 
>   Submit Form
>   
> 
> 
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Array of text fields generated dynamically

2004-02-09 Thread Hubert Rabago
I don't have the code with me right now, but I learned to solve this with the
sample code from:
http://www.developer.com/java/other/article.php/2233591

On your , you need to use the name and property attributes, and
set indexed=true.

This is an excerpt from the article.

  
  
  


You can also look at the  tags and the tutorials from
keyboardmonkey.com.

--- Shyam A <[EMAIL PROTECTED]> wrote:
> Hubert, 
> Thanks again for your mail. I have not tried using
> mapped properties, instead I stuck to my original idea
> of using an array of text fields/hidden fields with
> corresponding String[] in my form bean.
> 
> I have a problem with validating the array of text
> fields,i.e., if there is a validation error, the
> values entered in the text fields are not retained.
> 
> Given below is the message I posted to 'struts-user'.
> 
> Do you think using indexed properties will help solve
> my problem? If yes, could you send a sample?
> 
> Hope it is not a bother.
> 
> Thanks,
> Shyam
> 
> 
> Hi,
> 
> I use a String[] in my form bean to handle a dynamic
> array of text fields.
> 
> In my ActionForm, I have
> 
> private String[] candList;
> 
> public String[] getCandList()
> {
> return candList;
> }
> 
> public void setCandList(String[] aCandList)
> {
> candList = aCandList;
> }
> 
> 
> 
> In my JSP, I use
>   
>  maxlength="25"/> 
> 
> within a  tag.
> 
> My problem is that when a validation error occurs in
> the validate() method of my form bean, the text fields
> are populated with junk values. The text fields do not
> retain the user entered values. However, the user
> entered values can be printed out in the validate()
> method.
> 
> How do I work around this problem?
> 
> Any help, suggestions/pointers will be greatly
> appreciated.
> 
> Thanks,
> Shyam
> 
> 
> 
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > Sorry, but I haven't tried anything with mapped
> > properties yet.  All I've
> > done are indexed properties.
> > Ask this on the user list.  I'm sure someone who's
> > tried it will respond.
> > 
> > Hubert
> > 
> > --- Shyam A <[EMAIL PROTECTED]> wrote:
> > > Hubert,
> > > 
> > > Sorry to re-open my issue. I'm having trouble in
> > > getting started with mapped properties due to time
> > > constraints. Do you have any code sample (Form
> > > Bean/JSP)?
> > > 
> > > Thanks,
> > > Shyam
> > > 
> > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > > > Your timing was nice because that's just the
> > problem
> > > > I was solving yesterday.
> > > > Hope that helped.
> > > > 
> > > > --- Shyam A <[EMAIL PROTECTED]> wrote:
> > > > > Hubert,
> > > > > 
> > > > > Thanks for your help. I really appreciate it.
> > > > > 
> > > > > Shyam
> > > > > --- Hubert Rabago <[EMAIL PROTECTED]>
> > wrote:
> > > > > >
> > > > >
> > > >
> > >
> >
> http://jakarta.apache.org/struts/faqs/indexedprops.html
> > > > > >
> > > > >
> > > >
> > >
> >
> http://www.developer.com/java/other/article.php/2233591
> > > > > > 
> > > > > > Also, 
> > > > > >
> > > > >
> > > >
> > >
> >
> http://marc.theaimsgroup.com/?l=struts-user&s=LazyList
> > > > > > 
> > > > > > - Hubert 
> > > > > > 
> 

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Setting nocache

2004-02-09 Thread Hubert Rabago
Take a look at Struts transaction tokens.  That will help provide your Action
with a flag to ignore successive transactions (in this case, logins), even
when the user hits "ok" on the resend prompt. 
If you don't want the user to even see the resend prompt, you can redirect to
the view after the transaction.  Even with a redirect, though, you might
still want to add the transaction token checking.

 - Hubert

--- [EMAIL PROTECTED] wrote:
> Hi Jay:
>  Thanks for the response. That didn't have the intended result but, it
> appears to be working when I look at the headers.
>  Maybe my goal's not clear?
>  Outline of steps in my web app. and where I want to prevent repost as
> follows:
> 1) http://:/afadmin/
>   presents login form
> 
> 2) On successful login user info is stored in session and user is
> forwarded to view:
> http://:/afadmin/console.afr
> At the moment this is just simple page with a header, menu, body and
> footer.
> 
>  If you hit the refresh at this view the browser still has the post data
> from the login view and if I click "OK" it re-sends the login information.
> 
> Is there a way to prevent the repost on the client end? Or, at least
> indicate to the client that I'd like it to forget about the post
> information from the previous view?
> Or, am I approaching this incorrectly? Should I just ignore the re-post in
> my loginAction ?
>   I found this but, in my present state of mind (too darned tired) it
> seems like overkill:
>  http://www.livinglogic.de/Struts/
> 
> Thanks,
> -Ryan
> 
> > In your struts-config.xml  element, thus:
> >
> > 
> >
> > 
> >
> > 
> >
> > Jay
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Persisting Messages/Errors when redirect="true"

2004-02-09 Thread Hubert Rabago
There's no built-in support for this at the moment.  I add code to my
projects to add that support.  I can share the code with you if you want.

- Hubert

--- David Erickson <[EMAIL PROTECTED]> wrote:
> Is it possible to persist Messages/Errors around your site through the
> request when setting redirect="true" on an action mapping?  An example I
> have right now is I have a delete action that forwards to a listContacts.do
> action on success.. however its persisting url parameters from my delete
> request that is interfering with my listcontacts action. If i set
> redirect='true' though it empties my request =(.  Help!
> Thanks
> -David
> 
> (Plus I can't be the only one forwarding from action->action.. and it gets
> really annoying seeing the old action url listed in the url even though
> your
> on a new one)
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: how to specify HTML attribute when HTML Tag does not have corresponding attribute

2004-02-09 Thread Hubert Rabago
Are you talking about adding that to the struts distro?  I just suggested
that today and it was shot down.  =(

http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=23975

Maybe someone else has solved this problem before and is willing to help?


--- "Nimmons, Buster" <[EMAIL PROTECTED]> wrote:
> Fair enough... I'm thinking If I have to subclass and create this attribute
> would there be any forseeable harm in making an "unsupportedAttribute" and
> pass in the key/value pair combination to be rendered (IE.  unsupportedAttribute="wrap='hard'" property="description" cols="30"
> rows="2"/>) that way I don't have to go through this every time I need to
> use a new attribute.
> 
> -Original Message-
> From: Hubert Rabago [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 09, 2004 2:41 PM
> To: Struts Users Mailing List
> Subject: Re: how to specify HTML attribute when HTML Tag does not have
> corrosp onding attribute
> 
> 
> If you need an attribute that isn't supported, you have to subclass the tag
> class and add that support.
> 
> And sorry, but no, I haven't tried it yet.  
> 
> --- "Nimmons, Buster" <[EMAIL PROTECTED]> wrote:
> > 
> >   I'm using the textarea tag in a page, however I need to specify the
> wrap
> > attribute as hard so text is sent to the server with carriage returns and
> > line feeds in place. Since the TEXTAREA HTML tag does not have a wrap
> > attribute how can I tell it to render the correct html wrap attribute
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
> 
> -
> 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!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: how to specify HTML attribute when HTML Tag does not have corrosp onding attribute

2004-02-09 Thread Hubert Rabago
If you need an attribute that isn't supported, you have to subclass the tag
class and add that support.

And sorry, but no, I haven't tried it yet.  

--- "Nimmons, Buster" <[EMAIL PROTECTED]> wrote:
> 
>   I'm using the textarea tag in a page, however I need to specify the wrap
> attribute as hard so text is sent to the server with carriage returns and
> line feeds in place. Since the TEXTAREA HTML tag does not have a wrap
> attribute how can I tell it to render the correct html wrap attribute
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: ActionErrors deprecated?

2004-02-09 Thread Hubert Rabago
It's the new and improved way to display messages on your pages. 
 sometimes needed html markup on the message resources file to
format the messages properly.  The new  tag gives the JSP full
control over formatting, which is where it should be.

--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]> wrote:
> > in jsp use this:
> > 
> > 
> >
> > 
> 
> Maybe I'm dumb, but I can't make any sense of this. Use it for what?
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: ActionErrors deprecated?

2004-02-09 Thread Hubert Rabago
There's one thing I forgot to mention.  That statement I made is for the
nightly build/Struts 1.2.  ActionError isn't marked as deprecated in 1.1.  

Are you talking about the ActionForm.validate() method?  For the nightly
build, yes, that looks about right.  The  tag in the nightly
build doesn't even reference ActionError/s in the code -- it works with
ActionMessage/s objects.  I'm guessing they can't deprecate ActionErrors yet
because it's in validate()'s signature.

For errors in your Action class, try Wendy's suggestion.  

Wendy, are you using that code with 1.1?  I haven't tried it yet.  Now that I
think about it, I'll start asking my teammates to start using these in Action
classes.  If it works, then better to write new Action classes that way than
to add more soon-to-be-deprecated code.

--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]> wrote:
> > Yes, we're supposed to use ActionMessage and ActionMessages 
> > now.  The one place where we can't escape ActionError/s yet is 
> > ActionForm's validate method.
> 
> Wait a minute!!! ActionError is marked as deprecated, but not ActionErrors.
> It looks to me like we create an ActionMessage, add that to an ActionErrors
> collection, and use  to display the contents of that on the
> JSP page.
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: ActionErrors deprecated?

2004-02-09 Thread Hubert Rabago
Yes, we're supposed to use ActionMessage and ActionMessages now.  The one
place where we can't escape ActionError/s yet is ActionForm's validate
method.


--- "Slattery, Tim - BLS" <[EMAIL PROTECTED]> wrote:
> While refreshing my memory on the ActionErrors class, I noticed that the
> metho:
> 
> void add (String, ActionError)
> 
> Is deprecated, in favor of:
> 
> void add(String, ActionMessage)
> 
> with a note that this (first signature) method will be removed after Struts
> 1.2. What exactly is this trying to tell us? Are we supposed to drop
> ActionError entirely in favor of ActionMessage? There's no deprecation note
> in the description of ActionError. What's happening here?
> 
> --
> Tim Slattery
> [EMAIL PROTECTED]


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: Need to modify the URL path of the forward dynamically

2004-02-09 Thread Hubert Rabago
Actually, the conversation on the thread "redirect=true & ActionErrors" has
moved to direct email communication.  If anybody's interested, I can post an
update to this list.  About two emails should cover it.  

--- Manjunath Bhat <[EMAIL PROTECTED]> wrote:
> Hi,
> You may look into this URL,
> http://issues.apache.org/bugzilla/show_bug.cgi?id=866 , which addresses
> similar(same) issue.
> 
> Also follow the thread "redirect=true & ActionErrors" in this list.  
> 
> Manjunath
> 
> 
> 
> 
> -Original Message-
> From: Max Cooper [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 09, 2004 2:54 PM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: Need to modify the URL path of the forward dynamically
> 
> Andrew's procedure is what my team has done on one project, too.
> Originally,
> we tried getting the ActionForward and changing it directly, but it
> turns
> out that is a shared instance and changing the original was messing up
> other
> requests. After we discovered this problem, we switched to Andrew's
> scheme
> of creating a new ActionForward to return from the Action.
> 
> I posted a message today with a note about dynamically adding a query
> string
> to an ActionForward in the "URL does not change even after changing
> action"
> thread. This thread has the details about how to do that.
> 
> I am interested to hear from other folks if they have a novel way to do
> this
> (i.e. add a query string to an ActionForward). Anybody got a better way?
> 
> -Max
> 
> - Original Message - 
> From: "Andrew Hill" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Monday, February 09, 2004 12:36 AM
> Subject: RE: Need to modify the URL path of the forward dynamically
> 
> 
> > Need to modify the URL path of the forward dynamicallyGet the Forward
> > instance as usual. Obtain its url string using getPath(). Add your
> > additional parameter to end of string and create a new ActionForward
> > instance that uses the decorated path (and copies the redirect
> property
> from
> > the original action forward), and return this new actionforward
> instance.
> >   -Original Message-
> >   From: Swaminathan Rajagopalan [mailto:[EMAIL PROTECTED]
> >   Sent: Monday, 9 February 2004 16:34
> >   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> >   Cc: Kamal_Poddar
> >   Subject: Need to modify the URL path of the forward dynamically
> >
> >
> >   Hi,
> >
> >   We have a URL in the path attribute of a forward for an action. We
> need
> to
> > dynamically append some request variables to this URL in the action
> class,
> > for they are available only at execution time. How can this be
> achieved?
> >
> >   E.g
> > >
> >
> type="xxx.yyy.zzz.web.control.action.AdditionalAccountInfoScreenAction"
> >  name="additionalAccountInfoForm"
> >  validate="false"
> >  input="previousPage"
> >  parameter="populateStmt"
> >  scope="session">
> >path="http://www.xyz.com/checks/";
> >
> >   To the URL path here e.g http://www.xyz.com/checks we need to add
> > accessId=xxx at run time in the action
> > class(http://www.xyz.com/checks?accessId=xxx).
> >
> >   Please let us know how this can be done?
> >
> >   Regards,
> >   Swaminathan Rajagopalan,
> >   Ph : (8520261) Extn: 55955
> >   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]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: R: repost: validator & retrieving data

2004-02-05 Thread Hubert Rabago
The values that you read from the DB need to come from somewhere.
Perhaps you can store them in a session attribute (then clear it once the
form passes validation).  Oh, yeah, an action has to prepare them, so maybe
you can use the same action, except that before it reads from the DB, it
checks if the values are already available from session attributes.

- Hubert 

--- Leonardo Francalanci <[EMAIL PROTECTED]> wrote:
> I don't think I made myself clear.
> 
> I can't set the input of the "process" action to the jsp of the prepare
> action because in the prepare action I get data from the db to
> fill a listbox.
> 
> If I used your solution in case of a validation error my list box
> would not be filled.
> 
> But if I set the input to the "prepare" action the values the user entered
> would be resetted to the values in the db.
> 
> That's way I need to know, in the prepare action, if I'm coming
> from a validation error or a simple "GET".
> Did I make myself clearer?
> 
> Thank you
> 
> > -Messaggio originale-
> > Da: Alvaro Martinez [mailto:[EMAIL PROTECTED]
> > Inviato: venerdì 5 dicembre 2003 16.56
> > A: Struts Users Mailing List
> > Oggetto: Re: repost: validator & retrieving data
> >
> >
> > I don't know if the proposal of Anant works. I know my proposal
> > works well.
> > You must use the same bean in the page "proccess" and the page "prepare".
> > For e.g.
> >> type=""
> > name="bean"
> > scope="request">
> >
> >   
> >> type=""
> > name="bean"
> > scope="request"
> > input="/prepare.jsp"
> > validate="true">
> >
> >   
> >
> > Alvaro Martinez
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, February 05, 2004 3:52 PM
> > Subject: RE: repost: validator & retrieving data
> >
> >
> >
> > Sorry there was a typo in last one
> >
> > Hi,
> >
> > You don't need to have two actions but you can have different mappings
> > for the same action class
> >
> > For e.g.
> > 
> > 
> > 
> >  > validate="true" input="abcErrorShow">
> > 
> > 
> > 
> > 
> > 
> >
> >
> > Now in the action class use
> >
> > If(mapping.getPath().equals(abcdisplay)){
> > Get data from backend
> > }
> > Else if(mapping.getPath().equals(abcProcess)){
> > Process data from backend
> > }
> > Else if(mapping.getPath().equals(abcErrorShow)){
> > Populate data from form bean itself
> > }
> >
> >
> > Regards
> >
> > Anant
> >
> > -Original Message-
> > From: Leonardo Francalanci [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 05, 2004 5:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: repost: validator & retrieving data
> >
> >
> > I'm sorry but nobody answered my question...
> > Could somebody help me?
> >
> >
> > I'm using validator for my pages. Searching the mailing list I found
> > that I should use 2 actions:
> >
> > "If there are 2 actions, one to "prepare" the page and one to "process"
> > the user input, we define the input attribute value of the "process"
> > action mapping to be the URL of the "prepare" action."
> >
> > I think it's right, but now I have this problem:
> > The "prepare" page retrieves data from the db. If validation fails, the
> > user is forwarded from the "process" action to the "prepare" action. In
> > this case I don't want to retrieve data from the db, but leave what
> > the user entered before. In other words I want to retrieve data only if
> > the user asked for the "prepare" action, not when he is redirected to
> > the "prepare" action from the input property of "process" action.
> >
> > Is there a way to do that?
> >
> > The only way i found is an hidden field, but I don't like it...
> >
> >
> >
> > -
> > 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-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additio

Re: Array of text fields generated dynamically

2004-02-05 Thread Hubert Rabago
http://jakarta.apache.org/struts/faqs/indexedprops.html
http://www.developer.com/java/other/article.php/2233591

Also, 
http://marc.theaimsgroup.com/?l=struts-user&s=LazyList

- Hubert 

--- Shyam A <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a scenario in my Struts application, where I
> have an array of text fields grouped by category on a
> JSP, and these are generated dynamically.
> 
> eg.
> Category A
> text field 1
> text field 2
> text field 3
> 
> Category B
> text field 1
> text field 2
> 
> 
> 
> 
> The issue here is how to handle the values of the text
> fields in my form bean. What I plan to do is to have a
> String array for the text fields, and also a
> corresponding array of hidden fields, to identify the
> category.
> 
> Is this the best way to handle this situation?
> 
> Any help/suggustions/pointers will be greatly
> appreciated.
> 
> Thanks,
> Shyam
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



Re: Action without ActionForm

2004-02-04 Thread Hubert Rabago
You can also declare a dummy form.







  
  
 
 ...

- Hubert

--- Srinivas Kusunam <[EMAIL PROTECTED]> wrote:
> 
> If there is no ActionForm  doesn't work. Try with normal 
> tag it works fine.
> 
> Hope this helps.
> 
> Srini
> 
> 
> >>> [EMAIL PROTECTED] 02/04/04 07:00PM >>>
> 
>   Hi ,all
> 
>   I am new to Struts and learning it.
> 
>   And I am wondering how the strtus-config.xml and JSP look like when
>   a  JSP doesn't submit any info( dont need ActionForm) .
> 
>   The JSP just display the current time and has one button "refresh".
> 
>   CurrentTime.jsp ( user push refresh button)
>   -> CurrentTimeAction(get current time and put it  to Session Attribute)
>-> CurrentTime.jsp ( get time from Session and render)
> 
>   I have made the JSP without Struts framework . it works .
> 
>   but I have no idea how I can make this with action mapping in
> struts-config.xml.
>   I made the mapping below and I got error when I try to open the JSP .
>   JSP is using  tag to make form.
> 
> javax.servlet.jsp.JspException: Cannot retrieve definition for form bean
> null
> 
> but i dont need any ActionForm
> -
>   
> type="com.somecompany.CurrentTimeAction">
>  
>  
>  
> -
> I have already checked the which attribute of action tag is mandatory or 
> optional .
> Should I make dummy ActionForm  ?
> 
> 
> Any comments are appriciated.
> 
>   Masashi Nakane 
> 
> 
> -
> 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!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: question about wildcard support in Struts

2004-02-04 Thread Hubert Rabago
http://jakarta.apache.org/struts/faqs/helping.html#release
=P

--- Emily Gu <[EMAIL PROTECTED]> wrote:
> Thanks for your quick reply. Yes, as you said, it is working in the nightly
> 
> builds.
> I just tried it. Do you have any idea when the Struts 1.2 will be release?
> 
> Thanks,
> Emily
> 
> At 03:26 PM 2/4/2004 -0800, Hubert Rabago wrote:
> >AFAIK, as of now, this is only available from the nightly builds.
> >
> >http://cvs.apache.org/builds/jakarta-struts/nightly/
> >
> >--- Emily Gu <[EMAIL PROTECTED]> wrote:
> > > Hi All,
> > >
> > > The user guide shows the Struts is supporting "wildcard in action
> > > mapping.".
> > > I have tried it in Struts 1.1, it seems doesn't. Do you have any
> idea
> > > on which
> > > version of Struts supports wildcard? Any help will be greatly
> > > appreciated.
> > >
> > > Thanks,
> > > Emily
> > >


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: question about wildcard support in Struts

2004-02-04 Thread Hubert Rabago
AFAIK, as of now, this is only available from the nightly builds.

http://cvs.apache.org/builds/jakarta-struts/nightly/

--- Emily Gu <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> The user guide shows the Struts is supporting "wildcard in action 
> mapping.".
> I have tried it in Struts 1.1, it seems doesn't. Do you have any idea 
> on which
> version of Struts supports wildcard? Any help will be greatly
> appreciated.
> 
> Thanks,
> Emily
> 
> 

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



RE: Accessing ActionForm from Servlet (was: Pajes + Struts)

2004-02-04 Thread Hubert Rabago
Hi Fred(d)y,

> (3) Despite 1 and 2, there must be a method to obtain the ActionForm(s)
> associated to an Action (during an specific request / post). Right?

I think this question has been answered twice in this very thread, once by
me, and again (and with code) by Andrew Hill.  

>From Andrew's response, with some editing:
String scope = mapping.getScope(); 
String attribute = mapping.getAttribute(); 
ActionForm yourForm = null;
if ("request".equals(scope)) {
yourForm = (ActionForm) request.getAttribute(attribute);
} else {
yourForm = (ActionForm) request.getSession().getAttribute(attribute);
}

If you don't want to pass around the mapping, then you'll need to know the
attribute under which the form is kept, and that defaults to the form's name
as declared in the  declaration.  Also, you've indicated you want
the form in request scope, so you can go straight to checking the request
attributes.

--- "Villalba Arias, Fredy [BILBOMATICA]" <[EMAIL PROTECTED]> wrote:
> Hi 
> 
> I don't know for sure. That's why I asked if I was right... :)
> 
> Anyway:
> 
> (1) How do you associate 2 ActionForms to the same Action (and have
> them automatically associated and populated by Struts)?
> 
> (2) Assuming 1 is possible (I'd really appreciate if you could explain
> me how to acomplish that), what sense does it make to have 2 ActionForms
> variables if only one form can be submitted at a time anyways? (maybe
> I'm missing something else)
> 
> (3) Despite 1 and 2, there must be a method to obtain the ActionForm(s)
> associated to an Action (during an specific request / post). Right?
> 
> Regards,
> Freddy.
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: Accessing ActionForm from Servlet (was: Pajes + Struts)

2004-02-03 Thread Hubert Rabago
I definitely haven't used Pajes, but if the servlet is on the same web app,
perhaps your servlet can access the form in the request attribute.
More comments below

--- "Villalba Arias, Fredy [BILBOMATICA]" <[EMAIL PROTECTED]> wrote:
> HOWEVER, I have not solved yet the data access method part. I MUST
> BE ABLE TO RECOVER THE APPROPRIATE ActionForm object FROM THAT Servlet
> (actually, in a factory class, but I don’t want to bother you with all
> the details) so that the view-generating class can “paint”, WITHOUT
> REPLICATING THE ActionForm Management (especially, the scopes management)
> ALREADY PERFORMED BY Struts. HOW CAN I DO THAT???
>  
> (1) Is there some method (+ class) that, given an Action class
> (/classname),
> returns the ActionForm object its currently associated to? (if any)

Not sure this would be possible.  The actual ActionForm in use depends on the
session, and sometimes even the particular request.  I doubt there's a way to
get to the form object actually in use by just specifying the action class.
If it's the *class* of the ActionForm you want, check out the ActionMapping
object for a particular mapping.

> (2) What’s the minimal information that one needs to retrieve an Action’s
> corresponding ActionForm object?

I would say the request object.

> (3) How can I do it from an ordinary Servlet?

request.getAttribute(formName);
or 
session.getAttribute(formName);
 depending on the scope of the form as declared in struts-config.

> Note that I’m trying to avoid passing it through the Session. My initial
> idea was to take advantage of the classes behind the tag libs that do this,
> but from what I’ve seen so far (I mean, its source code), that is not
> possible (the code is too tied to a JSP environment).
> 
> This is my first “effort”. Therefore, I’m not worried about being able to
> 
> do EVERYTHING that can be done through the tag libs. For now, the only
> 
> thing I look forward is to be able to recover the appropriate ActionForm
> 
> object associated to that Action from where redirection took place
> 
> (ActionForward, that is).
> 
>  
> 
> I’d really appreciate any thoughts on this matter.
> 
>  
> 
> Thanks everybody,
> 
> Freddy.
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.459 / Virus Database: 258 - Release Date: 25/02/2003
>  
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



Re: Why doesn't ActionForm's constructor have access to HttpServletRequest?

2004-02-02 Thread Hubert Rabago
Not sure how your app is configured, but perhaps you could call an Action to
prepopulate your ActionForm, or help it by passing it the request object.

--- Jeff Skubick <[EMAIL PROTECTED]> wrote:
> Is the absence of a reference to the HttpServletRequest object that
> triggered the creation of a new ActionForm object in its constructor a
> historical artifact or oversight, or was it an intentional decision whose
> motivation and rationale remains 100% valid and relevant today?
> 
> At the moment, I'm in a quandry. I see no way to usefully use nested form
> beans to encapsulate administrable users in my web app without somehow
> getting a hold of a list of objects representing those administrable users
> from the session context of the user who's administering them (the list's
> composition depends partially upon the user doing the administration) so I
> can prepopulate the list for its initial display. 
> 
> On the other hand, I'm worried that ActionForm's original creator was
> absolutely determined to keep ActionForm's constructor from ever knowing
> anything about the user or request that triggered its creation in the first
> place for some reason, like Struts casually re-using old ActionForm
> instances to satisfy new requests. On the other hand, I know it might just
> be a historical artifact that seemed like a good idea at the time, but
> doesn't really have any major implications either way.
> 
> So... if I implement my own RequestProcessor class that overrides the
> default processActionForm method to call my own ActionForm-extending bean's
> constructor an explicitly pass it a reference to the HttpServletRequest
> object so it can fetch the HttpSession object and find the object that
> tells it everything else it needs to know to pre-populate the form bean
> prior to display, am I violating any sacred assumption made by other parts
> of Struts? Or am I OK?


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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



  1   2   >