Skip to content

Commit d3cf2b3

Browse files
committed
Replaced System.out with LOGGER
1 parent 1ccd108 commit d3cf2b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Ch04_OutputEscapingJSP/src/main/java/de/dominikschadow/webappsecurity/controller/ContactController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package de.dominikschadow.webappsecurity.controller;
2020

2121
import de.dominikschadow.webappsecurity.domain.Contact;
22+
import org.apache.log4j.Logger;
2223
import org.springframework.stereotype.Controller;
2324
import org.springframework.validation.BindingResult;
2425
import org.springframework.web.bind.annotation.ModelAttribute;
@@ -34,9 +35,11 @@
3435
@Controller
3536
@SessionAttributes
3637
public class ContactController {
38+
private static final Logger LOGGER = Logger.getLogger(ContactController.class);
39+
3740
@RequestMapping(value = "/addContact", method = RequestMethod.POST)
3841
public ModelAndView addContact(@ModelAttribute("contact") Contact contact, BindingResult result) {
39-
System.out.println("Firstname: " + contact.getFirstname() + ", Lastname: " + contact.getLastname());
42+
LOGGER.info("Firstname: " + contact.getFirstname() + ", Lastname: " + contact.getLastname());
4043

4144
return new ModelAndView("contact", "command", contact);
4245
}

0 commit comments

Comments
 (0)