用一个javascript函数就得了
if( )
%><script="javascript">
alert("您的查询条件不足,没有结果")
</script>
<%else
if( )
%><script="javascript">
alert("您的查询条件不足,没有结果")
</script>
<%else
解决方案 »
- 简单传值问题,求教。
- ORA-00933: SQL 命令未正确结束,使用JDBC执行出错,但语句在PL/SQL中执行通过
- struts2 多次请求的配置
- 怎么在Java中连接SQL Sever 2005?急?急?急?
- 求一个简单的网站统计系统代码
- request.getparameter();获取怎么能显示中文
- 请大家帮忙看一下,谢谢!
- 关于 struts 标签 logic:iterate 中的 html:text 问题!!!!!
- 被post方式提交生成的页面,刷新时总是弹出对话框的问题,请问能解决么?
- 谁有servlet控制整个添加,删除,修改,查询的程序
- 谁能搞定这样的问题,肯定是高手!进来看看!
- 请教:解决textarea中输入文字内码格式影响其他text区域的文字内码问题
if(!条件||xxx.equals(""))
{%>
<jsp:forward page="ss.jsp">
<%}%>ss.jsp:您的查询条件不足,没有结果
<head>
<title>查询结果</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body>
<%@ include file="top.htm" %>
<%@page contentType="text/html;charset=GB2312"
import="java.sql.*"
%>
<%
String hy=new String(request.getParameter("hangye").getBytes("iso-8859-1"));
if(hy=="-按行业-")
{%>
/*response.sendRedirect("wrong.jsp");*/
<%@ include file="wrong.html" %>
<%}
else
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:hbmp");
Statement smt=con.createStatement();
String sql;
String hangye=new String(request.getParameter("hangye").getBytes("iso-8859-1"));
String price=new String(request.getParameter("price").getBytes("iso-8859-1"));
String area=new String(request.getParameter("area").getBytes("iso-8859-1"));
String chanpin=new String(request.getParameter("chanpin").getBytes("iso-8859-1"));
String name=new String(request.getParameter("name").getBytes("iso-8859-1"));
sql="select * from qy where hy='"+hangye+"'";
ResultSet rs=smt.executeQuery(sql);
out.println("<center><br><br><br><table border=0>");
out.println("<tr bgcolor='yellow'><th>编号</th><th>公司名称</th><th>产品名称</th><th>品牌名称</th><th>奖项名称</th><th>获奖年份</th><th>所属地区</th><th>所属行业</th><th>明细</th></tr>");
while(rs.next())
out.println("<tr><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(3)+"</td><td>"+rs.getString(5)+"</td><td>"+rs.getString(8)+"</td><td>"+rs.getString(6)+"</td><td>"+rs.getString(9)+"</td><td>"+rs.getString(7)+"</td><td>"+rs.getString(10)+"</td></tr>");
out.println("</table></center><br><br><br>");
con.close();
}
catch(Exception e)
{System.out.println(e.getMessage());}
}
%>
<%@ include file="bottom.htm" %>
</body>
</html>
以上是我的代码,
可是if 语句不发生作用,没有重定向文件,而总是执行else里的代码,这是为什么,各们大哥,帮一下吧,急用呀
if(hy.equals("-按行业-"))试一下。