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 be 
something like "choose.m?page=seventeenth", and to have the choose command 
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 the path for the 
"document" view from inside the controller? Or, does something like the 
following have any chance of working? (it doesn't, but could it, with minor 
adjustments which I currently cannot fathom?)

<command name="choose">
  <controller class="...Choose"/>
  <view name="success" type="redirect" />

class Choose
  public String go(ControllerContext cctx)
      throws ServletException {
    HttpServletRequest req = cctx.getRequest();
    String page = 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?


Sign-up for Ads Free at Mail.com

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.

Reply via email to