arbitrary documents
"Goran Topic" <[email protected]> Thu, 10 Mar 2005 21:56:00 +0800
| Newsgroups | gmane.comp.web.maverick.general |
|---|---|
| Message-ID | <[email protected]> |
Hello.
I'm new to Maverick, and I'm trying to make my first Maverick application. =
I like what I see, but I'm sure I'd like it a whole lot better when I learn=
things that I don't see yet :)
I have an arbitrary collection of .vm files, which I present to my user as =
a dynamically generated choice of links on one page. I'd like the link to b=
e something like "choose.m?page=3Dseventeenth", and to have the choose comm=
and render the /collection/seventeenth.vm. If I understand correctly, I can=
make a "null" or "trivial" view, then have the controller manually invoke =
Velocity to render the response. Is there a better way? Can I somehow set t=
he path for the "document" view from inside the controller? Or, does someth=
ing like the following have any chance of working? (it doesn't, but could i=
t, with minor adjustments which I currently cannot fathom?)
<command name=3D"choose">
<controller class=3D"...Choose"/>
<view name=3D"success" type=3D"redirect" />
</command>
class Choose
public String go(ControllerContext cctx)
throws ServletException {
HttpServletRequest req =3D cctx.getRequest();
String page =3D req.getParameter("page");
cctx.setModel("/collection/" + page + ".vm");
return "success";
}
}
I tried looking at the source, but I can't figure out how the document type=
invokes the Velocity, so I can't go and replicate it... Help?
Thanks
Goran
--=20
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
[INVALID FOOTER]