Hi,
Naresh, hero of the day, wrote:
> super();
> Map<String, String> contextParams = new HashMap<String, String>();
> contextParams.put("contextConfigLocation",
> "classpath:applicationContext-HSQLdb.xml");
> ApplicationDescriptor appDescriptor = new ApplicationDescriptor()
> .setContextPath(your-context-path)
>
> .setRootResourcePackageName(your-root-resource-package-name)
>
> .setServletClass(com.sun.jersey.spi.spring.container.servlet.SpringServlet.class)
>
>
> .setContextListenerClassName("org.springframework.web.context.ContextLoaderListener")
>
> .setContextParams(contextParams);
> super.setupTestEnvironment(appDescriptor);
Great!
That worked. I guess this should go into the docs?
Now I got another problem.
I use the Webresource to do a request like this:
SourceView sv = new SourceView();
.. set some sv attributes ..
SourceView sv2 = webResource.path("source").put(SourceView.class, sv);
and according to the logging, a request containing the correct XML is
generated and PUT to the server, but in my method I get a null instead
of the expected object.
Any tips to why?
The method signature looks like this:
@PUT
@Path("/")
@Consumes({
"application/xml",
"text/xml"})
public SourceView create(SourceView s) {
...
}
Kind regards,
Tarjei
--
Tarjei Huse
Mobil: 920 63 413