Commit 015f2fb3 by Patryk Czarnik

apache commons

parent f712c0c3
......@@ -30,9 +30,13 @@
<artifactId>javaee-web-api</artifactId>
<version>8.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</project>
<!-- Za pomocą Alt+F5 wykonujemy Maven > Update Project,
aby Eclipse uaktualił konfigurację projektu zgodnie z plikiem POM.
-->
......@@ -9,6 +9,8 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
@WebServlet("/Rozmowa")
public class Rozmowa extends HttpServlet {
private static final long serialVersionUID = 1L;
......@@ -38,9 +40,9 @@ public class Rozmowa extends HttpServlet {
out.println("<button>Wyślij</button>");
out.println("</form>");
if(imie != null && !imie.isEmpty()) {
if(StringUtils.isNotBlank(imie)) {
out.println("<p>Witaj " + imie + "</p>");
if(parametrWiek != null && !parametrWiek.isEmpty()) {
if(StringUtils.isNotBlank(parametrWiek)) {
int wiek = Integer.parseInt(parametrWiek);
if(wiek >= 18) {
out.println("<p>Zapraszamy na piwo.</p>");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment