這是我的JSP頁面,我在這裏接受一些值,我想將值發送到Servlet,然後存儲在數據庫中。任何一個可以幫助,這是正確的做法或不...什麼應的servlet被添加到檢索存在的價值..從JSP頁面傳遞值到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>
請刪除無關標記。另外,你有沒有考慮過使用CSS類?或者至少一次設置所有樣式,而不是一個十億個跨度? – 2013-03-19 11:09:37