[Mav-user] Arbitrary documents

2005-03-31 Thread Goran Topic
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?)


  
  


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]


[Mav-user] arbitrary documents

2005-03-10 Thread Goran Topic
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?)


  
  


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?

Thanks

Goran
-- 
___
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_ide95&alloc_id396&op=click
[INVALID FOOTER]