Repository: incubator-juneau Updated Branches: refs/heads/master cf04d3992 -> 50baa1e20
JUNEAU-46 Remove references to wink Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/50baa1e2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/50baa1e2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/50baa1e2 Branch: refs/heads/master Commit: 50baa1e2017b610df99ca1992921a8ebd2796e31 Parents: cf04d39 Author: JamesBognar <jamesbog...@apache.org> Authored: Tue Aug 8 15:20:12 2017 -0400 Committer: JamesBognar <jamesbog...@apache.org> Committed: Tue Aug 8 15:20:12 2017 -0400 ---------------------------------------------------------------------- juneau-core/src/main/javadoc/overview.html | 2 +- .../org/apache/juneau/rest/jaxrs/package.html | 236 +------------------ .../apache/juneau/rest/jaxrs/rdf/package.html | 2 +- 3 files changed, 3 insertions(+), 237 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/50baa1e2/juneau-core/src/main/javadoc/overview.html ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html index 9db52aa..758af57 100644 --- a/juneau-core/src/main/javadoc/overview.html +++ b/juneau-core/src/main/javadoc/overview.html @@ -10466,7 +10466,7 @@ </p> <ul class='spaced-list'> <li> - Juno-Wink integration components that have been requested my many for a long time!<br> + Juno-Wink integration components that have been requested by many for a long time!<br> Refer to <a class='doclink' href='org/apache/juneau/rest/jaxrs/package-summary.html#TOC'>org.apache.juneau.rest.jaxrs</a> for information. </li> <li> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/50baa1e2/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/package.html ---------------------------------------------------------------------- diff --git a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/package.html b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/package.html index 01e3f89..c699667 100644 --- a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/package.html +++ b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/package.html @@ -36,7 +36,7 @@ </script> </head> <body> -<p>JAX-RS / Wink integration components</p> +<p>JAX-RS integration components</p> <script> function toggle(x) { @@ -131,241 +131,7 @@ For the most part, when using these components, you'll either use the existing <code>DefaultProvider</code> or <code>JuneauProvider</code> providers, or define your own by subclassing <code>BaseProvider</code>. - <h6 class='topic'>Example:</h6> - <p> - The <code>juneau_sample.war</code> project contains a sample <code>HelloWorldResource</code> class that - shows how to use the JAX-RS provider. It uses Wink as the JAX-RS implementation. - </p> - <p> - Wink is configured by registering the following servlet in the <code>web.xml</code> file of the web app: - </p> - <p class='bcode'> - <xt><?xml</xt> <xa>version</xa>=<xs>"1.0"</xs> <xa>encoding</xa>=<xs>"UTF-8"</xs><xt>?></xt> - <xt><web-app</xt> <xa>version</xa>=<xs>"2.3"</xs><xt>></xt> - <xt><servlet></xt> - <xt><servlet-name></xt>WinkService<xt></servlet-name></xt> - <xt><servlet-class></xt>org.apache.wink.server.internal.servlet.RestServlet<xt></servlet-class></xt> - <xt><init-param></xt> - <xt><param-name></xt>applicationConfigLocation<xt></param-name></xt> - <xt><param-value></xt>/WEB-INF/wink.cfg<xt></param-value></xt> - <xt></init-param></xt> - <xt></servlet></xt> - <xt><servlet-mapping></xt> - <xt><servlet-name></xt>WinkService<xt></servlet-name></xt> - <xt><url-pattern></xt>/wink/*<xt></url-pattern></xt> - <xt></servlet-mapping></xt> - <xt></web-app></xt> - </p> - <p> - The <code>wink.cfg</code> file lists our default provider and our sample resource: - </p> - <p class='bcode'> - org.apache.juneau.rest.jaxrs.DefaultProvider - com.foo.sample.jaxrs.HelloWorldResource - </p> - <p> - Interestingly, the <code>DefaultProvider</code> itself is a subclass of <code>BaseProvider</code> - with no code at all. It consists of annotations only: - </p> - <p class='bcode'> - <ja>@Provider</ja> - <ja>@Produces</ja>( - <js>"application/json,text/json,"</js>+ <jc>// JsonSerializer</jc> - <js>"application/json+schema,text/json+schema,"</js>+ <jc>// JsonSchemaSerializer</jc> - <js>"text/xml,"</js>+ <jc>// XmlDocSerializer</jc> - <js>"text/xml+schema,"</js>+ <jc>// XmlDocSerializer</jc> - <js>"text/html,"</js>+ <jc>// HtmlDocSerializer</jc> - <js>"application/x-www-form-urlencoded,"</js>+ <jc>// UrlEncodingSerializer</jc> - <js>"text/xml+soap,"</js>+ <jc>// SoapXmlSerializer</jc> - <js>"text/xml+rdf,"</js>+ <jc>// RdfXmlDocSerializer</jc> - <js>"application/x-java-serialized-object"</js> <jc>// JavaSerializedObjectSerializer</jc> - ) - <ja>@Consumes</ja>( - <js>"application/json,text/json,"</js>+ <jc>// JsonParser</jc> - <js>"text/xml,"</js>+ <jc>// XmlParser</jc> - <js>"text/html,"</js>+ <jc>// HtmlParser</jc> - <js>"application/x-www-form-urlencoded"</js> <jc>// UrlEncodingParser</jc> - ) - <ja>@JuneauProvider</ja>( - serializers={ - JsonSerializer.<jk>class</jk>, - JsonSchemaSerializer.<jk>class</jk>, - XmlDocSerializer.<jk>class</jk>, - XmlSchemaDocSerializer.<jk>class</jk>, - HtmlDocSerializer.<jk>class</jk>, - UrlEncodingSerializer.<jk>class</jk>, - SoapXmlSerializer.<jk>class</jk>, - RdfXmlDocSerializer.<jk>class</jk>, - JavaSerializedObjectSerializer.<jk>class</jk> - }, - parsers={ - JsonParser.<jk>class</jk>, - XmlParser.<jk>class</jk>, - HtmlParser.<jk>class</jk>, - UrlEncodingParser.<jk>class</jk> - } - ) - <jk>public final class</jk> DefaultProvider <jk>extends</jk> BaseProvider {} - </p> - <p> - Similarly, if you're defining your own JAX-RS provider, you can do so using annotations only. - </p> - <p> - <p> - Our sample resource is shown below. - In this example, we've specified a <code><ja>@RestMethod</ja></code> annotation on the - getter to show how properties can be overridden on the serializers/parsers at the method level. - This annotation is optional. - </p> - - <p class='bcode'> - <ja>@Path</ja>(<js>"/helloworld"</js>) - <jk>public class</jk> HelloWorldResource { - - <jc>// Our bean message class</jc> - <jk>public static class</jk> Message { - - <jc>// No-arg bean constructor (needed for parsers)</jc> - <jk>public</jk> Message() {} - - <jk>public</jk> Message(String text, String author) { - <jk>this</jk>.text = text; - <jk>this</jk>.author = author; - } - - <jk>public</jk> String text; - <jk>public</jk> String author; - } - - <jk>private static</jk> Message message = <jk>new</jk> Message(<js>"Hello world"</js>, <js>"John Smith"</js>); - - <ja>@GET</ja> - <ja>@Produces</ja>(<js>"*/*"</js>) - <ja>@RestMethod</ja>( <jc>/* Override some properties */</jc> - properties={ - <ja>@Property</ja>(name=SerializerContext.<jsf>SERIALIZER_useWhitespace</jsf>, value=<js>"true"</js>), - <ja>@Property</ja>(name=JsonSerializerContext.<jsf>LAX_MODE</jsf>, value=<js>"true"</js>) - } - ) - <jk>public</jk> Message getMessage() { - <jk>return</jk> message; - } - - <ja>@PUT</ja> - <ja>@Produces</ja>(<js>"*/*"</js>) - <ja>@Consumes</ja>(<js>"*/*"</js>) - <jk>public</jk> Message replaceMessage(Message message) { - HelloWorldResource.message = message; - <jk>return</jk> message; - } - } - </p> - <p> - When we start up the servlet, we can interact with the resource using cURL. - In these examples, note that the <jsf>SERIALIZER_useWhitespace</jsf> and <jsf>LAX_MODE</jsf> settings - cause the output to be readable instead of condensed. - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: text/json" -X GET http://localhost:9080/sample/wink/helloworld - <ja>{ - text:"Hello world", - author:"John Smith" - }</ja> - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: text/html" -X GET http://localhost:9080/sample/wink/helloworld - <ja><html> - <head> - </head> - <body> - <table type="object"> - <tr> - <th> - <string>key</string> - </th> - <th> - <string>value</string> - </th> - </tr> - <tr> - <td> - <string>text</string> - </td> - <td> - <string>Hello world</string> - </td> - </tr> - <tr> - <td> - <string>author</string> - </td> - <td> - <string>John Smith</string> - </td> - </tr> - </table> - </body> - </html></ja> - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: text/xml" -X GET http://localhost:9080/sample/wink/helloworld - <ja><?xml version="1.0" encoding="UTF-8"?> - <object> - <text>Hello world</text> - <author>John Smith</author> - </object></ja> - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: application/x-www-form-urlencoded" -X GET http://localhost:9080/sample/wink/helloworld - <ja>text='Hello+world'&author='John+Smith'</ja> - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: text/xml+schema" -X GET http://localhost:9080/sample/wink/helloworld - <ja><?xml version="1.0" encoding="UTF-8"?> - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <xs:element name="object" nillable="true"> - <xs:complexType> - <xs:sequence minOccurs="0" maxOccurs="unbounded"> - <xs:element name="text" type="xs:string" nillable="true" minOccurs="0"/> - <xs:element name="author" type="xs:string" nillable="true" minOccurs="0"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="null"/> - </xs:schema></ja> - </p> - <p class='bcode'> - C:\>curl.exe -H "Accept: application/x-java-serialized-object" -X GET http://localhost:9080/sample/wink/helloworld - <ja>detailMessaget âLjava/lang/String;[ ption(Vx ÏÃ¥â¬5â» xr âjava.io.ObjectStreamExceptiondâΣkì9âââ» xr â¼java.io.IOExcept - stackTracet â²[Ljava/lang/StackTraceElement;xpq t /org.apache.juneau.samples.jaxrs.HelloWorldResource$Messageur â²[Ljava.lang.Sta - lineNumberL â«declaringClassq ~ â LfileNameq ~ â L - methodNameq ~ â xp â¦Ã¡t âjava.io.ObjectOutputStreamt â¨ObjectOutputStream.javat âwriteObject0sq ~ â âº[t âjava.io.Obje - 3org.apache.juneau.serializer.OutputStreamSerializert âOutputStreamSerializer.javat serializesq ~ â ^t &com.ib - &t /org.apache.wink.server.handlers.AbstractHandlert ¶AbstractHandler.javat â«handleResponsesq ~ â ât 5org.apache. - sq ~ â Ct 5org.apache.wink.server.handlers.AbstractHandlersChaint âAbstractHandlersChain.javat doChainsq ~ â 't - â handlesq ~ â â¬t 5org.apache.wink.server.handlers.ResponseHandlersChaint âResponseHandlersChain.javat â handlesq ~ - â«handleResponsesq ~ â ât 5org.apache.wink.server.handlers.ResponseHandlersChaint âResponseHandlersChain.javat â ha - tHandlersChain.javat doChainsq ~ â Zt -org.apache.wink.server.internal.log.Responsest â«Responses.javat â«handleResp - eHandlersChain.javat â handlesq ~ â Ct 5org.apache.wink.server.handlers.AbstractHandlersChaint âAbstractHandlersCha - handleRequestsq ~ â |t 3org.apache.wink.server.internal.servlet.RestServlett âºRestServlet.javat servicesq ~ â â»Â£t - handleRequestsq ~ â ât -com.ibm.ws.webcontainer.channel.WCChannelLinkt âWCChannelLink.javat â£readysq ~ â âºât 4com - âºhandleNewRequestsq ~ â âº1t 4com.ibm.ws.http.channel.inbound.impl.HttpInboundLinkt ¶HttpInboundLink.javat â«process - nnectionInitialReadCallback.javat ¶sendToDiscriminatorssq ~ â qt <com.ibm.ws.tcp.channel.impl.NewConnectionInitial - ât $com.ibm.io.async.AbstractAsyncFuturet âAbstractAsyncFuture.javat â«invokeCallbacksq ~ â Ãt #com.ibm.io.async. - t âResultHandler.javatcompletesq ~ â â¥t â²com.ibm.io.async.ResultHandlert âResultHandler.javat â¬runEventProcessingLo - on: java.io.NotSerializableException: org.apache.juneau.samples.jaxrs.HelloWorldResource$Message</ja> - </p> - <p> - The following shows the PUT method being invoked. - In this case, we're passing in the new bean as a JSON object. - Also notice how the response is in standard condensed JSON since we did not override any properties on the REST method. - </p> - <p class='bcode'> - C:\>curl.exe -H "Content-Type: text/json" -H "Accept: text/json" -d "{text:'Hello again',author:'Jane Doe'}" - -X PUT http://localhost:9080/sample/wink/helloworld - <ja>{"text":"Hello again","author":"Jane Doe"}</ja> </p> </div> - </body> </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/50baa1e2/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/rdf/package.html ---------------------------------------------------------------------- diff --git a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/rdf/package.html b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/rdf/package.html index 6bb6d97..d315293 100644 --- a/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/rdf/package.html +++ b/juneau-rest-jaxrs/src/main/java/org/apache/juneau/rest/jaxrs/rdf/package.html @@ -29,6 +29,6 @@ </style> </head> <body> -<p>JAX-RS / Wink integration components with RDF support</p> +<p>JAX-RS integration components with RDF support</p> </body> </html> \ No newline at end of file