struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Tran" <dantt...@hotmail.com>
Subject Re: form problem
Date Thu, 02 Jan 2003 16:23:46 GMT
Yes that is the way I am using now.  There may be another way but I never
try it before.


Use an  forward action (to your query.jsp) and have your reportForm's reset
method
to initialize the data.

<snippet>
 <action forward="/report.jsp" scope="request" path="/startReport" />
</snippet>

before report.jsp is processed, Struts constructs your reportForm and call
reset method for you.


-D
----- Original Message -----
From: "ss s ss" <struct13s@rediffmail.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, January 02, 2003 12:44 AM
Subject: form problem


> Hello agian,
> Thanks Dan.
>   I think you understood my problem. Let me explain it further.
> Please send me ur comments...
>
> I have a home jsp and the report jsp. Home jsp has a href for
> report jsp. I'm using report form and report action for display
> and editting the values.
> The user information after successful login is in the session. I
> need to access this information to intialize my report form....so
> that report jsp gets loaded with user data.
> Now my question is...initialising the form in the previous step's
> action is the only way? i mean having a home action which loads
> data in reports form and forward to reports jsp.
> is there any other way?
>
> I have tried accessing the form from seesion...inside jsp. It
> works ..but have to call the jsp twice.
>
> Thanks again.
> ss
>
> On Thu, 02 Jan 2003 Dan Tran wrote :
> >In your action:
> >
> ><snippet>
> >     -process your href value and generate report object
> >     -stick the Report object to request object
> >     -forward the action to an JSP page which will read
> >      out the Report object and display
> ></snippet>
> >
> >I dont think your sceniao need a form
> >
> >-Dan
> >----- Original Message -----
> > From: "ss s ss" <struct13s@rediffmail.com>
> >To: <struts-user@jakarta.apache.org>
> >Sent: Wednesday, January 01, 2003 11:48 PM
> >Subject: form problem
> >
> >
> > > Hello,
> > >        Happy new year to u all.
> > > I needed some help. My problem we are using struts and the
> >form is
> > > being called for generating some report .
> > > Now this strut is being called from a HREF tag and there is no
> >way
> > > I can intialise my form to generte the correct report.
> > > I have tried this
> > > <% MyForm form =
> >(MyForm)pageContext.getAttribute("form_name,
> > > PageContext.SOME_SCOPE);
> > > form.setSomething(something); %>
> > >
> > > But this too gives me problems that it genrates the page on
> >the
> > > next request
> > > That is the first time i go to the page the form is not
> > > initialized .Now when i go back using the browser back button
> >and
> > > click on the href again the report is there :(
> > >
> > > Can some one help where I am missing some improtant property
> >of
> > > struts.
> > >
> > > Thanx for ur help in advance.
> > >
> > > cheers
> > > ss
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
> > >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>

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


Mime
View raw message