0

I have a method in controller class as

@RequestMapping(method=RequestMethod.GET, value="fetchdata",produces="application/json")

public @ResponseBody Map> fetchdata() {}

I want to create a simple jsp with button that on click calls this function

The code is :

<form action="https://localhost:8080/mainurl/fetchdata" method ="get">

It's not working.Can someone help what is wrong with the code?

Sunaina
  • 65
  • 2
  • 2
  • 13
  • Do you mean aside from the missing submit button and the missing form end tag? "Not working" is a very poor description of a problem. – Quentin Feb 24 '16 at 09:44
  • It's showing in preview,I don't know why isn't is displaying the entire code in the post. Anyways the input buttonnis there as. – Sunaina Feb 24 '16 at 09:49
  • Click Edit. Read the "How to format" information there. – Quentin Feb 24 '16 at 09:53
  • And my other question stands. You need to be more specific that "Not working". What happens? What do you expect to happen? How do they differ? Use the developer tools in your browser. Look at the Network tab. Do you see the request being made? Do you get the expected response? – Quentin Feb 24 '16 at 09:54
  • The button is not getting created. – Sunaina Feb 24 '16 at 10:02
  • Which brings us back to *Click Edit. Read the "How to format" information there.* since your question doesn't have the HTML for the button in it at present. – Quentin Feb 24 '16 at 10:06
  • After reading the comments spread about this question and answers on it, I've come to the conclusion that this is a [duplicate of this question](http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming). Java and JavaScript are different programming languages. Code running in the browser runs on a different computer to code running on the server. You can't "call a function" in your Java from the browser. – Quentin Feb 24 '16 at 10:17

0 Answers0