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

  • Home
  • SEARCH
  • 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 3278336
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:28:12+00:00 2026-05-17T19:28:12+00:00

I am currently a asp.net guy, but have to do some jsp work now.

  • 0

I am currently a asp.net guy, but have to do some jsp work now. I know that in asp.net, you can define a public static method with [WebMethod] attribute e.g.

  [WebMethod]
  public static string GetIt(string code)
  {
    return GetSomething(code);
  }

then, I can call this method in jquery

$.ajax({
  type: "POST",
  url: "PageName.aspx/GetIt",
  data: "{'code':'+$("#code").val()+"'}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(msg) {
    // Do something interesting here.
  }
});

can someone give me some light how to do it using jsp?

  • 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-05-17T19:28:12+00:00Added an answer on May 17, 2026 at 7:28 pm

    With pure jsp and servlets you’ll have to do a lot of things to achieve that.

    It can easily be done with spring-mvc, almost in the same way you showed:

    • create a class and annotate it with @Controller
    • create the method to be like this:

      @RequestMapping("/path/get")
      @ResponseBody
      public String getIt() {
          ...
      }
      
    • you’ll need <mvc:annotation-driven /> and jackson on your classpath.

    Note that you are calling “get”, so the logical http method is GET, rather than POST

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an asp.net page, that takes in the data from this view
I currently have an ASP.NET script for a TV guide which displays the data
I am currently working on an ASP.net c# project. I have an aspx page
I am currently working on a ModalPopupExtender in ASP.net with C#. I have the
Currently I'm working on Web project that is built using ASP.NET Web Forms. We
I am currently using asp.net membership database on multiple apps. I am not looking
I am currently working on asp.net using C# and I need to show a
I am currently programming a ASP.NET MVC3 application, using Entity Framework 4. There are
I am currently working on an ASP.net C# web app. I am using the
I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First

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.