This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | |
Include file (Java) | |
<%@ include file="/WEB-INF/jsp/common/date.jsp" %> | |
Include file (JSP) | |
<jsp:include page="/WEB-INF/jsp/common/date.jsp"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.concretepage.dao; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import javax.sql.DataSource; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import org.springframework.jdbc.core.RowMapper; | |
import org.springframework.stereotype.Repository; | |
import com.concretepage.bean.UserInfo; | |
@Repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Messages { | |
// property file is: package/name/messages.properties | |
private static final String BUNDLE_NAME = "package.name.messages"; | |
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); | |
private Messages() { | |
} | |
public static String getString(String key) { | |
try { | |
return RESOURCE_BUNDLE.getString(key); | |
} catch (MissingResourceException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.howtodoinjava.demo.validator; | |
import org.springframework.stereotype.Component; | |
import org.springframework.validation.Errors; | |
import org.springframework.validation.ValidationUtils; | |
import org.springframework.validation.Validator; | |
import com.howtodoinjava.demo.model.EmployeeVO; | |
@Component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.howtodoinjava.demo.model; | |
import java.io.Serializable; | |
public class EmployeeVO implements Serializable | |
{ | |
private static final long serialVersionUID = 1L; | |
private Integer id; | |
private String firstName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// list page | |
@RequestMapping(value = "/users", method = RequestMethod.GET) | |
public String showAllUsers(Model model) { | |
logger.debug("showAllUsers()"); | |
model.addAttribute("users", userService.findAll()); | |
return "users/list"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Form post handler | |
*/ | |
@RequestMapping(value = "/", method = RequestMethod.POST) | |
public String send( | |
@Valid @ModelAttribute("messageForm") MessageForm messageForm, | |
BindingResult binding, | |
RedirectAttributes redirectAttributes) { | |
// Redirect back into form page if errors detected |
NewerOlder