#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    2
    Rep Power
    0

    Question Multiple JSP's with single Form and Action


    Hi All,

    Could someone please help me with the folowing? I am currently developing an application using JSP's with the Struts framework and I need to create a sequence of jsp's that all use the same XAction and XForm classes.

    Problem
    I have specified in struts-config.xml that each jsp in the sequence should point at the same XAction and XForm that seems to be fine. The problem seems to be that a new instance XAction and XForm is created as one navigate from jsp to jsp. (I use the window.location='theNextPage.jsp' to move to the next jsp instead of submitting the form)

    Is there a way to prevent a new instance being created each time? Can this be solved by taking advantage of the http session?

    Thanks in advance,
    Dáire
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    I am not completely clear as to how you are navigating, but I believe that struts will only pass the current form bean along when you go through the actionServlet and thus the Action itself using the *.do convention (the default). Just inputting the *.jsp file name in the address bar will make a new bean and initialize it to nothing by default.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    2
    Rep Power
    0

    Multiple JSP's with single Form and Action


    Thanks,

    I have this problem sorted out now. One can specify an action mapping for each JSP in the struts-config.xml file, in which they all point to the same Form.

    Dáire Treanor

IMN logo majestic logo threadwatch logo seochat tools logo