struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Takhar <sandeep_tak...@yahoo.com>
Subject Re: 4th Of July Struts Challenge...
Date Fri, 04 Jul 2003 14:54:05 GMT
The answer for the first part is here:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg71256.html

specifically the part where it talks about nested tags
works.  The logic:iterate I couldn't get to work and I
haven't set up the el stuff, but that would probably
work.

All you need in the form is the Object getMap(String
key) and setMap(key,object)

next thing to try is the dynaform, but I've never used
one before...

sandeep
--- Rick Reumann <r@reumann.net> wrote:
> Ok stupid subject line, but now I can get back to
> something I was
> curious about that I posted around a week ago. I'm
> really curious how to
> do accomplish this and yes have tried it a bunch of
> different ways... 
> 
> Here's the challenge....
> 
> First challenge is just with a regular ActionForm...
> 
> 1) Your ActionForm has to have a property of type
> Map. For this
> adventure call it employeesMap.
> 
> 2) Each map will hold for the key and employeeID (
> String ssn - social
> security number whatever). The value will be an
> EmployeeBean. For
> testing sake just have it have two properties String
> name, String age.
> 
> 3) Put two employees into the Map and put this Map
> into your ActionForm:
> HashMap empMap = new HashMap();
> empMap.put( "1111", new EmployeeBean("John Doe",
> "33" ) );
> empMap.put( "2222", new EmployeeBean("Loser Boy",
> "22" ) );
> setEmployeesMap( empMap );
> 
> 4) Now have a jsp form iterate over this Map and
> provide text fields to
> edit the name and age of each employee. When the
> form is submitted there
> should be a way that it will submit this Map with
> updated EmployeeBeans
> with the new names and ages for each key (1111 and
> 2222 ). Pull the map
> out of the action you submit to and print the
> properties of the
> EmployeeBeans to test.
> 
> 
> Second challenge... is do the above using your
> employeesMap as a
> property of a DynaActionForm.
> 
> Preferably use JSTL and/or struts-el also would be
> nice.
> 
> (First one to successfully complete this challenge
> will win 100 dollars
> for each person that they forward this e-mail to, as
> Microsoft will be
> monitoring all the e-mails as well. That kid doing
> this project for his
> science fair project to see how far e-mails travel
> will also be
> involved, so please reply to him. The 100 dollars
> will come from that
> African tribe leader with that money he is just
> dying to give away if
> you just contact him. Some of the money might come
> from the stolen
> tourist kidney sales in Mexico, but I'm not positive
> of that).
> 
> -- 
> Rick 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message