Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8684703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:22:20+00:00 2026-06-12T22:22:20+00:00

In ASP.net MVC using the following snippet we can send the change password data

  • 0

In ASP.net MVC using the following snippet we can send the change password data to a controller. In the controller we can cast the posted data as ChangepasswordReq object and we can do our business. Now I am looking for the equivalent of this in jsp. How to communicate from the client side to the server side? I want to transfer a bigger form with number of controls.(I am using only html to build my pages). Any Help would be appreciable.

 var ChangeReq = { CurrentPassword: epwd, NewPassword: newpwd }
 var jsondata = JSON.stringify(ChangeReq)

            $.ajax({
                type: 'POST',
                url: "/Account/ChangePassword",
                cache: false,
                timeout: 10000,
                contentType: "application/json; charset=utf-8",
                success: function (_results) {
                    //do something

                },
                error: function (_results) {
                   //do something
                }
            });


  [HttpPost]
  public ActionResult ChangePassword(ChangepasswordReq _ChangepasswordReq)
  {
     //do the business
  }

  public class ChangepasswordReq
    {
        public String CurrentPassword { get; set; }
        public String NewPassword { get; set; }
    }

I have tried the following. But in my case I am generating some controls dynamically. I cannot get them properly in the controller as the number of dynamic controls vary. Is there any better way in jsp for the url routing as in asp.net MVC.(better than @RequestMapping(value = “/ChangePassword”, method = RequestMethod.POST))
How to use jquery properly in jsp.(Please help me in client side and server side code)

@RequestMapping(value = "/ChangePassword", method = RequestMethod.POST)
    public String home(@RequestParam("Currentpasswordtxtboxname") String Currentpassword,@RequestParam("NewPasswordtextboxname") String Newpassword, Locale locale, Model model) {
// do business
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:22:21+00:00Added an answer on June 12, 2026 at 10:22 pm

    I found something Here.

    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script>
    $(document).ready(function() {
        function Savedata() {  
        Var data={Username:$("#txtUsername").[0].value, CurrentPassword:  $("#txtCurrentpwd").[0].value, NewPassword: $("#txtNewpwd").[0].value }
    
       jsondata=Json.stringify(data);
       $.get('ActionServlet',jsondata,function(responseJson) {   
            //do something with response json
            });
        });
    });         
     //Can use Jquery post also as in question
    </script>
    

    In the server side we can get the parameters as

     protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException 
     {
      String Username =request.getParameter("Username");
      String CurrentPwd =request.getParameter("CurrentPassword");
      String Newpwd =request.getParameter("NewPassword");
     }
    

    In the web.xml file

    <servlet>
      <servlet-name>ActionServlet</servlet-name>
      <servlet-class>MyProject.ActionServlet</servlet-class>
    </servlet>
    <servlet-mapping>
      <servlet-name>ActionServlet</servlet-name>
      <url-pattern>/ActionServlet/*</url-pattern>
    </servlet-mapping>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to request data from an ASP.net MVC application. I'm
In my web app (ASP.NET MVC), I send an email using the following: MailMessage
Following this tutorial (http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application), I learned how to save data and do concurrency checks
I'm working in ASP.NET MVC 1.0 using MvcContrib FluentHtml version 1.0. The following code
I'd like to achieve the following effect using ASP.NET MVC and JQuery. I've got
I'm trying to output the following html using an html helper in asp.net mvc
I'm using Fancybox 1.3.4 with ASP.NET MVC 3. I have following link : <a
I have the following view definition in my asp.net mvc website: <% Using Ajax.BeginForm(UsrCtlChangePassword,
In ASP.Net MVC 2 I am using the following compression filter and, in Chrome
I'm using the following route to handle localization on my ASP.NET MVC Application routes.MapRoute(Globalization,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.