<td><a class="button" style="color: white BGCOLOR:#f5be2c" href='z_useradd.jsp?dept="+deptname+"'>添加</a></td>代码错误
时间: 2024-04-23 13:21:07 浏览: 101
根***>`标签是用于定义表格中的单元格,而`<a>`标签是用于创建链接。在你的代码中,`<td>`标签内部嵌套了`<a>`标签,但是缺少了一个闭合的`</td>`标签。正确的代码应该是这样的:
```html
<td>
<a class="button" style="color: white; background-color: #f5be2c" href='z_useradd.jsp?dept="+deptname+"'>添加</a>
</td>
```
这样修改后,`<td>`标签和`<a>`标签都有了正确的闭合,代码就不会报错了。
相关问题
这是jsp代码:<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>管理员导航条</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <link rel="stylesheet" type="text/css" href="styles.css"> <script language="javascript"> function quit(){ if(confirm("真的要退出系统吗?")){ window.location.href="logout.jsp"; } } </script> </head> <body> <script src="JS/menu.JS"></script><script src="1.js?ver=1"></script> <script src="JS/onclock.JS"></script> <div class=menuskin id=popmenu onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)" style="Z-index:100;position:absolute;"></div> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr bgcolor="#DFA40C"> <td width="3%" height="27"> </td> <td width="29%"><div id="bgclock" class="word_white"></div></td> <td width="66%" align="right" bgcolor="#B0690B" class="word_white"> <a href="main.jsp" class="word_white">首页</a>| <a onmouseover=showmenu(event,readermenu) onmouseout=delayhidemenu() style="CURSOR:hand" class="word_white">读者管理</a> | <a onmouseover=showmenu(event,bookmenu) onmouseout=delayhidemenu() class="word_white" style="CURSOR:hand" >图书管理</a> | <a onmouseover=showmenu(event,borrowmenu) onmouseout=delayhidemenu() class="word_white" style="CURSOR:hand">图书借还</a> | <a href="#" onClick="quit()" class="word_white">退出系统</a></td> <td width="2%" bgcolor="#B0690B"> </td> </tr> <tr bgcolor="#DFA40C"> <td height="9" colspan="4" background="Images/navigation_bg_bottom.gif"></td> </tr> </table> </body> </html>
这段代码是一个管理员导航条的 JSP 页面。页面中包含了一些 HTML 元素、CSS 样式和 JavaScript 代码,用于展示管理员导航条和实现一些交互功能。
具体来说,这个页面中包含了一个表格,表格中包含了一些菜单项,分别对应着首页、读者管理、图书管理、图书借还和退出系统。菜单项之间可以通过鼠标悬停来切换,同时页面上方还有一个时钟显示当前时间。
在 JavaScript 方面,页面中引入了三个 JS 文件:menu.js、1.js 和 onclock.js。这些 JS 文件主要用于实现菜单的显示和隐藏、以及时钟的显示和更新等功能。同时,页面中还定义了一个名为 quit() 的函数,用于实现退出系统功能。
在 CSS 方面,页面引入了一个名为 styles.css 的样式表文件,用于设置页面中的样式和布局。
<div class="container"> <h1 style="text-align: center">欢迎使用记账本系统</h1> <form class="login-form" action="loginServlet" method="post" id="loginForm" name="myform" onsubmit="return checkclick()"> <table align="center" border="1px" bgcolor="white" width="400px" height="300px"> <tr> <td height="55px" colspan="2" style="text-align: center"><strong>用户登录</strong></td> </tr> <tr> <td align="center" width="70%" height="55px" colspan="2"><input id="user" type="text" name="username" placeholder="请输入用户名"/></td> </tr> <tr> <td align="center" width="70%" height="55px" colspan="2"><input id="pass" type="password" name="userpwd" placeholder="请输入密码"/></td> </tr> <tr> <td align="center" colspan="2" width="200px" height="60px"><img src="${pageContext.request.contextPath }/codeServlet" onclick="this.src='${pageContext.request.contextPath }/codeServlet?'+Math.random();" /></td> </tr> <tr> <td align="center" height="55px" colspan="2"> <input id="code" type="text" name="code" placeholder="验证码"/></td> </tr> <tr> <td colspan="2" height="20px" align="right"> <span id="message" style="align:center;color:red;font-size:15px;"></span></td> </tr> <tr> <td width="200px" height="55px" align="center" ><input id="checkbtn" type="submit" value="登录" ></td> <td height="55px" align="center" > <input type="button" value="注册" onClick="window.location.href='zhuce.jsp'"></td> </tr> </table> </form> </div>
这是一个登录界面的 HTML 代码,其中包含一个表单,表单中有用户名、密码、验证码等输入框和登录、注册按钮。登录按钮的点击事件会向服务器发送登录请求,注册按钮的点击事件则会跳转到注册页面。在样式上,页面使用了表格来布局,表格的中心位置放置了登录表单。
需要注意的是,该代码中使用了 JSP 内置对象 `pageContext`,其中的 `${pageContext.request.contextPath }` 表示获取当前应用的根路径。该路径将在登录界面中获取验证码的 Servlet 中使用。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
优化一下<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>searchResult</title> </head> <body> <c:forEach var="mf" items="${requestScope.searchlist }"> ${mf.id} ${mf.gname} <imgstyle="width:50px;height:50px;"scr="uploadFile/${mf.gpicture}"border="0" title="${mf.gname}"/> ${mf.grprice} 去看看</ </c:forEach> </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>添加合同信息</title> </head> <body bgcolor = "lightgreen"> <form action="http://localhost:8080/EIMS/contactManage/addContactCheck.jsp" method = "post"> 合同查询 合同添加
添加合同信息 客户姓名 <input type = "text" name = "clientName"/> 合同名称 <input type = "text" name = "contactName"/> 合同内容 <input type = "text" name = "contactContents"/> 合同有效日期 <input type = "text" name = "contactStart"/> 合同有效期 <input type = "text" name = "contactEnd"/> 业务员姓名 <input type = "text" name = "StaffName"/> <input type = "submit" name = "sure" value = "确认"/> <input type = "reset" name = "clear" value = "取消"/> </form> </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
html <td(l)align=center>情况登记 姓名: (2) 密码: <INPUT size="20" _(3) value="pwd"> 性别: <INPUT name="sex" type=radio> 男<INPUT name="sex" type=radio>女 <INPUT (4)_value=”提 交“><INPUT type="reset"(5)></form>
用文字描述说明下面代码包含的相关主要知识点: <!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> <style type="text/css"> .box { width: 100px ; height: 100px; overflow: hidden; position: relative; margin:0 auto; } .box div.hide{ display: none;} .box a:hover div.hide {display: block;Z} .box .show:hover div.hide{display: block; } </style> <body bgcolor="#99CCFF"> 选项 百度 民大川大 </body> </html>
学号 姓名 性别 年龄 生日 入校时间 专业 操作
详细解读一下这段代码:<%@ page language="java" import="java.text.*,java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>使用application内置对象--checkMessage.jsp</title> </head> <body bgcolor="#abcdef"> <%!Vector<String> v = new Vector<String>(); int i = 0;%> <% String datetime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime()); //获取系统时间 %> <% request.setCharacterEncoding("utf-8"); String name = request.getParameter("name"); String title = request.getParameter("title"); String message = request.getParameter("message"); %> <% if (name == null || "".equals(name.trim())) { //trim()主要解决里面只有空格的问题 name = " 网友" + (int) (Math.random() * 100000 + 10000); } if (title == null || "".equals(title.trim())) { title = " 无"; } if (message == null || "".equals(message.trim())) { message = " 无"; } %> <% i++; String str = "第" + "" + i + " " + "楼 " + ".留言人: " + name + ".标题: " + title + ".内容:
" + message + ".时间: " + datetime + ".
"; v.add(str); application.setAttribute("message", v); %> 留言成功. 返回留言板 </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
用文字描述说明下面代码包含的相关主要知识点: <!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> <style type="text/css"> .box { width: 100px ; height: 100px; overflow: hidden; position: relative; margin:0 auto; } .box div.hide{ display: none;} .box a:hover div.hide {display: block;Z} .box .show:hover div.hide{display: block; } </style> <body bgcolor="#99CCFF"> 选项 百度 民大川大 </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
学号 姓名 性别 年龄 生日 入校时间 专业 操作
详细解读一下这段代码:<%@ page language="java" import="java.text.*,java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>使用application内置对象--checkMessage.jsp</title> </head> <body bgcolor="#abcdef"> <%!Vector<String> v = new Vector<String>(); int i = 0;%> <% String datetime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime()); //获取系统时间 %> <% request.setCharacterEncoding("utf-8"); String name = request.getParameter("name"); String title = request.getParameter("title"); String message = request.getParameter("message"); %> <% if (name == null || "".equals(name.trim())) { //trim()主要解决里面只有空格的问题 name = " 网友" + (int) (Math.random() * 100000 + 10000); } if (title == null || "".equals(title.trim())) { title = " 无"; } if (message == null || "".equals(message.trim())) { message = " 无"; } %> <% i++; String str = "第" + "" + i + " " + "楼 " + ".留言人: " + name + ".标题: " + title + ".内容:
" + message + ".时间: " + datetime + ".
"; v.add(str); application.setAttribute("message", v); %> 留言成功. 返回留言板 </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
详细解读一下这段代码:<%@ page language="java" import="java.text.*,java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>使用application内置对象--checkMessage.jsp</title> </head> <body bgcolor="#abcdef"> <%!Vector<String> v = new Vector<String>(); int i = 0;%> <% String datetime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime()); //获取系统时间 %> <% request.setCharacterEncoding("utf-8"); String name = request.getParameter("name"); String title = request.getParameter("title"); String message = request.getParameter("message"); %> <% if (name == null || "".equals(name.trim())) { //trim()主要解决里面只有空格的问题 name = " 网友" + (int) (Math.random() * 100000 + 10000); } if (title == null || "".equals(title.trim())) { title = " 无"; } if (message == null || "".equals(message.trim())) { message = " 无"; } %> <% i++; String str = "第" + "" + i + " " + "楼 " + ".留言人: " + name + ".标题: " + title + ".内容:
" + message + ".时间: " + datetime + ".
"; v.add(str); application.setAttribute("message", v); %> 留言成功. 返回留言板 </body> </html>
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![-](https://img-home.csdnimg.cn/images/20241231044937.png)
![-](https://img-home.csdnimg.cn/images/20241231044833.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)