关于jsp中符号匹配的问题 jsp中<% < %>第二个<和第三个>匹配了,是怎么回事啊! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <% %> 中间只能写java代码哦,不要混入其它符号.不然就是">" 这样的字符串 我写的是java代码,中间的小于符号“<”居然会与后面的“%>”匹配,搞不懂,老是出这样的问题! <%int id = Integer.parseInt(request.getParameter("id"));int pid = Integer.parseInt(request.getParameter("pid"));boolean isLeaf = Boolean.getBoolean(request.getParameter("isLeaf"));Connection conn=DB.getConn();boolean autoCommit=true;Statement stmt=null;ResultSet rs=null; try{ autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); delete(conn,id,isLeaf); stmt = DB.createStmt(conn); rs = DB.executeQuery(stmt, "select count(*) from article where pid="+pid); rs.next(); int count =rs.getInt(1); if(count<=0){ DB.executeUpdate(conn, "update article set isleaf = 0 where id = "+id); } conn.commit(); }finally{ conn.setAutoCommit(autoCommit); DB.close(rs); DB.close(stmt); DB.close(conn);%>第一个“<%”与最后一个“%>”匹配不上,而“if(count<=0){”中的小于符号(<)与最后的“%>”匹配了! 试了下,可能是IDE的问题吧,我的就不会。只要运行不报问题就对了。 在JSP中这种情况<% < %>确实会报错的。会自动中断<% %>标签。不过你可以多写几个标签即可如:<% for(int i=0;i<10;i...){ int name = 1; %> <input name="xxx"> html代码.....<% }%> 不好意思,是我的错,我的“finally{”后面没有匹配的“}”,但是关于jsp中<% < %>第二个<和第三个>匹配的问题不是存在的!谢谢各位了! 不好意思,是我的错,我的“finally{”后面没有匹配的“}”,但是关于jsp中<% < %>第二个<和第三个>匹配的问题还是存在的!谢谢各位了! HELP!!!!! mysql乱码问题 关于jbpm的,高手请进 保持Java类 怎么理解 STRUTS 基础问题,请教大虾门 这段代码什么意思呀(急着求高手解答) 蔡鸟请教:主重表结构中,从表的联合主键和主键+非空外键是否等同? 如何使INTERNALFRAME一显示就最大化 ? 将音频,视频集成到 Java 应用程序里我该怎么做?听听大家的意见!分可以再加 用的c3p0的连接池,这个问题是哪个jar包和哪个冲突了啊 怎么样上传文件到java的工作目录中,而不是服务器目录中(tomcat安装目录) 使用springsied时action中的属性用@Autowired注解注入失败
int id = Integer.parseInt(request.getParameter("id"));
int pid = Integer.parseInt(request.getParameter("pid"));
boolean isLeaf = Boolean.getBoolean(request.getParameter("isLeaf"));
Connection conn=DB.getConn();
boolean autoCommit=true;
Statement stmt=null;
ResultSet rs=null;
try{ autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
delete(conn,id,isLeaf);
stmt = DB.createStmt(conn);
rs = DB.executeQuery(stmt, "select count(*) from article where pid="+pid);
rs.next();
int count =rs.getInt(1);
if(count<=0){
DB.executeUpdate(conn, "update article set isleaf = 0 where id = "+id);
}
conn.commit();
}finally{
conn.setAutoCommit(autoCommit);
DB.close(rs);
DB.close(stmt);
DB.close(conn);
%>第一个“<%”与最后一个“%>”匹配不上,而“if(count<=0){”中的小于符号(<)与最后的“%>”匹配了!
会自动中断<% %>标签。
不过你可以多写几个标签即可
如:
<%
for(int i=0;i<10;i...){
int name = 1;
%>
<input name="xxx">
html代码.....
<%
}
%>