From 6f698d0741df16b3d7ac39aef685adc0a31c6679 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 13 Jul 2010 06:54:59 +0000 Subject: [PATCH] WrongUrl page implemented --- Builder/IISMainHandler/build.txt | 2 +- IISMainHandler/IISMainHandler.csproj | 1 + IISMainHandler/handlers/WrongUrlHandler.cs | 15 +++++++++--- templates/Full/WrongUrl.xslt | 28 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 templates/Full/WrongUrl.xslt diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 8e44f67..26102a7 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -812 \ No newline at end of file +818 \ No newline at end of file diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index 80e14e4..25c1ca3 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -92,6 +92,7 @@ + diff --git a/IISMainHandler/handlers/WrongUrlHandler.cs b/IISMainHandler/handlers/WrongUrlHandler.cs index 29103e5..b73338a 100644 --- a/IISMainHandler/handlers/WrongUrlHandler.cs +++ b/IISMainHandler/handlers/WrongUrlHandler.cs @@ -3,12 +3,21 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; +using System.Xml.Linq; namespace FLocal.IISHandler.handlers { - class WrongUrlHandler : ISpecificHandler { + class WrongUrlHandler : AbstractGetHandler { - public void Handle(WebContext context) { - throw new HttpException(400, "wrong url '" + context.httprequest.RawUrl + "'"); + protected override string templateName { + get { + return "WrongUrl.xslt"; + } + } + + protected override XElement[] getSpecificData(WebContext context) { + return new XElement[] { + new XElement("path", context.httprequest.Path) + }; } } diff --git a/templates/Full/WrongUrl.xslt b/templates/Full/WrongUrl.xslt new file mode 100644 index 0000000..be06d8f --- /dev/null +++ b/templates/Full/WrongUrl.xslt @@ -0,0 +1,28 @@ + + + + Неверный адрес + + + + + +
+ + + + + + + +
+ Неверный адрес +
+ Введённый вами адрес + + не найден +
+
+
+ +
\ No newline at end of file