This problem is a standard one for web pages (and http).  The link must
be generated in one request, but the actual download of the document
occurs in a completely separate request.

What I suggest is that you generate the link (not the document!) from
the Controller in the first request (putting the URL in the model).  If
you can make the link a static part of the main page, that's even
easier, but it doesn't matter.  The important part is that the actual
document should be generated on the request for the document itself, not
when the link is generated.

Usually you would build the document from a special servlet.  If you
want to build the document from a Maverick controller, you need a "null"
view which doesn't actually exist right now but will in a few minutes
:-)  A null view means the controller was responsible for manually
writing output to the servlet response.

Note that if for some reason you *really* want to generate the document
on the original request, you can just store it in the session obtained
with Throwaway.getSession().  The next request can just check for the
value in the session.  However, depending on the size of your document,
this could pretty quickly end up eating up a lot of RAM.

Does this make sense?

Good luck,
Jeff Schnitzer
[EMAIL PROTECTED]
 
> -----Original Message-----
> From: Jordan C N Chong [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 09, 2002 3:42 PM
> To: Jeff Schnitzer
> Subject: RE: [Mav-user] Newbie of Maverick
> 
> Dear Jeff...
> 
> Thank you very much for your email.
> 
> Basically, all I want to do is to generate a URL of where the file is.
> 
> in more detail: when the user click a button OK, a DOC file is
generated
> and
> stored somewhere, but a URL of where the DOC file is will be shown to
the
> user on the Web page generated by using Maverick....
> 
> Now I have a brief idea, a Controller, say DOCGenerateController to
> generate
> the DOC file and also to generate the URL String of the DOC file
location,
> then... what? How can I make the URL String generated being viewed on
a
> Web
> page to the user, is it by generate an XML file and using an XSLT file
to
> transform it to HTML??? Frankly speaking, I am very messy...
> 
> Is it possible to do that in Maverick?? Please help.
> 
> Thousand thanks.
> 
> 
> 
> Best regards,
> --------------------------------------------
> Jordan Cheun Ngen, Chong
> INF-4067 Universiteit Twente
> Postbus 217
> 7500 AE Enschede
> The Netherlands
> 
> Distributed and Embedded Systems (DIES)
> --------------------------------------------
> Office Phone: +31 53 4894655
> Web site: http://www.cs.utwente.nl/~chong
> Email Add.: [EMAIL PROTECTED]
> ============================================
> 
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff
Schnitzer
> > Sent: Saturday, March 09, 2002 10:50 PM
> > To: maverick
> > Subject: RE: [Mav-user] Newbie of Maverick
> >
> >
> > I'm not sure exactly what you are trying to do.  You want to show a
URL
> > as a web page?  If you try to explain a little more, it would
probably
> > help.
> >
> > BTW, this page from sun is a pretty good explanation of MVC (also
known
> > as "Model 2"):
> >
> >
http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents
> > .html#JSPIntro4
> >
> > Jeff
> >
> > > -----Original Message-----
> > > From: Jordan C N Chong [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, March 09, 2002 10:34 AM
> > > To: maverick
> > > Subject: [Mav-user] Newbie of Maverick
> > >
> > > Dear Maverick Experts
> > >
> > > I am a total newbie to Maverick. I wish to make something clear,
cause
> > my
> > > mind is a bit messy of Maverick. As I know there is three parts:
> > Model,
> > > View
> > > and Controller.
> > >
> > > The thing I wish to do is:
> > >
> > > A user clicks on a button, then, a URL of the location of a file
is
> > > generated and then show it to user.
> > >
> > > Sounds easy to everyone I think, but not for me, by using
Maverick.
> > >
> > > As I understand, I have to produce a Controller for the URL
> > generation,
> > > then... I don't know how to pass it to View, and I don't know what
> > Model
> > > is
> > > playing here...
> > >
> > > Please help me. Please give me some advice and opinions. Thank you
> > very
> > > much.
> > >
> > >
> > > Best regards
> > > Jor
> > >
> > >
> > > _______________________________________________
> > > Mav-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/mav-user
> >
> > _______________________________________________
> > Mav-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/mav-user
> >


_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user

Reply via email to