Don Ness | 5 Nov 01:17 2004
Picon

Question about redirects and params

I have a controller (using ThrowawayForm) where I'm specifying params in the
Maverick.config. It looks like this:

<command name="update">
	<controller class="VirtualBookworm.Royalties.Ctl.Authors.UpdateForm,
VirtualBookworm.Royalties">
		<param name="roles" value="Author"/>
	</controller>
	<view name="unauthorized" ref="login"/>
	<view name="success" type="redirect" path="update.m?dispatch=view"/>
	<view name="update">
		<transform path="web/authors/update.xsl"/>
		<transform path="web/main.xsl"/>
	</view>
</command>

I have created a base class called DispatchForm that calls a method based on
the value of the request variable "dispatch". So update.m?dispatch=view
calls UpdateForm.View(), and update.m?dispatch=update calls
UpdateForm.Update(). After I perform an update, I redirect back to my
controller to call UpdateForm.View() again.

When I redirect, it redirects to update.m?dispatch=view?roles=Author. It
seems to be tacking on the controller params during a redirect, and it's not
using an ampersand either. I looked at Maverick's RedirectView object, and I
see that it only adds params for the view. Does the view context also
contain the parameters for the controller context? I can't seem to find
where it's adding those parameters. If that is indeed what is happening, is
that the intended function and can anyone suggest a work around?

(Continue reading)

Cort Schaefer | 7 Nov 07:27 2004

RE: Question about redirects and params

You can add dispatch in the contoller itself by using
ControllerContext.SetParam(name, value), that way when they are added as the
querystring they will be added correctly.  

This could be considered a bug, not sure how the Java version handled this
(actually, I think controller params and params that become query string
variables are different collections now).  You might consider logging this
issue.

Post back if the above will work for you or not.

Cort

-----Original Message-----
From: mavnet-user-admin <at> lists.sourceforge.net
[mailto:mavnet-user-admin <at> lists.sourceforge.net] On Behalf Of Don Ness
Sent: Thursday, November 04, 2004 5:18 PM
To: Maverick. NET User List
Subject: [Mavnet-user] Question about redirects and params

I have a controller (using ThrowawayForm) where I'm specifying params in the
Maverick.config. It looks like this:

<command name="update">
	<controller class="VirtualBookworm.Royalties.Ctl.Authors.UpdateForm,
VirtualBookworm.Royalties">
		<param name="roles" value="Author"/>
	</controller>
	<view name="unauthorized" ref="login"/>
	<view name="success" type="redirect" path="update.m?dispatch=view"/>
(Continue reading)

Cort Schaefer | 7 Nov 07:34 2004

RE: RE: Bug in PropertyPopulator.Populate(...)?

The PropertyPopulator tries to find properties for all of the values in the
request.  This message is normal for values that can't be found (although I
am not sure the exception really needs to be output).  I asked about this a
long time ago and Jim just suggested to change the logging level for the
PropertyPopulator to something above WARN in your log4net config file.

The log entry itself is correct, the exception text is probably not needed.
You could log an issue for this if bothers you.

Cort

-----Original Message-----
From: mavnet-user-admin <at> lists.sourceforge.net
[mailto:mavnet-user-admin <at> lists.sourceforge.net] On Behalf Of Gomez
Aragoneses, Andres
Sent: Wednesday, October 27, 2004 4:51 AM
To: mavnet-user <at> lists.sourceforge.net
Subject: [Mavnet-user] RE: Bug in PropertyPopulator.Populate(...)?

I'm attaching the log file to this message.

> -----Mensaje original-----
> De: Gomez Aragoneses, Andres 
> Enviado el: miércoles, 27 de octubre de 2004 12:49
> Para: mavnet-user <at> lists.sourceforge.net
> Asunto: Bug in PropertyPopulator.Populate(...)?
> 
> 
> Hello. I have managed to get the Friendbook-xsl example from 
> Maverick working on .NET 1.1, but I have found that a WARNING 
(Continue reading)

Don Ness | 17 Nov 00:49 2004
Picon

Writing to Response.OutputStream

I am using Maverick to post some parameters to an aspx page. I want this
aspx page, however, to return an image stream. I can't seem to do this since
Maverick is using it's own HtmlTextWriter. Whenever I try to modify the
OutputStream, it throws an exception saying: 

System.Web.HttpException: OutputStream is not available when a custom
TextWriter is used. Here is some example code in my aspx page:

-----

<% <at>  Page ContentType="image/png" Language="C#" %>

<% <at>  Import namespace="System.Drawing" %>
<% <at>  Import namespace="System.Drawing.Imaging" %>
<% <at>  Import namespace="NPlot" %>

<%

NPlot.Bitmap.PlotSurface2D plotSurface = new NPlot.Bitmap.PlotSurface2D(800,
600);

//...

DiabetesTracker.Ctl.Charts.DemoChart model =
(DiabetesTracker.Ctl.Charts.DemoChart)Context.Items["model"];
double[] xs = model.Averages;

HistogramPlot hp = new HistogramPlot();
hp.DataSource = xs;
hp.BaseWidth = 0.6f;
(Continue reading)

Don Ness | 17 Nov 06:58 2004
Picon

RE: Writing to Response.OutputStream

Okay, I solved my problem. I was able to write a custom controller which was
much easier than I had originally thought. On success I just have a null
view, and it works perfect. Yay Maverick.NET :-) Here is the code in case
anyone is interested.

-----

using System;
using System.Xml.Serialization;

using Maverick;
using Maverick.Ctl;
using Maverick.Flow;
using Maverick.Util;

using NPlot;

namespace DiabetesTracker.Ctl.Charts
{
	/// <summary>
	/// Summary description for ChartController.
	/// </summary>
	public class ChartController : Throwaway
	{
		[NonSerialized]
		protected NPlot.Bitmap.PlotSurface2D plotSurface = null;

		public ChartController()
		{
		}
(Continue reading)

Aaron Clauson | 17 Nov 09:57 2004
Picon

Re: Writing to Response.OutputStream

The HttpContext for the request is wrapped up in the
MaverickContext object. Try using,

cctx.HttpContext.Response.OutputStream

hth
Aaron

> Message: 1
> From: "Don Ness" <don.ness <at> tamu.edu>
> To: "Maverick. NET User List"
> <mavnet-user <at> lists.sourceforge.net>
> Date: Tue, 16 Nov 2004 17:49:12 -0600
> Organization: Texas A&M University
> Subject: [Mavnet-user] Writing to
> Response.OutputStream
> Reply-To: mavnet-user <at> lists.sourceforge.net
> 
> I am using Maverick to post some parameters to an
> aspx page. I want this
> aspx page, however, to return an image stream. I
> can't seem to do this =
> since
> Maverick is using it's own HtmlTextWriter. Whenever
> I try to modify the
> OutputStream, it throws an exception saying:=20
> 
> System.Web.HttpException: OutputStream is not
> available when a custom
> TextWriter is used. Here is some example code in my
(Continue reading)

Picon

Problem forwarding to a commando using Maverick.Ctl.Aspx.ControllablePage

Hi all,
I looked the list and find many questions seemed with mine but I don't
find the solution for my problem.

I have to commands that use the Maverick.Ctl.Aspx.ControllablePage controller.
My maverick.config looks like:

<?xml version="1.0"?>

<maverick version="2.0" default-view-type="document"
default-transform-type="document">
	<commands>
		<command name="ListaUsuarios.aspx">					
			<view name="sucesso" type="trivial" />
			<view name="formulario" type="redirect" path="WebForm1.aspx"/>
		</command>

		<command name="WebForm1.aspx">		
			<view name="lista" type="redirect" path="ListaUsuarios.aspx"/>
			<view name="formulario" type="trivial" />
		</command>
	</commands>
</maverick>

When I try forward to a command I get this exception:
ArgumentException: Redirect URI cannot contain newline characters.

The Calendar example don't have this situation.
Can somebody help me?

(Continue reading)

Picon

Problem forwarding to a command into a command.

I am trying forward to a command into a
Maverick.Ctl.Aspx.ControllablePage and I get this error:
[ArgumentException: Redirect URI cannot contain newline characters.]
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse) +537
   System.Web.HttpResponse.Redirect(String url) +7
   Maverick.View.RedirectView.Go(IViewContext vctx) in
C:\projects\Maverick\src\Maverick\View\RedirectView.cs:58
   Maverick.Flow.CommandBase.RunView(String viewName, MaverickContext
mctx) in C:\projects\Maverick\src\Maverick\Flow\CommandBase.cs:49
   Maverick.Ctl.Aspx.AspxController.Render(IControllablePage page,
HttpContext ctx) in
c:\projects\maverick\src\maverick\ctl\aspx\aspxcontroller.cs:52
   Maverick.Ctl.Aspx.ControllablePage.Render(HtmlTextWriter writer) in
C:\projects\Maverick\src\Maverick\Ctl\Aspx\ControllablePage.cs:44
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Page.ProcessRequestMain() +1929

My maverick.config:
<?xml version="1.0"?>

<maverick version="2.0" default-view-type="document"
default-transform-type="document">
	<commands>
		<command name="ListaUsuarios.aspx">					
			<view name="sucesso" type="trivial" />
			<view name="formulario" path="WebForm1.aspx" type="redirect"/>
		</command>

		<command name="WebForm1.aspx">		
			<view name="lista" path="ListaUsuarios.aspx" type="redirect"/>
(Continue reading)

Cort Schaefer | 30 Nov 07:34 2004

RE: Problem forwarding to a command into a command.

Do you have any logging configured?  I would be interested to see what the DEBUG level messages are.

Cort

-----Original Message-----
From: mavnet-user-admin <at> lists.sourceforge.net
[mailto:mavnet-user-admin <at> lists.sourceforge.net] On Behalf Of Vinícius Pitta Lima de Araújo
Sent: Monday, November 29, 2004 11:31 AM
To: mavnet-user <at> lists.sourceforge.net
Subject: [Mavnet-user] Problem forwarding to a command into a command.

I am trying forward to a command into a
Maverick.Ctl.Aspx.ControllablePage and I get this error:
[ArgumentException: Redirect URI cannot contain newline characters.]
   System.Web.HttpResponse.Redirect(String url, Boolean endResponse) +537
   System.Web.HttpResponse.Redirect(String url) +7
   Maverick.View.RedirectView.Go(IViewContext vctx) in
C:\projects\Maverick\src\Maverick\View\RedirectView.cs:58
   Maverick.Flow.CommandBase.RunView(String viewName, MaverickContext
mctx) in C:\projects\Maverick\src\Maverick\Flow\CommandBase.cs:49
   Maverick.Ctl.Aspx.AspxController.Render(IControllablePage page,
HttpContext ctx) in
c:\projects\maverick\src\maverick\ctl\aspx\aspxcontroller.cs:52
   Maverick.Ctl.Aspx.ControllablePage.Render(HtmlTextWriter writer) in
C:\projects\Maverick\src\Maverick\Ctl\Aspx\ControllablePage.cs:44
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Page.ProcessRequestMain() +1929

My maverick.config:
<?xml version="1.0"?>
(Continue reading)

Picon

Re: Problem forwarding to a command into a command.

The log seems ok:

2004-11-29 15:18:06,551 [1968] INFO  Maverick.Dispatcher [] - Running init
2004-11-29 15:18:06,601 [1968] INFO  Maverick.Dispatcher [] - Starting
configuration load
2004-11-29 15:18:06,631 [1968] INFO  Maverick.Dispatcher [] - Loading
config from C:\Inetpub\wwwroot\Maverick01\maverick.config
2004-11-29 15:18:06,661 [1968] INFO  Maverick.Flow.MasterFactory [] -
Transform factory for "document" is
Maverick.Transform.DocumentTransformFactory
2004-11-29 15:18:06,671 [1968] INFO  Maverick.Flow.MasterFactory [] -
Transform factory for "xslt" is
Maverick.Transform.XsltTransformFactory
2004-11-29 15:18:06,671 [1968] INFO  Maverick.Flow.MasterFactory [] -
View factory for "document" is Maverick.View.DocumentViewFactory
2004-11-29 15:18:06,681 [1968] INFO  Maverick.Flow.MasterFactory [] -
View factory for "xml" is Maverick.View.XmlSerializingViewFactory
2004-11-29 15:18:06,691 [1968] INFO  Maverick.Flow.MasterFactory [] -
View factory for "redirect" is Maverick.View.RedirectViewFactory
2004-11-29 15:18:06,691 [1968] INFO  Maverick.Flow.MasterFactory [] -
View factory for "trivial" is Maverick.View.TrivialViewFactory
2004-11-29 15:18:06,691 [1968] INFO  Maverick.Flow.MasterFactory [] -
View factory for "null" is Maverick.View.NullViewFactory
2004-11-29 15:18:06,701 [1968] INFO  Maverick.Flow.Loader [] -
Creating command: ListaUsuarios.aspx
2004-11-29 15:18:06,711 [1968] INFO  Maverick.Flow.ViewRegistry [] -
Has view named: sucesso
2004-11-29 15:18:06,721 [1968] INFO  Maverick.Flow.ViewRegistry [] -
Has view named: formulario
2004-11-29 15:18:06,731 [1968] INFO  Maverick.Flow.Loader [] -
(Continue reading)


Gmane