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 8473771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:26:39+00:00 2026-06-10T17:26:39+00:00

I am ASP.NET Developer, New To JSP. How can i perform Button Click event

  • 0

I am ASP.NET Developer, New To JSP. How can i perform Button Click event in JSP ?

I Want to Execute the Code in Server Side not in Javascript. I Know That I can achieve it By Servelets. I Have Some Questions Regarding This.

1.) I Have 30 Pages in My JSP Project. Do I Have to Create 30 Servelets ?

2.) Is There Any Page Load Event In JSP Similar to ASP.NET ?

Thanks in Advance

  • 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-10T17:26:40+00:00Added an answer on June 10, 2026 at 5:26 pm

    I Have 30 Pages in My JSP Project. Do I Have to Create 30 Servelets ?

    Not necessarily. May be a single servlet perform one or more task(s).

    Is There Any Page Load Event In JSP Similar to ASP.NET ?

    Yes, it is void jspInit() { ... } but use of Java code in JSPs is is highly discouraged.


    You can determine which submit button is pressed in Servlet’s doPost/Get method by reading request parameter.

    TestServlet.java

    @WebServlet(name = "test", urlPatterns = {"/test"})
    public class TestServlet extends HttpServlet {
    
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException {
            String button=request.getParameter("cmd");
            if(button.equals("Add")){
               //
            }
            ...
        }
    }
    

    test.jsp

                                |----- servlet url /test 
                                V
    <form method="post" action="test">
      <input type="submit" name="cmd" value="Add"/>
      <input type="submit" name="cmd" value="Update"/>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a asp.net developer , but new to wordpress . I want opinion
I am a new ASP.NET developer and I am developing a web-based suggestions box
I created a new ASP.NET website using Visual Web Developer 2008 Express edition and
I'm developer moving from C# to Java. Heard about new ASP net feature. <%:
I am a brand new Java developer (I have been working in asp.net) and
I recently installed the ASP.NET MVC 4 Developer Preview (which Microsoft says can be
I am a new ASP.NET developer and now I am having an issue in
I am a new ASP.NET developer with a good knowledge in Database Design. I
I'm a C# ASP.net MVC Developer. I got a new job and have to
I am a new ASP.NET developer and I am developing a traning management system

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.