PageCompiler: make session available before page precondition is checked - allows use of session in precondition

This commit is contained in:
Guenter Obiltschnig 2015-02-19 22:57:23 +01:00
parent d550ff7af9
commit f04e19a362

View File

@ -263,11 +263,11 @@ void CodeWriter::writeHandler(std::ostream& ostr)
ostr << "void " << _class << "::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response)\n";
ostr << "{\n";
writeResponse(ostr);
writeSession(ostr);
if (_page.has("page.precondition"))
{
ostr << "\tif (!(" << _page.get("page.precondition") << ")) return;\n\n";
}
writeSession(ostr);
writeForm(ostr);
ostr << _page.preHandler().str();
writeContent(ostr);