Skip to content

Commit

Permalink
константы вместо строк
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcom committed Sep 27, 2024
1 parent bad04dd commit 74b38a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/main/scala/ru/org/linux/email/EmailService.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1998-2023 Linux.org.ru
* Copyright 1998-2024 Linux.org.ru
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down Expand Up @@ -33,6 +33,7 @@ import java.net.URLEncoder
import java.util.{Date, Properties}
import javax.mail.internet.{InternetAddress, MimeMessage}
import javax.mail.{Message, MessagingException, Session, Transport}
import javax.servlet.RequestDispatcher
import javax.servlet.http.HttpServletRequest
import scala.jdk.CollectionConverters.*

Expand Down Expand Up @@ -149,11 +150,11 @@ class EmailService(siteConfig: SiteConfig, @Qualifier("exceptionMailingActor") e
}

text.append("\n\n")
val attributeUrl = request.getAttribute("javax.servlet.error.request_uri")
val attributeUrl = request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI)
if (attributeUrl != null) {
text.append(s"Attribute URL: $attributeUrl\n")
}
val forwardUrl = request.getAttribute("javax.servlet.forward.request_uri")
val forwardUrl = request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI)
if (forwardUrl != null) {
text.append(s"Forward URL: $forwardUrl\n")
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/jsp/errors/code403.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=utf-8" isErrorPage="true" %>
<%--
~ Copyright 1998-2019 Linux.org.ru
~ Copyright 1998-2024 Linux.org.ru
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
Expand All @@ -29,7 +29,7 @@
String message = exception==null ? "":(exception.getMessage()==null?"":exception.getMessage());
logger.debug("Forbidden. {}: {} ({})", request.getAttribute("javax.servlet.error.request_uri"),
logger.debug("Forbidden. {}: {} ({})", request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI),
message, AuthUtil.getNick());
%>
<jsp:include page="/WEB-INF/jsp/head.jsp"/>
Expand Down

0 comments on commit 74b38a4

Please sign in to comment.