import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;public class UserInfoServlet extends HttpServlet {protected void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {String name = request.getParameter("name");String introduction = request.getParameter("introduction");response.setContentType("text/html;charset=UTF-8");response.getWriter().println("用户信息更新成功");}}<!DOCTYPE HTML><html lang="ch"><head><meta charset="utf-8"><link rel="stylesheet" href="css/userinfo.css" /><link rel="stylesheet" href="css/auto.css" /><script src="js/jquery-3.7.0.js"></script><title>userinfo</title><noscript><title>不支持JavaScript,无法显示内容。</title></noscript></head><body onload="bodyload()"><div id="transparency"><div id="msgs"><div id="headermsg"><div><img style="float:left" id="foreshow" src="${"image/"+imageId.toString()+".bmp"}" alt="头像" /><p style="font-size:30px">${userinfo.name}</p><p style="font-size:15px">粉丝数:${userinfo.fansNum}</p></div><p style="font-size:20px">${userinfo.introduction}</p></div></div><br /><hr style="width:80%" /><p style="font-size:50px;margin-left:10%;">修改个人信息</p><div id="showmsg"><p>手机号:${userinfo.phone}</p><div><label><br /><input id="name" type="text" placeholder="此处输入你要更改的昵称" /></label><br /><br /><div><span style="vertical-align:top">头像:</span><img onclick="nextimg()" id="image" src="${"image/"+imageid+".bmp"}" alt="头像" /><br /></div><br /><label><input id="introduction" type="text" placeholder="此处输入你要更改的简介"onchange="count()" value="" /></label><p id="echotext">已输入0/50字</p><br /><br /><label><input id="submit" type="button" value="提交"onclick="submit()" /></label></div></div><div id="white"></div></div><script src="js/userinfo.js"></script><div hidden="hidden" id="maxarea" value="${maxImageNumber}"></div></body></html>


原文地址: https://www.cveoy.top/t/topic/pKCF 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录