CPPSERV


Home Projects Jobs Clientele Contact

cppserv


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Made changes to utils/ files, added Makefile.adon and engine.xml



From: Sergey Jukov <sergey@total-knowledge.com>

---
 Makefile.adon   |    2 +-
 engine.xml      |    4 +++-
 utils/utils.cpp |   16 +++++++++-------
 utils/utils.h   |   13 +++++++++----
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/Makefile.adon b/Makefile.adon
index 125319d..4dbcc31 100644
--- a/Makefile.adon
+++ b/Makefile.adon
@@ -1,2 +1,2 @@
-ADON_SUBDIRS := csp-store hello fileupload redirect cookies session headers sharedata params BooksODBC database index
+ADON_SUBDIRS := csp-store hello utils fileupload redirect cookies session headers sharedata params BooksODBC database index
 EXTRA_DIST := README engine.xml
diff --git a/engine.xml b/engine.xml
index 99c5e25..136c618 100644
--- a/engine.xml
+++ b/engine.xml
@@ -5,9 +5,11 @@
 <app name="test">
     <servlet name="IndexServlet" dso="./debug/index/IndexServlet.so"/>
     <servlet name="HelloServlet" dso="./debug/hello/HelloServlet.so"/>
+    <servlet name="FirstTestServlet" dso="./debug/firsttest/FirstTestServlet.so"/>
     <servlet name="FileUploadServlet" dso="./debug/fileupload/FileUploadServlet.so"/>
     <servlet name="RedirectServlet" dso="./debug/redirect/RedirectServlet.so"/>
-    <servlet name="CookiesServlet" dso="./debug/cookies/CookiesServlet.so"/>
+    <servlet name="CookiesServlet"  dso="./debug/cookies/CookiesServlet.so"/>
+    <servlet name="UtilServlet" dso="./debug/utils/UtilServlet.so"/>
     <servlet name="SessionServlet" dso="./debug/session/SessionServlet.so"/>
     <servlet name="HeadersServlet" dso="./debug/headers/HeadersServlet.so"/>
     <servlet name="DatabaseServlet" dso="./debug/database/DatabaseServlet.so">
diff --git a/utils/utils.cpp b/utils/utils.cpp
index f3c7f44..b2779c8 100644
--- a/utils/utils.cpp
+++ b/utils/utils.cpp
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2004 by Ilya A. Volynets-Evenbakh                       *
- *   ilya@total-knowledge.com                                              *
+ *   Copyright (C) 2006 by Sergey Jukov                                    *
+ *   sergey@total-knowledge.com                                            *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -25,7 +25,7 @@ void UtilServlet::service(servlet::HttpS
 	std::ostream &out=resp.getOutputStream();
 	std::string myUrl=req.getParameter("param");
 
-	utilHeader(out);
+	renderHeader(out);
 
 	out << "<br><form name=\"testurl\" action=\"#\"><b>Please enter URL:</b>";
 
@@ -44,17 +44,19 @@ void UtilServlet::service(servlet::HttpS
 
 	}
 
-	utilFooter(out);
+	out << "</form>";
+
+	renderFooter(out);
 }
 
-void UtilServlet::utilHeader(std::ostream& out)
+void UtilServlet::renderHeader(std::ostream& out)
 {
 	out << "<html>\n <head>\n  <title>Sample Util Servlet for CPPSERV</title>\n </head>\n <body>";
 }
 
-void UtilServlet::utilFooter(std::ostream& out)
+void UtilServlet::renderFooter(std::ostream& out)
 {
-	out << "\n </form></body>\n</html>";
+	out << "\n </body>\n</html>";
 }
 
 EXPORT_SERVLET(UtilServlet)
diff --git a/utils/utils.h b/utils/utils.h
index f82a1d4..8fe59b4 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -27,16 +27,21 @@ #include <iostream>
 
 /**
 This servlet demonstrates work of URL decode/encode functions.
-
+Enter URL containing any special characters to the text field provided and submit the form. Original, decoded and encoded URLs will be displayed. All special characters will be decoded per ASCII code table. 
+For example the URL http://www.total-knowledge.com?value=test%23string after decoding will look like this: http://www.total-knowledge.com?value=test#string. However, www.total-knowledge.com?value=test%string will look exactly the same after decoding because "%+alphabetic character" is not valid ASCII character code.
 @author Sergey Jukov
 */
-class UtilServlet : public servlet::HttpServlet
+class UtilServlet : public servlet::HttpServlethttp:
 {
 private:
-	void utilHeader(std::ostream&);
-	void utilFooter(std::ostream&);
+	void renderHeader(std::ostream&);
+	void renderFooter(std::ostream&);
 public:
 	virtual void service(servlet::HttpServletRequest& req, servlet::HttpServletResponse& resp);
 };
 
+
+
 #endif
+
+
-- 
1.4.2


Authoright © Total Knowledge: 2001-2008