mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-25 06:36:37 +01:00
form fixes
This commit is contained in:
@@ -90,14 +90,43 @@ void RequestHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::
|
||||
Poco::Net::HTMLForm form(request, request.stream());
|
||||
if (!form.empty())
|
||||
{
|
||||
handleForm(form);
|
||||
try
|
||||
{
|
||||
handleForm(form);
|
||||
Poco::Net::NameValueCollection::ConstIterator it = form.find(Form::FORM_ID);
|
||||
if (it != form.end())
|
||||
{
|
||||
_pApp->notifySubmitButton(Poco::NumberParser::parse(it->second));
|
||||
}
|
||||
response.send();
|
||||
}
|
||||
catch(WebWidgetsException& e)
|
||||
{
|
||||
Poco::Net::HTTPResponse::HTTPStatus code = Poco::Net::HTTPResponse::HTTP_BAD_REQUEST;
|
||||
if (e.code() > code && e.code() <= Poco::Net::HTTPResponse::HTTP_EXPECTATION_FAILED)
|
||||
code = (Poco::Net::HTTPResponse::HTTPStatus)e.code();
|
||||
response.setStatusAndReason(code, e.displayText());
|
||||
response.send();
|
||||
}
|
||||
catch(Poco::Exception& e)
|
||||
{
|
||||
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, e.displayText());
|
||||
response.send();
|
||||
}
|
||||
catch(std::exception& e)
|
||||
{
|
||||
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, e.what());
|
||||
response.send();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
response.setStatusAndReason(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR, "Unknown exception");
|
||||
response.send();
|
||||
}
|
||||
|
||||
}
|
||||
Poco::Net::NameValueCollection::ConstIterator it = form.find(Form::FORM_ID);
|
||||
if (it != form.end())
|
||||
{
|
||||
_pApp->notifySubmitButton(Poco::NumberParser::parse(it->second));
|
||||
}
|
||||
handlePageRequest(request, response);
|
||||
else
|
||||
handlePageRequest(request, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -70,6 +70,8 @@ void TimeFieldCell::setFormat(TimeField::Format fmt)
|
||||
_format = "%h:%M:%S %A";
|
||||
else if (_fmt == TimeField::FMT_24H_WITHSECONDS)
|
||||
_format = "%H:%M:%S";
|
||||
else if (_fmt == TimeField::FMT_12H)
|
||||
_format = "%H:%M";
|
||||
setFormatter(new DateFormatter(_format));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user