从上一页面传进一参数 参数名为customer_id,参数值未知,请在一个JSP文件中写出代码实现如下功能:
页面含有文本框和按钮两个表单元素,当点击按钮之后,在文本框中显示传进的参数值,且当参数值不为空或null时跳转到另一JSP页面并传出参数,否则弹出提示
页面含有文本框和按钮两个表单元素,当点击按钮之后,在文本框中显示传进的参数值,且当参数值不为空或null时跳转到另一JSP页面并传出参数,否则弹出提示
解决方案 »
- IIS tomcat 整合 servlet 无法显示 404
- 请问当点击jsp列表页面是如何能直接显示列表数据????
- 请问javascript中可以屏蔽某些键盘按键吗?怎么屏蔽?
- 好乱好乱啊 新手提问。。。大家来帮帮忙啊。。。```
- 想请教from进行post出现乱码的问题,急,在线等,三小时内十分钟看一次
- 一个面试题,我没看懂,大家关注下
- 初学乍道,请求帮助
- 文件类
- 我在哪儿才能找到applet代码
- (高分请教)刚接到一个项目,请大家帮我看看我所认为的技术难点该如何解决?Andruw?weidegong帮帮忙
- XFire 搭建的webservice 返回类型为什么不是XML?
- hibernate已实现分页查询,数据量百万以上越往后的数据查询的越慢,怎么解决?
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>test.jsp</title></head>
<%
String customerid= request.getParameter("customer_id") ; if(customerid ==null){
customerid ="";
}
%>
<script>
var customerid ="<%=customerid%>" ; function setValue(){
if(customerid==""){
alert("传入参数为空 请检查");
}else {
document.getElementById("test").value= customerid;
if(confirm("请问需要跳转至其他页面吗")){
window.open("http://localhost:8080/test/otherjsp.jsp?customer_id="+customerid)
}
}
}
</script>
<body><input type="text" id="test" name="test"><input type="button" value="设置" onclick="javascript:setValue();"> </body>
</html>