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 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 type="redirect" />
</command>

class Choose
  public String go(ControllerContext cctx)
      throws ServletException {
    HttpServletRequest req = cctx.getRequest();
    String page = req.getParameter("page");
    cctx.setModel("/collection/" + page + ".vm");
  }
}

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


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
[INVALID FOOTER]

Reply via email to