Javascript 在JSP的弹出窗口中显示数据
我是一个网络应用的新手。我有一个列表,它显示在我的Javascript 在JSP的弹出窗口中显示数据,javascript,java,html,jsp,servlets,Javascript,Java,Html,Jsp,Servlets,我是一个网络应用的新手。我有一个列表,它显示在我的JSP中,这是我使用servlet完成的。当它显示在同一浏览器页面上时,它可以正常工作。现在我想在弹出窗口中显示相同的内容?。我该怎么做呢。我尝试过使用窗口。打开,但没有帮助。它抛出一个404错误。请查找下面的代码。非常感谢 index.html <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Insert
JSP
中,这是我使用servlet完成的。当它显示在同一浏览器页面上时,它可以正常工作。现在我想在弹出窗口中显示相同的内容?。我该怎么做呢。我尝试过使用窗口。打开,但没有帮助。它抛出一个404
错误。请查找下面的代码。非常感谢
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="servlet/Controller">
Enter your Id:<input type="text" name="City"/><br/>
<a href="javascript:child_open()">Click me</a>
<script type="text/javascript">
var popupWindow=null;
function child_open()
{
popupWindow =window.open('display.jsp',"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=600, height=280,top=200,left=200");
}
</script>
<input type="submit" value="search" onclick="child_open()"/>
</form>
</body>
</html>
在此处插入标题
输入您的Id:
var popupWindow=null;
函数child_open()
{
popupWindow=window.open('display.jsp',“_blank”,“directories=no,status=no,menubar=no,scrollbars=yes,resizeable=no,width=600,height=280,top=200,left=200”);
}
Display.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!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=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<table border="1" >
<h2>List of users</h2></caption>
<tr>
<th>ADDRESS_ID</th>
<th>ADDRESS_LINE1</th>
<th>ADDRESS_LINE2</th>
<th>ADDRESS_LINE3</th>
<th>CITY</th>
<th>COUNTRY_CD</th>
<th>ZIP</th>
<th>UPDATER</th>
<th>TIME_STAMP</th>
</tr>
<c:forEach var="user" items="${Data}">
<tr>
<td><c:out value="${user.addressId} " /></td>
<td><c:out value="${user.addressLine1}" /></td>
<td><c:out value="${user.addressLine2}" /></td>
<td><c:out value="${user.addressLine3}" /></td>
<td><c:out value="${user.cityCd}" /></td>
<td><c:out value="${user.countryCd}" /></td>
<td><c:out value="${user.zip}" /></td>
<td><c:out value="${user.updater}" /></td>
<td><c:out value="${user.timeStamp}" /></td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
在此处插入标题
用户名单
地址
地址(第1行)
地址(第2行)
地址(第3行)
城市
国家光盘
拉链
更新程序
时间戳
这可以通过使用Ajax调用实现。。请参考下面的链接,它可能会帮助你
这可以通过使用Ajax调用实现。。请参考下面的链接,它可能会帮助你
您应该使用ajax。您应该使用ajax。