Skip to main content

Release Notes 8.x

This page collects every release in the 8.x line, newest first.

Release 8.2.0​

Date: Oct 14, 2020

Juneau 8.2.0 is a major release.

The most significant change is the addition of an entirely new RestClient API build from scratch with near 100% unit test coverage.

The new API is located in the org.apache.juneau.rest.client2 package and will replace the old API in 9.0.

juneau-marshall​

  • @Bean and @BeanIgnore annotations can alternately occur in parent class hierarchy. The first one found dictates whether a class is ignored as a bean or not.

  • Applying the @Bean annotation on a class will now force non-public classes to be interpreted as beans. For example, applying @Bean to a private class will force it to be treated as a bean. Also, if a public bean constructor cannot be found, the default constructor will be used regardless of it's visibility if the @Bean annotation is on the class.

  • The @Beanc annotation can now be recognized and used on non-public constructors.

  • Annotations are now aggregated across the entire class hierarchy instead of simply being overridden.

    The following is an example.

    // Parent class with properties a,b,c
    @Bean(bpi="a,b,c")
    public class MyClass {
    public int a, b, c, d;
    }

    // New behavior: Child class with properties a,c because @Beans are aggregated.
    // Old behavior: Child class with properties a,c,d because @Bean is overridden.
    @Bean(bpx="b")
    public class MyChildClass extends MyClass {
    public int a, b, c, d;
    }
  • Include/exclude/read-only/write-only properties defined on the bean context now override those defined on annotations of the class itself. For example, the following methods override the @Bean annotations on classes:

    BeanContext.Builder bpi(Class,String) bpi(String,String) bpx(Class,String) bpx(String,String) bpro(Class,String) bpro(String,String) bpwo(Class,String) bpwo(String,String)
  • Config annotations now override class-level annotations. For example, only the 'a' and 'b' properties get serialized on the bean below:

    // Parent class with properties a,b,c
    @Bean(bpi="a,b,c")
    public class MyClass {
    public int a, b, c, d;
    }

    @RestMethod
    @BeanConfig(beanApply={@Bean(on="MyClass",bpi="a,b")}
    public MyClass getMyClass() {...}
  • The following concrete annotation implementation classes are now provided that can be used with the BeanContext.Builder.annotations(Annotation...) method:

    BeanAnnotation implements @BeanBeancAnnotation implements @BeancBeanIgnoreAnnotation implements @BeanIgnoreBeanpAnnotation implements @BeanpExampleAnnotation implements @ExampleNamePropertyAnnotation implements @NamePropertyParentPropertyAnnotation implements @ParentPropertySwapAnnotation implements @SwapUriAnnotation implements @URICsvAnnotation implements @CsvHtmlAnnotation implements @Html JsoAnnotation implements @JsoJsonAnnotation implements @Json SchemaAnnotation implements @SchemaMsgPackAnnotation implements @MsgPackOpenApiAnnotation implements @OpenApiPlainTextAnnotation implements @PlainTextSoapXmlAnnotation implements @SoapXmlUonAnnotation implements @UonUrlEncodingAnnotation implements @UrlEncodingXmlAnnotation implements @Xml

    Example:

    @Bean(bpi="street,city") // Will be overridden
    public class AddressBean {...}

    Bean ba = new BeanAnnotation("AddressBean").bpi("street,city,state");
    WriterSerializer ws = JsonSerializer.create().annotations(ba).build();
    String json = ws.toString(addressBean); // Will print street,city,state

    Plus similar annotation classes for other serializer/parser annotations.

  • The BeanContext.Builder.annotations(Annotation...) method can be used to apply annotations to classes during runtime.

  • Bean maps now have the concept of "hidden" properties (properties that aren't serialized but otherwise accessible). For example, the @Html.link can now reference hidden properties:

    @Bean(bpi="a") // Will be overridden
    public class MyBean {

    @Html(link="servlet:/{b}")
    public String a;

    public String b; // Not serialized but referenced in link on a.

    }

    The general rule for the BeanMap class is that get(), put(), and containsKey() will work against hidden properties but keySet() and entrySet() will skip them.

  • Several bug fixes in the HtmlSerializer and HtmlParser classes around the handling of collections and arrays of beans with @Bean(typeName) annotations.

  • New swaps auto-added to all serializers/parsers:

    MatchResultSwap StackTraceElementSwap
  • @Html.noTableHeaders now can be applied to collections of beans.

  • New @HtmlDocConfig.asideFloat setting so that you can position the contents of the aside section on the page.

  • Various minor fixes surrounding HTML serialization:

    • Collections of beans that were supposed to be serialized as tables were being serialized as lists.
    • Collections of beans with @Bean(bpi) were not being serialized in the correct column order.
  • Fixed a bug where a copy constructor can erroneously be recognized as a builder constructor if the class also has a static create method. Net effect was that the copy constructor would needlessly be called during parsing.

  • New org.apache.juneau.collections package containing various convenience fluent-style collection classes:

    AList ASet ASortedSet AMap ASortedMap OMap OList
  • ObjectMap is being deprecated and replaced with OMap.

  • ObjectList is being deprecated and replaced with OList.

  • All classes in the org.apache.juneau.http.response and exception now have header(String,Object) methods for adding response headers.

    // Method that performs a BASIC Auth handshake.
    @RestMethod
    public Ok checkBasicAuth(@Header("Authorization") String auth) throws Unauthorized {
    if (auth == null)
    throw new Unauthorized().header("WWW-Authenticate", "BASIC realm=\"foo\"");
    return Ok.OK;
    }
  • New annotations for multi-part support:

    Header.multi() Query.multi() FormData.multi()
  • BeanTraverseContext.BEANTRAVERSE_ignoreRecursions setting no longer requires BeanTraverseContext.BEANTRAVERSE_detectRecursions to be enabled.

  • Fixed bug in JSON/UON/URL-Encoding serializers where indentation was not correct of first line when BeanTraverseContext.BEANTRAVERSE_initialDepth used.

  • Fixed bug in JSON/UON/URL-Encoding serializers where properties past the max depth were being serialized as null instead of being treated as null and not being serialized at all.

  • Fixed bug in HTML serializer where tables of maps were not sorted if SERIALIZER_sortMaps was specified.

  • SERIALIZER_trimNullProperties has been replaced with Serializer.SERIALIZER_keepNullProperties SERIALIZER_keepNullProperties.

  • Improvements to OpenAPI serializer and parser:

    • Collection format can now be specified on OBJECTs to allow key/value pairs to be delimited with the same support as ARRAYs.
    • New OpenApiCommon.OAPI_format OAPI_format and OpenApiCommon.OAPI_collectionFormat OAPI_collectionFormat properties.
  • Convenience methods added to HttpPartSchema and related classes to simplify schema definitions:

    import static org.apache.juneau.httppart.HttpPartSchema.*;

    // Old
    HttpPartSchema s = schema("object")
    .property("f01", schema("array").collectionFormat("pipes").items(schema("string")))
    .property("f02", schema("array").collectionFormat("pipes").items(schema("string", "byte")))
    .property("f03", schema("array").collectionFormat("pipes").items(schema("string", "date-time")))
    .build();

    // New
    HttpPartSchema s = tObject()
    .p("f01", tArray(tString()))
    .p("f02", tArray(tByte()))
    .p("f03", tArray(tDateTime()))
    .build();
  • Fixes where the bean method/constructor visibility wasn't being used when finding swap methods and constructors.

  • HTML-Schema support is being deprecated due to low-use and difficulty in maintaining. It will be removed in 9.0.

  • JuneauLogger class is being deprecated. Improvements in logging in Java 8 make it obsolete.

  • Bean filters can now be specified programmatically through a builder API.

    // Create a JSON serializer that only includes specified fields on a specific class.
    WriterSerializer s = JsonSerializer
    .create()
    .beanFilters(BeanFilter.create(MyBean.class).bpi("foo,bar,baz").build())
    .build();
  • BeanContext.REST_pojoSwaps replaced with BeanContext.BEAN_swaps (and builder methods as well).

  • New RootBeanPropertyMeta class added for when you need BeanPropertyMeta from somewhere and all you have is a Class.

  • New Bean Property Interceptor API for intercepting calls to bean getters/setters.

    BeanInterceptor@Bean.interceptorBeanContext.Builder.beanInterceptor(Class,Class)
  • Fluent setters that follow the withX convention are now automatically detected by all parsers.

    // A bean with a fluent setter.
    public class MyBean {
    public MyBean withFoo(String foo) {
    this.foo = foo;
    return this;
    }
    }

    Note you could previously use the @BeanProperty annotation to identify these setters.

juneau-rest-server​

  • New RestContext.REST_context REST_context/Rest.context() @Rest(context) setting to allow you to extend the RestContext class.

  • @Rest-annotated classes can now implement the following interfaces directly instead of having to define secondary classes and hook them up through annotations:

    RestCallHandler - Normally defined through @Rest.callHandler() RestInfoProvider - Normally defined through @Rest.infoProvider() RestCallLogger - Normally defined through @Rest.callLogger() ClasspathResourceFinder - Normally defined through @Rest.classpathResourceFinder()

    The methods added for RestInfoProvider are:

    RestServlet getSwagger(RestRequest) getSiteName(RestRequest) getTitle(RestRequest) getDescription(RestRequest) getMethodSummary(Method,RestRequest) getMethodDescription(Method,RestRequest) BasicRest getSwagger(RestRequest) getSiteName(RestRequest) getTitle(RestRequest) getDescription(RestRequest) getMethodSummary(Method,RestRequest) getMethodDescription(Method,RestRequest)

    The methods added for RestCallLogger are:

    RestServlet RestServlet.log(RestCallLoggerConfig,HttpServletRequest,HttpServletResponse) log(RestCallLoggerConfig,HttpServletRequest,HttpServletResponse) BasicRest BasicRest.log(RestCallLoggerConfig,HttpServletRequest,HttpServletResponse) log(RestCallLoggerConfig,HttpServletRequest,HttpServletResponse)

    The methods added for ClasspathResourceFinder are:

    RestServlet RestServlet.findResource(Class,String,Locale) findResource(Class,String,Locale) BasicRest BasicRest.findResource(Class,String,Locale) findResource(Class,String,Locale)

    The methods added for RestResourceResolver are:

    RestServlet oajr.RestServlet.resolve(Object,Class,RestContext.Builder,Object...) resolve(Object,Class,RestContext.Builder,Object...) BasicRest
  • Added the following convenience hook methods on the RestServlet and BasicRest classes:

    RestServlet oajr.RestServlet.onInit(RestContext.Builder) onInit(RestContext.Builder) RestServlet.onPostInit(RestContext) onPostInit(RestContext) RestServlet.onPostInitChildFirst(RestContext) onPostInitChildFirst(RestContext) RestServlet.onDestroy(RestContext) onDestroy(RestContext) RestServlet.onStartCall(HttpServletRequest,HttpServletResponse) onStartCall(HttpServletRequest,HttpServletResponse) RestServlet.onPreCall(RestRequest,RestResponse) onPreCall(RestRequest,RestResponse) RestServlet.onPostCall(RestRequest,RestResponse) onPostCall(RestRequest,RestResponse) RestServlet.onEndCall(HttpServletRequest,HttpServletResponse) onEndCall(HttpServletRequest,HttpServletResponse) BasicRest oajr.BasicRest.onInit(RestContext.Builder) onInit(RestContext.Builder) BasicRest.onPostInit(RestContext) onPostInit(RestContext) BasicRest.onPostInitChildFirst(RestContext) onPostInitChildFirst(RestContext) BasicRest.onDestroy(RestContext) onDestroy(RestContext) BasicRest.onStartCall(HttpServletRequest,HttpServletResponse) onStartCall(HttpServletRequest,HttpServletResponse) BasicRest.onPreCall(RestRequest,RestResponse) onPreCall(RestRequest,RestResponse) BasicRest.onPostCall(RestRequest,RestResponse) onPostCall(RestRequest,RestResponse) BasicRest.onEndCall(HttpServletRequest,HttpServletResponse) onEndCall(HttpServletRequest,HttpServletResponse)
  • New @Rest.debugOn annotation for turning on debug mode using class/method identifiers:

    // Turn on debug per-request on the class and always on the doX() method.
    @Rest(
    debugOn="MyResource=per-request,Mysource.doX=true" // Typically defined via system or env property.
    )
    public class MyResource {

    @RestMethod
    public void String doX() {
    ...
    }
    }
  • BasicRestConfig has been broken up into BasicRestConfig and BasicRestMethods so that you're not forced to implement methods such as getOptions() and getStats() if you're implementing the interface to configure your REST class.

  • Any of the following classes can now be instantiated with public static create() methods:

    RestCallHandler RestCallLogger RestInfoProvider ClasspathResourceFinder RestResourceResolver RestGuard ResponseHandler
  • New Path.required() @Path(required) annotation support. A path can be marked as not-required when the path variable is resolved by a parent resource like so:

    @Rest(path="/parent/{p1}",children=Child.class)
    public class Parent {
    ...
    }

    @Rest(path="/child")
    public class Child {

    @RestMethod(path="/")
    public String doGet(@Path(name="p1",required=false) String p1) {
    // p1 will be null when accessed via "/child"
    // p1 will be non-null when accessed via "/parent/p1/child".
    }
    ...
    }

    This allows the child resource to be mapped to multiple parents that may resolve various different path variables.

  • New RestMethod.paths() @RestMethod(paths) annotation that allows you to map multiple paths to the same Java method.

    Example:

    @RestMethod(
    name=GET,
    paths={"/","/{foo}"}
    )
    public String doGet(@Path(name="foo",required=false) String foo) {...}
  • The RestMethod @RestMethod annotation is now implied on all unannotated methods of a @Rest @Rest-annotated interface.

    @Rest
    public interface MyRest {
    String getFoo(); // @RestMethod(name=GET,path="/foo") is implied.
    }
  • Improved RestContext.REST_messages REST_messages support (mostly bug fixes).

juneau-rest-server-springboot​

  • JuneauRestInitializer now provides a no-arg constructor so that it can be used in the @ConfigurationContext(initializers=JuneauRestInitializer.class) when unit testing using @SpringBootTest.

  • New ResourceDescription.ResourceDescription(String,String,String) constructor and ResourceDescriptions.append(String,String,String) method.

  • New Hyperlink class.

juneau-rest-client​

  • Completely revamped RestClient API.

    • All APIs now extend from HttpClient interfaces.
    • Better integration with HttpClient.
    • New fluent-style methods with many new convenience methods.
    • Updated juneau-rest-client.
  • @RemoteMethod-annotated methods can now return Future and CompletableFuture for concurrent processing of requests.

    Example:

    @Remote
    public interface MyInterface {
    public Future<String> doGet();
    }

    MyInterface i = client.getRemote(MyInterface.class, "http://localhost:12345/myInterface");
    Future<String> f = i.doGet();
    // Do other stuff.
    String result = f.get();
  • Additions to @Remote annotation:

    • @Remote.version - Adds a client version header to all requests.
    • @Remote.headers - Adds a set of headers to all requests.
    • headerSupplier - Adds a dynamic supplier of headers to all requests.

juneau-rest-mock​

  • The MockRest and MockRemote classes have been remove entirely and all existing functions have been moved into the improved MockRestClient class. All REST test mocking can be done through this single class.

Release 8.1.3​

Date: Jan 20, 2020

Juneau 8.1.3 is a moderate release.

juneau-marshall​

  • Dynamically applied annotations: DynamicallyAppliedAnnotations

  • Better representation of nulls for XML and HTML content properties.

    • Old: "<myBean><null></myBean>"
    • New: "<myBean nil='true'></myBean>"
  • Configurable properties such as Context.CONTEXT_debug can now be set globally by either system properties or environment variables. For CONTEXT_debug you can use either the system property Context.debug or environment variables CONTEXT_DEBUG.

  • Fixed an initialization time race condition that can cause initial parse errors when concurrently parsing into array types like so:

    JsonParser.DEFAULT.parse(input, MyBean[].class);

juneau-rest-server​

  • Fixed bug in BasicRestCallHandler where if you have the following REST methods...

    @RestMethod(name="GET", path="/foo")
    @RestMethod(name="*", path="/bar")

    ...and you tried to make a GET request to /bar, you'd erroneously get a 404 error instead of matching the 2nd method.

  • Fixed an issue involving using Juneau REST with Spring Security. When Spring Security cannot authenticate a request, it sets the URL on the request to "/error" with a 401 status. When Juneau then processes this request, it cannot find that mapping and changes the status to 404 which messes with HTTP clients. Solution was to add a default no-op error method to the BasicRestConfig (and implementers):

    @RestMethod(name="*", path="/error")
    public void error() {}
  • Fixed a bug where @RestResource(debug="true") wouldn't log requests if a @RestMethod-annotated method was not matched.

  • Renamed the following annotations:

    • @Rest(attrs) → @Rest(reqAttrs)
    • @Rest(defaultRequestHeaders) → @Rest(reqHeaders)
    • @Rest(defaultResponseHeaders) → @Rest(resHeaders)
    • @RestMethod(attrs) → @RestMethod(reqAttrs)
    • @RestMethod(defaultRequestHeaders) → @RestMethod(reqHeaders)
  • New auto-generated REST method execution statistics: RestExecutionStatistics

juneau-rest-client​

  • Several convenience methods defined in RestClient.Builder that were deprecated in 8.1.2 have been undeprecated in this release due to user feedback.

juneau-doc​

  • New auto-generated glossary of all configurable properties: GlossaryConfigurableProperties

Release 8.1.2​

Date: Dec 01, 2019

Juneau 8.1.2 is a moderate release.

juneau-marshall​

juneau-rest-server​

  • @Rest replaces @RestResource with shorter syntax.

  • New method RestResponse.setHeaderSafe(String,String) to strip invalid characters from header values.

  • Fixed issues related to invalid characters being set on HTTP header values.

juneau-rest-client​

  • RestClient is now extendible. The constructor has been made public and simplified to: RestClient(RestClient.Builder).

  • Duplicate methods between RestClient.Builder and HttpClientBuilder have been made deprecated on the former. This eliminates the need to try to keep the two builder classes in sync.

Release 8.1.1​

Date: Sept 20, 2019

Juneau 8.1.1 is a minor release but introduces some new features/modifications.

juneau-marshall​

  • Support for serializing/parsing Optional objects and bean properties.

  • Fixed a bug in the parsers where the generic subtype of a complex bean property type involving both collections and arrays was not being found. (e.g. List<Long>[])

  • New packages of HTTP response/exceptions beans from juneau-rest-server bundle and REST proxy annotations from juneau-rest-client so that they can be used when building REST proxy interfaces while only pulling in the marshall bundle.

    org.apache.juneau.http.response org.apache.juneau.http.exceptionorg.apache.juneau.http.remote

These replace the org.apache.juneau.rest.response, org.apache.juneau.rest.exception, and org.apache.juneau.rest.client.remote packages.

  • Defaulting SVL variables now won't ignore additional parameters. "$S{Foo,bar,baz}" used to default to "bar" but now will default to "bar,baz".

  • Ranking support has been added to all @XConfig annotations. This allows you to override the normal precedence of application of config annotations on class and method hierarchies.

juneau-rest-server​

  • Support for Optional on method parameters annotated with @Header, @FormData, @Query, @Path.

  • Fixed issue where RestMethod.debug() annotation wasn't resulting in the HTTP request being logged.

  • RestException has been deprecated and replaced by HttpException.

  • Resolved issue where parameterized types on @RestMethod-annotated method parameters of Spring beans. This is due to Spring relying on CGLIB for runtime-recompilation of beans that results in loss of parameterized-type information.

    In the following example, the beans parameter would resolve as an unparameterized List<Object> which would typically result in getting a List<ObjectMap> and subsequent ClassCastExceptions.

    @RestMethod
    public void doFoo(@Body List<MyBean> beans) {...}

    The fix involves resolving the original bean class for resolving parameterized type while leaving method invocation on the proxy method so as not to bypass Spring features.

  • New methods on BasicRest to provide feature-parity with RestServlet:

    BasicRest BasicRest.getContext() getContext() BasicRest.getRequest() getRequest() BasicRest.getResponse() getResponse() BasicRest.log(String) log(String) BasicRest.log(String,Throwable) log(String,Throwable) BasicRest.log(Level,String,Object[]) log(Level,String,Object[]) BasicRest.logObjects(Level,String,Object[]) BasicRest.log(Level,Throwable,String,Object[]) log(Level,Throwable,String,Object[])
  • The @RestResource(staticFiles) annotation now supports absolute path locations and multiple mappings:

    // Resolves static files in root package "htdocs" or working directory "htdocs", and then relative package "htdocs".
    @RestResource(staticFiles="htdocs:/htdocsfolder,htdocs:htdocs.package")
  • Fixed a bug in @RestResource(staticFiles) where the order of lookup between parent and child resources was wrong.

juneau-rest-client​

  • Removed the dependency on the juneau-rest-server module. Allows the client API to be used without pulling in all the javax.servlet and server dependencies.

  • Support for Optional return types on remote proxy methods.

juneau-examples​

Release 8.1.0​

Date: Aug 21, 2019

8.1.0 introduces some significant new features including:

  • Configurable Annotations
  • Default PojoSwaps
  • Config Imports
  • BasicRest, BasicRestGroup classes
  • Path variables on resource paths
  • Request Attributes API
  • Role Guards
  • Improved REST logging/debugging
  • New MockRest API

juneau-marshall​

  • New utility class for diffing beans:

    BeanDiff
  • New annotation for defining bean property names:

    Name
  • New serializer properties:

    WriterSerializer WSERIALIZER_fileCharset WSERIALIZER_streamCharset
  • The following POJO methods can be used to convert a POJO to/from a Map before serialization and after parsing. It's a convenient way of defining a POJO transform.

    public Map<String,Object> toMap() - Can be any type of map with string keys and object vals.public ObjectMap toMap()public Map<String,Object> toMap(BeanSession bs) - Can be any type of map with string keys and object vals.public ObjectMap toMap(BeanSession bs)public static T fromMap(Map<String,Object> m) - Can be any type of map with string keys and object vals.public static T fromMap(ObjectMap m)public static T fromMap(BeanSession bs, Map<String,Object> m) - Can be any type of map with string keys and object vals.public static T fromMap(BeanSession bs, ObjectMap m)
  • New convenience debugging methods on Marshall API:

    Marshalloaj.marshall.Marshall.format(String,Object...) format(String,Object...) - MessageFormat-style formatter.oaj.marshall.Marshall.out(String,Object...) out(String,Object...) - Prints MessageFormat-style messages to STDOUT.oaj.marshall.Marshall.err(String,Object...) err(String,Object...) - Prints MessageFormat-style messages to STDERR.
  • Serializer and parser APIs now throw IOExceptions in addition to SerializeException and ParseException to make it easier to determine if problems are stream based or syntax based.

  • New Java 8 date-time transforms:

    • TemporalSwap - For all Java 8 temporal types (e.g. ZonedDateTime)
    • TemporalDateSwap - For Date
    • TemporalCalendarSwap - For Calendar
  • All serializers and parsers now have built-in default swaps for common class types:

    EnumerationIteratorLocaleCalendar - ISO offset date-time.Date - Local date-timeInstant - ISO instant.ZonedDateTime - ISO offset date-time.LocalDate - ISO local date.LocalDateTime - ISO local date-time.LocalTime - ISO local time.OffsetDateTime - ISO offset date-time.OffsetTime - ISO offset time.Year - ISO year.YearMonth - ISO year-month.Temporal - ISO instant.TimeZoneXMLGregorianCalendarZoneId

juneau-config​

  • Support for import statements:

    // Import values from another configuration:
    <ParentConfig1>

    [Foo]
    bar = baz
  • The ConfigFileStore now automatically resolves file extensions. New configuration property for specifying search paths for file extensions: FILESTORE_extensions

  • Fixed a bug where instances of ConfigMemoryStore ended up resolving to the same object.

  • Uses application.properties file as a system default if present. Useful when being used in a Spring Boot application.

  • New Config.setSystemProperties method for quickly moving configuration settings into the system properties.

  • Entries in the system config are automatically set as system properties. This means you can set any of the various serializer and parser settings (e.g. JsonSerializer.simpleMode.b) in the default configuration area or application.properties.

juneau-rest-server​

  • New annotations that can be applied to REST classes and methods to configure serializers and parsers.

    Old way using generic properties:

    @RestResource(
    path="/atom",
    title="Sample ATOM feed resource",
    properties={
    @Property(name=WSERIALIZER_quoteChar, value="'"),
    @Property(name=RDF_rdfxml_tab, value="5"),
    @Property(name=RDF_addRootProperty, value="true"),
    @Property(name=BEAN_examples, value="{'org.apache.juneau.dto.atom.Feed': $F{AtomFeedResource_example.json}}")
    }
    ...
    )
    public class AtomFeedResource extends BasicRestServletJena {
    ...
    }

    New way using specific annotations:

    @RestResource(
    path="/atom",
    title="Sample ATOM feed resource"
    ...
    )
    @SerializerConfig(quoteChar="'")
    @RdfConfig(rdfxml_tab="5", addRootProperty="true")
    @BeanConfig(examples="Feed: $F{AtomFeedResource_example.json}")
    public class AtomFeedResource extends BasicRestServletJena {
    ...
    }

    Config annotations are provided for all serializers and parsers:

    BeanConfigCsvConfigHtmlConfigHtmlDocConfig JsoConfigJsonConfigJsonSchemaConfigMsgPackConfigOpenApiConfigParserConfigPlainTextConfig RdfConfigSerializerConfigSoapXmlConfigUonConfigUrlEncodingConfigXmlConfig
  • New support for using Servlet request attributes:

    RequestAttributesRestContext REST_attrsRestContext.Builder attrs(String...) attr(String,Object) RestMethodContext RestMethodContext.RESTMETHOD_attrs RESTMETHOD_attrsRestRequestgetAttributes()RestResponsegetAttributes() RestResponse.attr(String,Object) attr(String,Object)Attr RestMethod.attrs() RestResource.attrs()

    This deprecates the following APIs:

    RequestProperties RestMethodPropertiesRestRequest RestRequest.getProperties() getProperties() RestRequest.prop(String,Object) prop(String,Object)
  • Added the following classes that provide the same support as the servlet classes but doesn't extend from HttpServlet. This fixes an issue where instances of BasicRestServlet are registered as top-level servlets even though you don't want them to be.

    BasicRest - Non-servlet equivalent to BasicRestServlet BasicRestGroup - Non-servlet equivalent to BasicRestServletGroup BasicRestJena - Non-servlet equivalent to BasicRestServletJena BasicRestJenaGroup - Non-servlet equivalent to BasicRestServletJenaGroup
  • HTML widgets now have access to the RestResponse object if they need access to the output bean.

  • New annotations for simplified role-based guards on classes and methods:

    RestResource roleGuard() rolesDeclared() RestMethod RestMethod.roleGuard roleGuard() RestMethod.rolesDeclared rolesDeclared()
  • New annotations for fine-tuned handling of http-methods/http-headers as query parameters and others:

    RestResource allowedHeaderParams() allowedMethodHeaders() allowedMethodParams()
  • The @RestResource(path) annotation can now use variables:

    @RestResource(
    path="/myResource/{foo}/{bar}"
    )
    public class MyResource extends BasicRestServlet {...}
  • New methods:

    RestRequestgetCharset()RestResponsegetCharset()
  • New interface method for catching arbitrary thrown objects and converting them to other throwables:

    RestCallHandler RestCallHandler.convertThrowable(Throwable) convertThrowable(Throwable) BasicRestCallHandler convertThrowable(Throwable)
  • Support for fine-tuned logging of HTTP requests and responses:

    @RestResource(
    debug="per-request",
    logging=@Logging(
    level="info",
    rules={
    @LoggingRule(codes="400-499", level="warning", req="short", res="short"),
    @LoggingRule(codes="500-", level="severe", req="long", res="long")
    }
    )
    )
    public class MyRest {

    @RestMethod(
    method="POST",
    path="foo",
    logging=@Logging(
    level="info",
    rules={
    @LoggingRule(exceptions="NotFound*", level="info"),
    @LoggingRule(codes="200", disabled="true")
    }
    )
    )
    public String myMethod() throws Exception {...}
    }

    See RestLoggingAndDebugging for details.

  • Fixed a bug where the HTTP response was returning 405 (method not found) but should really be 404 (not found) when no path patterns match on any of the Java methods.

juneau-rest-client​

  • PATCH support added.

Release 8.0.0​

Date: Jan 01, 2019

This release cleans up deprecated APIs from the 7.2.0 release and makes significant modifications to the Microservice APIs.

The project structures of the REST, Microservice, and Examples have been modified to fit new Spring Boot integration support.

The structure is now as follows:

  • juneau-rest
    • juneau-rest-client
    • juneau-rest-server
    • juneau-rest-server-jaxrs
    • juneau-rest-server-rdf
    • juneau-rest-server-springboot - New Spring Boot integration support classes.
  • juneau-microservice
    • juneau-microservice-core - New. Contains base Microservice class.
    • juneau-microservice-jetty - New. Contains new JettyMicroservice class.
    • juneau-my-jetty-microservice - New. Template starter project for Jetty-based microservices.
    • juneau-my-springboot-microservice - New. Template starter project for Spring-Boot-based microservices.
  • juneau-examples
    • juneau-core
    • juneau-microservice-rest - Now contains only servlet example classes. No Jetty configuration.
    • juneau-microservice-rest-jetty - Servlet examples deployed using Jetty.
    • juneau-microservice-rest-springboot - Servlet examples deployed using Spring Boot.

juneau-svl​

juneau-config​

juneau-rest-server​

  • New methods on RestServlet:

    RestServlet.setRestResourceResolver(RestResourceResolver)RestServlet.getPath()
  • The registered resource resolver is now used to instantiate objects of classes defined via @RestResource. This allows for any of those instances to be injectable beans.

juneau-rest-server-springboot​

  • New project containing classes for making it easy to use Juneau with Spring Boot.

juneau-microservice-core​

  • New project that consists of just the core Microservice class and console support.

  • The Microservice API has been revamped to use a builder-based approach to creating microservices. The new API is considerably more flexible in design and allows for the configuration and external files to be located in either the home directory or inside the jar classpath.

  • If the microservice cannot find a config file in the home directory with the same name as the jar and the juneau.configFile system property is not found, it will try to find any file in the home directory that ends with .cfg.

  • New MicroserviceListener API for defining lifecycle event listeners.

  • New ConfigCommand class for performing config queries and updates through the microservice console.

juneau-microservice-jetty​

juneau-my-jetty-microservice​

  • New template starter project for Jetty-based microservices.

juneau-my-springboot-microservice​

  • Template starter project for Spring-Boot-based microservices.
  • app.json and Procfile files for deploying examples into Heroku. Includes instructions.