This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Call the spring 3 controller's method from javascript code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Call the spring 3 controller Watch "Call the spring 3 controller New topic

Call the spring 3 controller's method from javascript code

peeush agarwal

Joined: Nov 10, 2011
Posts: 2

Hi all!
Actually I m new to Javascript, AJAX, JQuery . So i just want to know that if I have a jsp page with some students list and they have option(link) for delete or edit.
I want that if user clicks edit, then my javascript code should requests controller method to populate the corresonding student's data and response it to javascript code from where the JS script will open a new window to show the corresponding student's data and ables the user to edit the information and the submit it to be changed.
Please reply to it ASAP.

Thanks in advance!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60766

To open a new window from a link, use the target="_blank" attribute on the link.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
You can use ajax method to call the spring controller and get your data back in that ajax method itself.
I agree. Here's the link:
subject: Call the spring 3 controller's method from javascript code
Similar Threads
Using Swing to Create Data Entry Forms
how to edit <h:SelectOneMenu>
how to store value from servlet to java script variable
Help with an array situation