How to use servlets and Jquerry+bootstrap?

I have button:

<button id="saveFeed" type="button" class="btn btn-primary">Save changes</button>

in form:

<div class="modal fade" id="myModal">
                                    <div class="modal-dialog">
                                        <div class="modal-content">

                                            <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"
                                                    <span aria-hidden="true">&times;</span>
                                                <h1 class="modal-title">Edit feed name:</h1>

                                            <div class="modal-body">
                                                <input type="hidden" readonly="readonly" name="id"
                                                    value="<c:out value="${}" />" />

                                                <p>Enter feed name:</p>

                                                <input id="feedName" type="text" name="name"
                                                    value="<c:out value="${}" />" />
                                                <!--                            <input id="feedName" type="text" name="feed name"> -->

                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-default"

                                                <button id="saveFeed" type="button" name="feedSub"
                                                    class="btn btn-primary">Save changes</button>

                                        <!-- /.modal-content -->
                                    <!-- /.modal-dialog -->
                                <!-- /.modal -->

script for jQuery:

    $('#myModal').on('', function() {

    $(document).ready(function() {

        $('#saveFeed').click(function() {
            var feedName = $('#feedName').val();
            var feedId = $('#id').val();
            $.post('FeedController', {
                feedName : feedName,
                feedId : feedId
            }).done(function(data) {




protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
    else if (req.getParameter("feedSub") != null) {
                String link = null;
                String name = req.getParameter("name");
                Integer id = Integer.parseInt(req.getParameter("id"));

                feed = new Feed(id, link, name);



I need to rename feed using jQuerry but i am completly new to it. How to redirect to servlets handler button after save changes button was pressed using jQuery script?

Source: jquery

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.