This is what you would use for a null view type:

<command name="blah">
  <controller class="blah.Blah"/>
  <view type="null"/>
</command>

Every view type interprets the model and params differently.  The null
view does nothing at all - it expects that the controller will have
manually handled the response itself.  The redirect view type interprets
the model (if it is a String) as the URL to redirect to, and any params
as request parameters for the URL.

This is different than say the document or domify view types, which do
completely different things with the model (document puts it in the
request attributes, domify converts it to a DOM tree to be handed off to
the first transform step).  Each of the view types are pluggable
modules; you could write exotic view types that did just about anything
with the model and viewparams.

Jeff Schnitzer
[EMAIL PROTECTED]

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 07, 2003 6:01 PM
> To: [EMAIL PROTECTED]
> Subject: RE: RE: [Mav-user] forwarding in an action/command
> 
> Ok, so how do you do a null view type?
> 
> so setModel will basically redirect to another model ?
> 
> Travis
> 
> ---- Original Message ----
> From: "Schnitzer, Jeff" <[EMAIL PROTECTED]>
> Sent: 2003-07-07
> To: [EMAIL PROTECTED]
> Subject: RE: [Mav-user] forwarding in an action/command
> 
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >
> > Is the best way to forward to do this:
> >
> > this.getCtx().getResponse().sendRedirect("unitDetails.m?id=" +
> unitKey);
> >
> > ?
> 
> That would be a redirect, not a forward... and it's not the best way
to
> do a redirect either :-)
> 
> If you want to do a redirect, that is one way - but you'll need to use
> the "null" view type because you are issuing the redirect from the
> controller.
> 
> A (usually) better way to perform a redirect is to use the "redirect"
> view type.  From the controller call:
> 
> this.getCtx().setModel("unitDetails.m");
> this.getCtx().setViewParam("id", unitKey);
> 
> Or you could just put the entire URL in the model, Maverick will
figure
> it out.  Also, you can specify the base part of the url as a path=""
> attribute in the maverick config file.
> 
> 
> For a forward, you probably want to use a "null" view type and use the
> servlet RequestDispatcher mechanism.  It goes something like this:
> 
> RequestDispatcher disp =
> this.getCtx().getRequest().getRequestDispatcher("blah.m");
> disp.forward(this.getCtx().getRequest(), this.getCtx().getResponse());
> 
> 
> You could also do the forward using the "document" view type, but it
> gets harder to dynamically choose the path you want to go to.
> 
> Does this help?
> 
> Jeff Schnitzer
> [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> [INVALID FOOTER]
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> [INVALID FOOTER]



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
[INVALID FOOTER]

Reply via email to