这是我的 JSP 页面,我在这里接受一些值,我想将这些值发送到 Servlet,然后存储在 DB 中。任何人都可以帮忙,这种方法是否正确......以及应该在servlet中添加什么来检索那里的值......
<html>
<head>
<link rel="stylesheet" href="MainCSS.css" type="text/css">
<title></title>
</head>
<body background-color:blue>
<form action="HelloServlet_new.java" method="POST">
<div style="width:600px; margin:0 auto;">
<span style="color:#ffffff;"><span style="font-size: 18px;"><span style="font-family: 'times new roman', times, serif;"><strong><span style="background-color: rgb(0, 0, 255);"><a href="http://My/index_new"></a> cISBN | cAttendance | cFleet | cHome |</span></strong></span></span></span></div>
<div>
<span style="font-size: 18px;"><span style="font-family: 'times new roman', times, serif;"><strong> </strong></span></span></div>
<div style="width:600px; margin:0 auto;">
Enter Your Message Here: <input type="text" name="message" value="" /><br>
Enter the Receiver Number: <input type="text" name="receiver" value="" />
Enter Your Name: <input type="text" name="name" value="" /><br><br>
Enter Your Number: <input type="text" name="sender" value="" /><br><br>
Enter Your Mail_id: <input type="text" name="mailid" value="" />
<input type="submit" name="submit" value="Send" /><br>
</div>
<% request.setAttribute("message",request.getParameter("message"));%>
<% request.setAttribute("receiver",request.getParameter("receiver"));%>
<% request.setAttribute("name",request.getParameter("name"));%>
<%request.setAttribute("sender",request.getParameter("sender"));%>
<% request.setAttribute("mailid",request.getParameter("mailid"));%>
<h2>Thank You for using Our Service !!!!!!! </h2>
<jsp:include page="HelloServlet_new" flush="true" />
</body>
</form>
</html>