facebook

Dynamically cretaed forms & struts… I’m stumped.

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #240427 Reply

    I hope I’m overlooking something obvious here, but here is the problem.

    I am writing a web application in using Struts and Hibernate together. Some of the application’s input forms are going to change depending on the contents
    of a couple of tables within the database.
    I’ve been reading up on nested forms and was going to implement my solution using that methodology and realized there were some obstacles.

    The actual form (excerpt below) is going to look in part like this:

    
    Call Name   Jump Height  {class name #1}  {day 1} {day 2} {day n} {class name #2}  {day 1} {day 2} {day n}
    [ text input]  [select]           [select]                [check] [check] [check] [select]               [check] [check] [check] 
    

    To fully explain what is happening here: depending on how many days a dog show is and what classes are being offered (class name) the appearance
    of this form is going to change. That information is contained in a series of databae tables

    One of the thoughts I had to make this work was to create a singleton called “DataManager” and keep the dog show information in there and then I realized
    that won’t work because if another user is using the applicaiton the singleton behavior is such that the two sessions will step all over each other. (at leasn that is
    my understanding of what will happen).

    Is there a way for a FormBean to get session and/or request information for its current session/requst instnace? Is there some other way to give a FormBean some sort of contextual awareness?

    #240440 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev.

    Peter,
    Your form’s validate and reset methods are both passed your HttpServletRequest, which gives you access to all application scopes, so to answer your question “yes, it’s passed in”.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Dynamically cretaed forms & struts… I’m stumped.

You must be logged in to post in the forum log in