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
Unable to compile class for JSP: | |
An error occurred at line: [60] in the generated java file: [/var/www/tomcat/8021-kauairpt/work/Catalina/localhost/kauairpt/org/apache/jsp/index_jsp.java] | |
The method getDispatcherType() is undefined for the type HttpServletRequest |
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
dependencies { | |
compile ('org.hibernate:hibernate:3.1.3') { | |
exclude group: "commons-logging", module: "commons-logging" | |
} | |
compile ('org.springframework:spring-context-support:3.2.16.RELEASE') { | |
exclude group: "commons-logging", module: "commons-logging" | |
} | |
providedCompile 'javax.servlet:javax.servlet-api:3.1.0' | |
} |
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
@RequestMapping(value = "pdf", headers = { "Accept=*/*", | |
"content-type=application/json,text/plain" }, method = RequestMethod.POST, produces = "application/pdf") | |
public ResponseEntity<byte[]> getPdf(@RequestBody Object object) { | |
Form form; | |
if (object instanceof Map) { | |
form = new ObjectMapper().convertValue(object, Form.class); | |
} | |
else { | |
try { | |
form = formService.getForm(Long.parseLong(object.toString())); |
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
$(document).ready( | |
$('p.error').each(function() { | |
var text = $(this).text(); | |
if (text.toLowerCase().indexOf("date field must be between") >= 0) { | |
$(this).empty(); | |
$(this).text('The birth date must be prior to January 18, 1995.'); | |
} | |
}); | |
); |
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
import java.math.BigDecimal; | |
import javax.servlet.http.HttpServletRequest; | |
import org.springframework.validation.Errors; | |
import org.springframework.validation.Validator; | |
public class BillValidator implements Validator { | |
private HttpServletRequest request; | |
public void setRequest(HttpServletRequest request) { |
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
import org.springframework.web.servlet.mvc.SimpleFormController; | |
public class BillController extends SimpleFormController { | |
private BillService billService; | |
public BillController() { | |
setValidator(new BillValidator()); | |
} |
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
String update = "UPDATE table SET file = ? WHERE id = '1'"; | |
PreparedStatement stmt = conn.prepareStatement(update); | |
stmt.setBytes(1, bytes); | |
return stmt.executeUpdate() > 0; |
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
compile 'commons-io:commons-io:2.4' |
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
{ | |
"status":400, | |
"violation1":"Values must be provided for name and head of department.", | |
"violation2":"Department with same name already exists." | |
} |
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
{ | |
"departmentName":"Computer Science", | |
"departmentHead":"" | |
} |