import java.io.IOException;
import java.net.URI;
-import java.time.LocalDateTime;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
import com.prueba.core.context.security.persistence.SessionInfo;
import com.prueba.core.context.security.persistence.Sessions;
final String requestedURI = httpExchange.getRequestURI().toString();
final PageImpl pageImpl = new PageImpl();
+ int responseStatus = 200;
String html = "";
switch (requestedURI) {
case "/app/pages/page_1.html":
html = pageImpl.doPage(2, getSafeUserName());
break;
default:
- httpExchange.sendResponseHeaders(404, 0);
+ responseStatus = 404;
break;
}
- httpExchange.sendResponseHeaders(200, html.length());
-
+ httpExchange.sendResponseHeaders(responseStatus, html.length());
try (final OutputStream os = httpExchange.getResponseBody()) {
os.write(html.getBytes());
}