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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:33:23+00:00 2026-06-06T16:33:23+00:00

How can I call a servlet from jsp ? But in this case, I

  • 0

How can I call a servlet from jsp? But in this case, I prefer to use doPost() method than doGet().

this is my code:

view.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" import="DSIP.*" import="java.util.ArrayList" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>DSIP.View</title>
</head>

<body>
<jsp:useBean id="ipList" scope="application" class="DSIP.IPBeanMapper"/>
<jsp:useBean id="bean" scope="application" class="DSIP.IPBean"/>
<form name="form1" method="post" action="viewS">
    <table width="" border="">
        <tr bgcolor="#0099FF">
            <td width="90"><div align="center">ip</div></td>
            <td width="90"><div align="center">username</div></td>
            <td width="90"><div align="center">password</div></td>
            <td width="90"><div align="center">maxRetry</div></td>
            <td width="90"><div align="center">action</div></td>
        </tr>
        <%
            ArrayList<IPBean> list;
            list = ipList.getIPList();
            for (int i = 0; i < list.size(); i++){
                bean = list.get(i);
        %>
        <tr>
            <td><input name="ip"        type="text" size="15" value="<%=list.get(i).getIp()%>"></td>
            <td><input name="userName"  type="text" size="15" value="<%=bean.getUserName()%>"></td>
            <td><input name="password"  type="text" size="15" value="<%=bean.getPassword()%>"></td>
            <td><input name="maxRetry"  type="text" size="15" value="<%=bean.getMaxRetry()%>"></td>
            <td><a href="/ViewS?action=edit">edit</a> <a href="/ViewS?action=delete">delete</a>

            </td>
        </tr>
        <%
            }
        %>
    </table>
    <input type="submit" name="Submit" value="Submit">

</form>
</body>
</html>

I intend to call a servlet class (called ViewS) from this page using link (edit n delete). I want to make some filed in a specific row being editable when I click edit and store the values into a database.

and, I want to delete the record in database also record view in jsp when I cleck delete.

So please, somebody help me.

I’ve tried to use <a href="/ViewS?action=edit">edit</a>, but I know this call doGet().

Thank you very much for helping me.

  • 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-06T16:33:26+00:00Added an answer on June 6, 2026 at 4:33 pm

    You need to call a javascript function on click of link and from javascript you need to submit the form that will generate a HTTP POST

    function submitMyForm(){
     document.forms["yourFormId"].submit();
    }
    

    Or you could make a AJAX call to your servlet

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

Sidebar

Related Questions

When you get a doGet or doPost call in a servlet you can use
Can we call init() method from service() method in servlet ? I got this
From this code I can call bmwCars.CopyToDataTable() as I expected. var bmwCars = from
(Yes I know I can call Java code from Scala; but that is pointless;
Can I call a servlet from JSP file without using a HTML form? For
How to create a generic method which can call overloaded methods? I tried but
How can I call a servlet from the form's action without using the web.xml
I use tomcat server, and try to call a java class from servlet, that
Inside doGet()/doPost() in a servlet I have: RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(/WEB-INF/pages/view.jsp); dispatcher.forward(request, response); As
As title says, how do I call a java class method from a jsp,

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.