File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts-Design Problem

 
Kumar Kartik
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Hibbs
Ranch Hand
Posts: 374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kumar Kartik
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can struts frame work handle multiple forms in one jsp page?

Yan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic