if (tipDocument.isPresent()) {
return tipDocument.get();
}
return null;
use
return tipDocument.orNull();
if (tipDocument.isPresent()) {
return tipDocument.get();
}
return null;
use
return tipDocument.orNull();
final Optional<MilestoneDocument> documentOfVersion = findDocumentOfVersion(documentType, documentVersion);
if (documentOfVersion == null) {
throw new IllegalStateException();
}
if (documentOfVersion.isPresent()) {
return documentOfVersion.get();
}
Windows with its cmd.exe seems not to be user friendly environment for developer. But this may be changed easily, you need only to install few programs we miss from normal systems. See http://gnuwin32.sourceforge.net and download coreutils, findutils, sed, awk, grep etc. and put them to PATH. As find.exe confilicts with windows file.exe I always rename it to gfind.exe . You have to be careful with quoting - only double quote is welcomed. Also paths may be tricki, remember to replace / with \. Eg. xargs needs extra backslash to interpret one properly.
Let's find all inserts in sql files.
find . -name '*.sql' | xargs grep insertIt is the win32 version:
gfind . -name "*.sql" | sed s!/!\\\\!g | xargs grep insert
Summary: having in mind few simple rules you may make your system much easier to talk to.
self
:%s/()/(self)/ in my vim :>
null, but None
None starts with capital letter, just like False, True and some others...
new to create new object
return explicitly
Caused by: org.apache.jasper.JasperException: /portal/activity/ActivityResultInfo.jsp(377,8) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1119) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:846) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:865) ...Fortunately we have not only found the problem but also a cure. Assuming web.xml for server is located in C:\Tools\WASC 2.1.1.4\var\catalina\conf, make sure it contains following entries:
keepgenerated = true is very important. Now, you can get rid of problem undeploying app, stopping your app server, cleaning scratch dir and redeploying app back. Then faces should run normally.jsp org.apache.jasper.servlet.JspServlet modificationTestInterval 0 development true fork false xpoweredBy false engineOptionsClass org.apache.geronimo.jasper.JspServletOptions scratchdir c:/Tools/WASC 2.1.1.4/var/catalina/worker1/ keepgenerated true 3
CENTRE LONDON UNITED KINGDOM U?K NORTHERN IRELAND WEST MIDS CENTRE LONDON WEST YORKSHIRE ENGLAQND UK ?UK GB,UNITED KINGDOM GB ENGLAND N.IRELAND MIDDLESEX CORNWALL GREAT BRITAIN U.K. WALES NIRELAND
String pong = new RestTemplate().getForObject(address + PING, String.class); Validate.isTrue(PONG.equals(pong));
HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); HttpEntity req = new HttpEntity<>(urlEncodeYourParams(), headers); RestTemplate rest = new RestTemplate(); ResponseEntity result = rest.postForEntity(address, req, String.class); System.out.println( result.getBody() );