Paul Sandoz wrote:
>
> We could do the following:
>
> 1) Have a class in jersey core called FeatureAndProperties;
>
> 2) The ClientConfig and ResourceConfig extend this class.
>
> 3) FeaturesAndProperties can be injected.
>
> Then message body readers/writers requiring access to config
> information are independent of client/server.
>
I like the general idea of injecting the configuration. You could then
optionally provide a separate class that reads a configuration file when
building the injected class.
Paul Sandoz wrote:
>
> I have made changes to the life-cycle management of Jersey to support
> @PostConstruct and @PreDestroy of resource classes (plan to do the
> same for providers). What we could support is a way for the mail
> support to register the multi-part instance it creates for clean up
> when the request/response is done. One way to do this is to support a
> @PerInstance life-cycle and the mail support asks Jersey to create an
> instance of the MultiPart which will get destroyed when the request
> goes out of scope. It should also work for Jersey clients working
> within the server environment.
>
I like this idea too, though I would suggest the following:
- Provide Jersey-specific integration on top of a generic core. Other
implementations (maybe not even JAX-RS related) would provide their own
integrations.
- Keep MultiPart.cleanup() -- though I would rename it to dispose() -- for
deployments without integrations. If you use an integrated solution it would
call dispose() at the end of the request automatically.
Paul Sandoz wrote:
>
> I would be inclined to build on JavaMail and take the fork-and-copy
> approach. It should be possible to extend JavaMail for multipart/form-
> data then the Jersey layers above that becomes easier to support.
>
Are you saying that Javamail doesn't currently support multipart/form-data?
Thanks,
Gili
--
View this message in context: http://n2.nabble.com/Hello-World%21-and-Welcome-to-jersey-multipart-tp1343189p1455180.html
Sent from the Jersey mailing list archive at Nabble.com.