This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Struts-Design Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Struts-Design Problem" Watch "Struts-Design Problem" New topic
Author

Struts-Design Problem

Kumar Kartik
Greenhorn

Joined: Jun 14, 2002
Posts: 10
Hi,
I am new to Struts and desiging a web application. I have problem designing ActionForm bean for one of my JSP form.
The problem is, Attributes Name of the JSP form is dynamic, It comes form session of previous pages.
So, How do I create ActionForm for my dynamic page?
Any help?
thanks
~kumar


SCJP2
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
I'm not sure exactly how dynamic the content of your secondary form is, but it seems to me that you should probably have multiple beans with multiple pages. i.e. currently you're trying to do this:
form 1 --> action --> problem form
where what you really want to do is
form 1 --> action --> form 2a || 2b || 2c
based on the input from form 1. This is the cleanest and most easily maintainable design. The other (and much less preferred) option is
to design a form bean with all possible input fields. But this is very difficult for someone else to read and understand.


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Kumar Kartik
Greenhorn

Joined: Jun 14, 2002
Posts: 10
Hi David,
Thanks for reply.
But, I have problem defining get/set method for my FormBean cause, Application can only know the HTML Textfield (or Option List) name during runtime. ( I have a Hastable object in my session that have field name and value..and I render HTML (or JSP) using this name and value (if value is String I create HTML TextField and if Vector I create Option List.))
Pls ask if you did,nt get the problem..I think I am not good at explaining my problem.
thanks
~kumar
Yan Zhang
Greenhorn

Joined: Dec 26, 2002
Posts: 4
Hi,
Can struts frame work handle multiple forms in one jsp page?

Yan


<img src="rolleyes.gif" border="0">
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts-Design Problem
 
Similar Threads
dynamic Row generation? no source code?
Struts Validation
lost form data after validation errors return from actionform
JSP using DHTML
Validating some extra fields of action form not in my jsp?