Spring MVC: Validation, Post-Redirect-Get, Partial Updates, Optimistic Concurrency, Field Security http://stackoverflow.com/a/29039117/289057
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
<!DOCTYPE html> <!-- important http://stackoverflow.com/a/21425218 --> | |
<html> | |
<head> | |
<link rel="stylesheet/less" type="text/css" href="nomoretables.less" /> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.3/less.min.js"></script> | |
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> | |
</head> | |
<body> | |
<div style="position:relative"> |
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
/** | |
* Uses Lombok to reduce boilerplate | |
*/ | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import javax.annotation.Generated; | |
import com.fasterxml.jackson.annotation.JsonAnyGetter; | |
import com.fasterxml.jackson.annotation.JsonAnySetter; |
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 net._95point2.misc.docker; | |
import javax.sql.DataSource; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.DisposableBean; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Profile; |
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 net._95point2.misc.pebble; | |
import java.util.List; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.stereotype.Controller; |
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
@Component | |
public static class JsonWriterPebbleExtension extends AbstractExtension | |
{ | |
@Autowired ObjectMapper objectMapper; | |
@Override | |
public Map<String, Function> getFunctions() { | |
HashMap<String, Function> functions = new HashMap<String,Function>(); | |
functions.put("json", new JsonWriterPebbleFunction(objectMapper)); | |
return functions; |
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
DO | |
$$ | |
DECLARE | |
rec record; | |
nbrow bigint; | |
BEGIN | |
FOR rec IN | |
SELECT * | |
FROM pg_tables | |
WHERE tablename NOT LIKE 'pg_%' |
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
/** | |
* Source code derived from: https://github.com/thymeleaf/thymeleaf-extras-springsecurity/blob/3.0-master/thymeleaf-extras-springsecurity4/src/main/java/org/thymeleaf/extras/springsecurity4/auth/AuthUtils.java | |
* | |
* Thymeleaf is licensed under the Apache Software License (2.0) and has copyright assertions from the Thymeleaf team. | |
* As a derived works, this source code is also licensed under the Apache license (2.0) | |
* | |
* Original Notice: | |
* ============================================================================= | |
* | |
* Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<html><body> | |
<form action="file-upload.php" method="post" enctype="multipart/form-data"> | |
Send these files:<br /> | |
<input name="userfile[]" type="file" multiple /><br /> | |
<input type="submit" value="Send files" /> | |
</form> | |
</body></html> |