tag:blogger.com,1999:blog-1687770137650619833.comments2023-03-29T04:57:25.153-07:00sôft'wâr'Unknownnoreply@blogger.comBlogger32125tag:blogger.com,1999:blog-1687770137650619833.post-55329488128506401032018-02-05T01:11:03.591-08:002018-02-05T01:11:03.591-08:00but how to return in list?? bothbut how to return in list?? bothJ Manas Kumarnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-20801520016760680112015-11-02T08:15:14.568-08:002015-11-02T08:15:14.568-08:00This comment has been removed by a blog administrator.Programming Spherehttp://programmingsphere.comnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-38783839681741423372015-01-28T15:26:11.029-08:002015-01-28T15:26:11.029-08:00Hi,
I also received an error along the lines of “E...Hi,<br />I also received an error along the lines of “Error 406 NOT_ACCEPTABLE”.<br />Now I didn’t load the project from GIT as I wanted to understand what was happening with the code I was manually adding. The key step I forgot was to add Jackson-mapper to the classpath (i.e. add it to the pom.xml)<br />Once done, the error was resolved.<br />Thanks Daniel for the tutorial.<br />Anonymoushttps://www.blogger.com/profile/04436436987678377346noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-62801724417881892512013-09-11T09:00:15.152-07:002013-09-11T09:00:15.152-07:00Can i convert to a XML response if i am sending ba...Can i convert to a XML response if i am sending back a java.util.Map ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-73447882932246440722013-08-28T02:27:08.824-07:002013-08-28T02:27:08.824-07:00I tried in your way, but it is not working for me....I tried in your way, but it is not working for me....I always getting xml in response.<br />I have annotated my controllers methods with @ResponseBody<br />and my spring configuration only contain the two lines you hv given.<br />I am sending request headers. But still am not able to requet JSON data. It always returns xml.<br />Please do help.Stucked since long time on this.Anonymoushttps://www.blogger.com/profile/03726996841113711151noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-69889175540689140202013-06-02T07:56:06.835-07:002013-06-02T07:56:06.835-07:00Hi, Thanks for your awesome post.
Could you share ...Hi, Thanks for your awesome post.<br />Could you share how to make the default response JSON only through the Spring configuration, since it is XML now.Anonymoushttps://www.blogger.com/profile/16921917112297926048noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-72186740890764625282013-05-20T17:32:03.422-07:002013-05-20T17:32:03.422-07:00I think that Scala + Spring (+ REST) is a real swe...I think that Scala + Spring (+ REST) is a real sweet spot - thanks for the tutorial.<br /><br />I am having some problems getting the scala-jackson-module configured properly - I get the following stack trace. <br /><br />Am I doing anything obviously wrong? I am using Spring 3.2, Scala 2.10.1<br /><br />java.lang.IllegalStateException: Failed to load ApplicationContext<br /> at <br />Caused by: java.lang.NoSuchMethodError: scala.Predef$.augmentString(Ljava/lang/String;)Lscala/collection/immutable/StringOps;<br /> at com.fasterxml.jackson.module.scala.JacksonModule$.(JacksonModule.scala:11)<br /> at com.fasterxml.jackson.module.scala.JacksonModule$.(JacksonModule.scala)<br /> at com.fasterxml.jackson.module.scala.JacksonModule$class.version(JacksonModule.scala:38)<br /> at com.fasterxml.jackson.module.scala.DefaultScalaModule.version(DefaultScalaModule.scala:15)<br /> at org.codehaus.jackson.map.ObjectMapper.registerModule(ObjectMapper.java:446)<br /> at au.com.intellibill.WebAppConfig.createJsonMessageConverterWithScalaSupport(WebAppConfig.java:48)<br /> at au.com.intellibill.WebAppConfig.configureMessageConverters(WebAppConfig.java:30)<br /> at org.springframework.web.servlet.config.annotation.WebMvcConfigurerComposite.configureMessageConverters(WebMvcConfigurerComposite.java:66)<br /> at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration.configureMessageConverters(DelegatingWebMvcConfiguration.java:95)<br /> at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.getMessageConverters(WebMvcConfigurationSupport.java:499)<br /> at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerAdapter(WebMvcConfigurationSupport.java:362)<br /> at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$5d5c02bc.CGLIB$requestMappingHandlerAdapter$23()<br /> at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$5d5c02bc$$FastClassByCGLIB$$5f5f5b95.invoke()<br /> at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)<br /> at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:286)<br /> at org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration$$EnhancerByCGLIB$$5d5c02bc.requestMappingHandlerAdapter()<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160)<br /> ... 54 more<br /><br />Anonymoushttps://www.blogger.com/profile/16366927327048554092noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-14432639499420148812013-03-18T07:16:54.151-07:002013-03-18T07:16:54.151-07:00Thanks for the nice posting. It really helped us a...Thanks for the nice posting. It really helped us a lot today.jayachandhttps://www.blogger.com/profile/06776140536614415191noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-84841396655709903822013-03-04T09:00:13.666-08:002013-03-04T09:00:13.666-08:00so is it better than hibernate?? any advantages ov...so is it better than hibernate?? any advantages over it??Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-49100073082992696822013-02-18T14:34:27.473-08:002013-02-18T14:34:27.473-08:00Big thanks. Excellent starting point for what I ne...Big thanks. Excellent starting point for what I need.Mon nom est Paulhttps://www.blogger.com/profile/06879592434036380545noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-15772720404731093812013-02-11T06:22:14.709-08:002013-02-11T06:22:14.709-08:00Hi Akshay!
You can look at the application.xml in...Hi Akshay!<br /><br />You can look at the application.xml in the example code to see how to get more control over the message converters. You can also check out my other post about message converters in Spring: http://software.sawano.se/2012/03/controlling-message-converters-with.html<br /><br />Cheers!Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-45347391160331700172013-02-11T06:18:00.339-08:002013-02-11T06:18:00.339-08:00Hi!
Both
curl http://localhost:9090/spring-exampl...Hi!<br /><br />Both<br />curl http://localhost:9090/spring-examples-json-xml-ws/users/123 -HAccept:application/json<br />and<br />curl http://localhost:9090/spring-examples-json-xml-ws/users/123 -HAccept:application/xml<br />works using the code in the example.<br />You should double check your code against the example and see if you can find any differences that might give you a clue about what is causing the problem.Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-12747891256662548172013-02-10T00:55:24.079-08:002013-02-10T00:55:24.079-08:00hi,
it would be great if u explain why by default ...hi,<br />it would be great if u explain why by default MappingJacksonHttpMessageConverter if present in the classpaath is used even though the accept header is application/xml. <br />how can we use custom converters?<br /><br />thnaks,<br />AkshayAkshayhttps://www.blogger.com/profile/15865076145277149477noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-28224776251138950372012-09-26T07:51:58.570-07:002012-09-26T07:51:58.570-07:00Thank you for your post, much appreciated. Will h...Thank you for your post, much appreciated. Will help kick off a new project cleanly.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-19632756383897723072012-09-07T06:31:32.227-07:002012-09-07T06:31:32.227-07:00Spring Data with JPA2 or MongoDB rocks! It so easy...Spring Data with JPA2 or MongoDB rocks! It so easy this days to create CRUD back-ends with Java. Also Spring Data with Spring MVC will give you an excellent stack for Web applications.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-49791588011429447652012-09-07T06:01:22.091-07:002012-09-07T06:01:22.091-07:00Nice example, thanksNice example, thanksAnonymoushttps://www.blogger.com/profile/08670129669313146252noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-3707707480489590602012-07-24T00:57:11.161-07:002012-07-24T00:57:11.161-07:00First class tutorial! Thank youFirst class tutorial! Thank youAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-57859815992589492392012-07-13T07:23:41.153-07:002012-07-13T07:23:41.153-07:00Hi Hoser,
yes the configuration does gets a lot cl...Hi Hoser,<br />yes the configuration does gets a lot cleaner.Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-1967154562427317432012-07-13T07:19:45.351-07:002012-07-13T07:19:45.351-07:00You would typically have to put it in an object co...You would typically have to put it in an object containing the list of users. Like a transfer object.Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-76669218701419020592012-07-10T16:27:34.800-07:002012-07-10T16:27:34.800-07:00Awesome, it felt good to rip out all that extra co...Awesome, it felt good to rip out all that extra config that was not needed.Hoserhttps://www.blogger.com/profile/04836337399700852628noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-65100766712980379952012-07-06T09:37:23.119-07:002012-07-06T09:37:23.119-07:00What if you need a list of users, how would you do...What if you need a list of users, how would you do it?<br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-29467384025076216522012-07-05T11:32:24.013-07:002012-07-05T11:32:24.013-07:00Hi Nikos,
thank you! Glad you liked it.
I don'...Hi Nikos,<br /><br />thank you! Glad you liked it.<br />I don't put up my email here because of spam but you can DM me on Twitter if you want.Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-41227210330844987032012-07-03T12:48:36.444-07:002012-07-03T12:48:36.444-07:00Hi Daniel,
Nice blog! Is there an email address I...Hi Daniel,<br /><br />Nice blog! Is there an email address I can contact you in private?Nikos Maravitsashttps://www.blogger.com/profile/15031926888218632378noreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-22927391994986663072012-06-21T08:04:31.885-07:002012-06-21T08:04:31.885-07:00Thank you very much, Daniel. This post helped me g...Thank you very much, Daniel. This post helped me greatlyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1687770137650619833.post-25295352027171127622012-06-13T12:57:51.450-07:002012-06-13T12:57:51.450-07:00Hi,
remember that you need to remove the previous ...Hi,<br />remember that you need to remove the previous line in the example. Otherwise it will interfere.<br />Also, it is all based on the accept header so if you are testing with a browser you need to be able to control the headers being sent.Daniel Sawanohttps://www.blogger.com/profile/11229197808824398329noreply@blogger.com