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.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.METHOD) | |
public @interface PreventExternalAccess { | |
} |
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
@Resource | |
public class CategoriaController { | |
private final Result result; | |
private final CategoriaService service; | |
private final Validator validator; | |
public CategoriaController(CategoriaService service, Result result, | |
Validator validator) { | |
this.service = service; |
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
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" | |
redirectPort="8443" | |
compression="on" | |
compressionMinSize="1024" | |
compressableMimeType="text/css,application/javascript" /> |
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
@ManagedBean | |
public class UserBean { | |
private String name; | |
private List<User> users = new ArrayList<User>(); | |
public String listAll() { | |
UserDao dao = new UserDao(); | |
this.users = dao.findByName(name); | |
return "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
public class MyTest { | |
@Rule | |
public MethodRule screenshot = new ScreenshotOnFailureRule(); | |
@Test | |
public void myTest() { ... } | |
... | |
} |
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
@Entity | |
public class Bem implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
private Long id; | |
@ManyToOne |
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
$.validator.addMethod("lessOrEqualsThan", function(value, element, param) { | |
var parsedValue = value.replace(/\./g, "").replace(",", "."); | |
return this.optional(element) || (parseFloat(parsedValue) <= param); | |
}, "Valor deve ser menor ou igual a {0}."); | |
$.validator.addMethod("inRange", function(value, element, param) { | |
var parsedValue = value.replace(/\./g, "").replace(",", "."); | |
var amount = parseFloat(parsedValue); | |
return this.optional(element) || (amount >= param[0] && amount <= param[1]); | |
}, "Valor deve estar entre {0} e {1}."); |
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
sudo mysqldump -u root old_schema | mysql -u root new_schema |
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
find -name "*.jsp" | xargs sed -i "s:\\]\[:,:g" && find -name "*.jsp" | xargs sed -i "s:\(linkTo\[[a-zA-Z0-9]*\]\.[a-zA-Z0-9]*\)\[\(.*\)\]:\1(\2):" |
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 Validate { | |
public static boolean not(boolean expression){ | |
return !expression; | |
} | |
public static boolean in(String value, String[] options){ | |
return StringUtil.in(value, options); | |
} | |
OlderNewer