Release 5.1.0.20
Date: Sept 5, 2015
Juno 5.1.0.20 is a moderate update.
The biggest improvement is the ability to associate external INI config files with REST servlets using the
ConfigFile functionality.
Core
-
Significant API changes to
org.apache.juneau.config
API.ConfigFileis now thread safe and can be shared across multiple threads.- New
ConfigMgrclass for managing configuration files. - Serializers and parsers can be associated with config files for storing and retrieving POJOs. Default support provided for JSON.
-
New SimpleHtmlWriter class. Can be used for simple HTML DOM construction.
-
New
ProcBuilderclass for calling external processes. -
New
ObjectMap.remove(Class,String,Object)method. -
"class='link'"
added to links generated by HtmlDocSerializer. -
New
EncoderGroup.append(EncoderGroup)method. -
New
HtmlDocSerializerContext.HTMLDOC_addLinks
configuration property. -
Modified the
Parser.createContext(ObjectMap,Method,Object)
method. Outer context objects can be passed in to create instances of non-static inner classes. -
Fixed bug in HtmlStrippedDocSerializer where exception was thrown when trying to serialize primitive arrays.
-
JsonParser now handles parsing JSON boolean/numeric values as strings to bean properties of type boolean or number.
-
UrlEncodingSerializer and UrlEncodingParser now represent arrays and collections as key-value pairs where the keys are numbers (e.g.
"?0=foo&1=bar"
). -
Various internal improvements to
IOPipe. -
New
ReflectionUtils.getResource(Class,String)method. -
StringUtils.parseNumber(String,Class)now returns zero for empty strings. This affects the way most parsers handle blank values.
Server
-
You can now parse into non-static inner classes of a servlet for parameters/attributes/content. Useful if you like to define your marshaller beans inside your servlet.
-
Changes to
RestServlet:- New methods for accessing external INI config files:
RestServlet.getConfig()RestServlet.createConfigFile() - New
"$C{...}"
variable that resolve to INI config file values. - New
"$UE{...}"
variable that URL-encodes the value inside the variable. - New convenience methods for retrieving classpath resource files:
RestServlet.getResource(String)RestServlet.getResourceAsString(String)RestServlet.getResource(Class,String,String). Useful if you want to load predefined POJOs from JSON files in your classpath. - New
RestServlet.handleNotFound(int,RestRequest,RestResponse)method for customized handling of when a resource or method was not found.
- New methods for accessing external INI config files:
-
BasicRestServletnow automatically processes"/favicon.ico"
requests by overriding the new ~~ RestServlet.handleNotFound(int,RestRequest,RestResponse)~~ method. -
New RestRequest methods:
RestRequest.resolveVars(String)RestRequest.getVarResource(String)
RestRequest.getConfig()
-
New RestResponse methods:
- RestResponse.getDirectWriter(String).
- RestResponse.getNegotiatedWriter().
getWriter()
now returns an unnegotiated writer.getUnbufferedWriter()
has been removed.
-
New
RestMethod.encoders() @RestMethod(encoders)andRestMethod.inheritEncoders()annotations. Allows encoders to be fine-tuned at the method level. -
New
@RestResource(config)annotation for associating externalConfigFileconfig files with servlets. -
ResourceLink. -
New
org.apache.juneau.rest.matcher
package for commonly-usedRestMatchers:MultipartFormDataMatcherUrlEncodedFormMatcher
Microservice
-
New juneau-microservice.jar file that encapsulates all 3 juneau jars with code necessary for creating fast and efficent jetty-powered REST microservices. Contains the following:
- Jetty 8.0
- Apache HttpClient 4.3.5
- Apache Commons FileUpload 1.3.1
-
Microservice now supports Java 6 (previously required Java 7)