<%
String action=toGB2312(request.getParameter("submit")!=null?request.getParameter("submit"):"") ;
if(action.compareTo("")==0){
%>
<p align="center">
<tr><form name="form1" method="post" action="/* thispage */">
<input type="submit" name="submit" value"a">
<input type="submit" name="submit" value="b">
<input type="submit" name="submit" value="c">
<input type="submit" name="submit" value="d">
<form>
</tr>
</p>
<table>
......
</table>
<%
} // xhongyang(冷月畅晚) 你第一个if的结束大括号丢掉了if(action.compareTo("a")==0){
%>
<form name="form2" method="post" action="./taskset.jsp">
<input type="submit" name="Submit" value="aaa">
<form>
<%
}
%>
String action=toGB2312(request.getParameter("submit")!=null?request.getParameter("submit"):"") ;
if(action.compareTo("")==0){
%>
<p align="center">
<tr><form name="form1" method="post" action="/* thispage */">
<input type="submit" name="submit" value"a">
<input type="submit" name="submit" value="b">
<input type="submit" name="submit" value="c">
<input type="submit" name="submit" value="d">
<form>
</tr>
</p>
<table>
......
</table>
<%
} // xhongyang(冷月畅晚) 你第一个if的结束大括号丢掉了if(action.compareTo("a")==0){
%>
<form name="form2" method="post" action="./taskset.jsp">
<input type="submit" name="Submit" value="aaa">
<form>
<%
}
%>
解决方案 »
- 运行方法报错 An unexpected error has been detected by Java Runtime Environment:
- javascript 里的out.println()是什么意思
- 在MyEclipse调用getServletContext()
- 怎样用IE直接打开要下载的PDF文件
- 在struts中,我用<bean:write>从数据库中读出数据,如何把这些数据加到<html:link>中的paramProperty变量呢
- 访问jsp报错,怎么回事啊?
- 一个web项目,每一个子模块发布一个war包问题
- c3p0链接不到mysql数据库,jdbc可以连
- 对于有","和"'"符号向数据库提交问题?
- 关于beans和servlet的问题
- JSP里CachedRowSet怎么使用?
- help!
最后一个<form>改成</form>
<html>
<head>
<title>
main
</title>
</head><body>
<h1>
JBuilder Generated JSP
</h1>
<%
String action=(request.getParameter("submit")!=null?request.getParameter("submit"):"") ;
if(action.compareTo("")==0){//第一次进入该页面,未提交
out.println(action);
%>
<p align="center">
<tr><form name=form1 method="post" action="main.jsp">
<input type="submit" name="submit" value="a">
<input type="submit" name="submit" value="b">
<input type="submit" name="submit" value="c">
<input type="submit" name="submit" value="d">
</form>
</tr>
</p>
<table>
</table>
<%}
else{//已经提交
%>
<%
if(action.compareTo("a")==0){
out.println(action);
%>
<form name="form2" method="post" action="taskset.jsp">
<input type="submit" name="Submit" value="aaa">
</form>
<%
}
}
%>
</body>
</html>
这样就没有问题了!!!祝你好运,盼你笑脸!!!
request.getParameter
去同名的第一个参数