jsp源代码 <html> <body> <form action="${pageContext.request.contextPath}/add" method="post"> 客户名称:<input type="text" name="cust_name"/><br/> 客户来源:<input type="text" name="cust_source"/><br> 客户级别:<input type="text" name="cust_level"><br> 客户行业:<input type="text" name="cust_industry"><br> 客户电话:<input type="text" name="cust_phone"><br> 客户手机;<input type="text" name="cust_mobile"><br> <input type="submit" value="保存"><br> </form> </body> </html>
浏览器显示效果
解决方案:在jsp中直接添加这一行代码即可:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
jsp中添加这行代码:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <html> <body> <form action="${pageContext.request.contextPath}/add" method="post"> 客户名称:<input type="text" name="cust_name"/><br/> 客户来源:<input type="text" name="cust_source"/><br> 客户级别:<input type="text" name="cust_level"><br> 客户行业:<input type="text" name="cust_industry"><br> 客户电话:<input type="text" name="cust_phone"><br> 客户手机;<input type="text" name="cust_mobile"><br> <input type="submit" value="保存"><br> </form> </body> </html>
浏览器端: