我的一个jsp页面提交到一个action后,在action里使用JOptionPane.showMessageDialog()想弹出一个对话框,可是运行时,在jsp页面里点击提交后,状态条非常缓慢的动,没有反应,这是怎么回事?
解决方案 »
- java API中,没有对数组降序排序的方法?
- ADT作业,帮我做做吧!!
- 急急急:Java打印,设置打印纸大小
- junit能完成哪些测试?
- java 内部遍历
- 怎样才能使frame不能左右缩放,只能上下缩放
- swing.JTable 修改单元值怎么不更新?
- Dos下在运行java MyTest 报错,在线等待,救!
- socket.getInputStream().read(byteArray,position,lengh)是如何工作的???
- jb6使用体会。
- 高分求助!为什么在KeyAdapter里面获不到tab 的事件?
- [求助]需要转换txt数据到mysql数据库,没思路,哪位大侠可以指条明路(欢迎砸帖)
那我应该怎么做?
,Javascript应该放在哪儿?怎么用?
name="Form1"
method="post"
action="***.jsp"
onsubmit="此处是你点击提交按钮后调用的javascript函数">
method='post' focus="newpsd" onsubmit="Judge()">
<%! int Judge(){
out.println("<SCRIPT LANGUAGE='JavaScript'>");
out.println("alert('密码不能为空,请重试!')");
out.println("</SCRIPT>");
return 1;} %>
编译无法通过,好像是在jsp里定义的函数不能用out.println,我该怎样弹出对话框啊??
function Judge()
{
alert('密码不能为空');
}
</script><html:form action="/PeixunPsw.do"
method='post' focus="newpsd" onsubmit="Judge()">
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超过50个字符!");
document.a.b.focus();
return false;
}
}
</script>
<html:form action="/***.do" onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></textarea>
<input type="submit" name="Submit" value="check">
</html:form>
JAVA技术群!愿意的加!36310034!!!!
JAVA技术群!愿意的加!36310034!!!!
JAVA技术群!愿意的加!36310034!!!!
a是 from表单的名字
不好意思漏了
我用了<html:form name="f":IE运行出错
而<html:form property="f":eclipse没有反应
function bb(){
alert(document.getElementById("id").value);
return false;
}
</script>
<body>
<% java.util.List list = new java.util.ArrayList();
list.add(new org.apache.struts.util.LabelValueBean("管理员",
"admin"));
list.add(new org.apache.struts.util.LabelValueBean("客人","guest"));
request.setAttribute("list",list);
%>
<html:form action="/admin" scope="request" onsubmit="return bb()" >
id : <html:select property="id" >
<html:options collection="list" property="value" labelProperty="label"/> </html:select>
<html:submit/><html:cancel/>
</html:form>
</body>
不好意思,前面哪个我用没测试的
struts控件的styleid这个属性对应到html上的id
property 为html的name
我用<html:form name="f">或者<html:form property="f">IE运行都出错
你写的是<html:form action="/admin" scope="request" onsubmit="return bb()" >
你是怎么定义form的名字呢??
Attribute styleid invalid for tag form according to TLD
兄弟注意大小写