• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ajax call request to spring doesn't trigger

 
Ranch Hand
Posts: 285
2
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

  I'm trying to send a simple Ajax call to spring mvc and in return expecting an another view in the form ftl template. Below is my code trying to debug and error getting tried through F12 Developer Tools. Struck as unable to determine the issue. If someone who can see any fault in code please give me a clue. Thanks



"ajaxTest" is an another ftl (Freemarker template) file. Is it something wrong with ftl file and ajax call ? Please comment your ideas.





Error in IDE console:


Sep 17, 2017 12:12:46 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/Freemarker_SpringMVC_example/user/user/MyAjaxCall] in DispatcherServlet with name 'spring'

I'm unsure from where the extra user is added to /user/user/MyAjaxCall.  This trace comes on console when I click Save button on the form. Expecting this to be as [/Freemarker_SpringMVC_example/user/MyAjaxCall].
Spring config in in attachment but cant attach either txt nor xml file. Hence pasting here.



What is wrong in my code?

Thanks






 
Mohammed Sardar.
Ranch Hand
Posts: 285
2
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just changed Save button to be of type "Submit" and now getting

HTTP Status [405] – [Method Not Allowed].

Type Status Report

Message Request method 'POST' not supported

Description The method received in the request-line is known by the origin server but not supported by the target resource. Now, I think is free marker does support post ?
 
Mohammed Sardar.
Ranch Hand
Posts: 285
2
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone please help to edit this post or delete this post ? I need to add something extra but don't wanna confuse the above ? Shall I create a new thread or what can I add ?
 
Ranch Hand
Posts: 138
1
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Your "MyAjaxCall" method, which accepts 3 parameters, your 3rd parameter is not mapped with any annotation.
Either removed it or marked it with some annotation.

Thanks,
Atul
 
Mohammed Sardar.
Ranch Hand
Posts: 285
2
jQuery Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Atul More wrote:Hi,

Your "MyAjaxCall" method, which accepts 3 parameters, your 3rd parameter is not mapped with any annotation.
Either removed it or marked it with some annotation.

Thanks,
Atul




Thanks a lot for your great time and effort to respond my post and It helps me. May I know is it mandatory to map aall parameter to an Annotation. Order is mapped to  Client_Call from Ajax as a JSON String. May I ask, it should be something related to JSON format Annotation that we have to tell to Spring MVC ? Could you please show me a clue so that I can continue from there ?

Again Thanks Atul
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic