日期:2014-05-17  浏览次数:20686 次

jsp中<form>标记问题?头疼了很多天
<form method="POST" action="forumaddservlet?button=add&forumid=<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>" name="form">


.....................................................................................
此处省略很多行


</form>。。。。。。。。。。。。。。。。。。。这里提示错误如下:

Multiple annotations found at this line
No start tag (<form>)
Invalid location of tag(<form>)

请教高手,该怎么解决???

------解决方案--------------------
把form里面的代码全部贴出来啊 
根据下面的翻译结果:
 Invalid location of tag(<form>)--> 附签的无效位置(<form>)
No start tag (<form>)-->没有开始附签
Multiple annotations found at this line-->多个注解在这行发现

全部贴出来看看吧


------解决方案--------------------
非高手飘过,无图无真相。


------解决方案--------------------
为什么里面有这么多<% %>,不能简化吗?
------解决方案--------------------
"forumaddservlet?button=add&forumid=<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>"

这句话 在别的地方 比如 初始化页面的地方 定义好 然后 直接调用

------解决方案--------------------
action="forumaddservlet?button=add&forumid=<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>"

这段代码好像有错

应该这样写

action="forumaddservlet?button=add&forumid="+<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>
------解决方案--------------------
<form method="POST" action="forumaddservlet?button=add&forumid=<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>" name="form">
上面有错
这样写试试
<form method="POST" action="forumaddservlet?button=add&forumid=str name="form">

<% 
 String str = "";
 if(getedfb.getForumid()!=null){
forumid=getedfb.getForumid()
 }
%>
------解决方案--------------------
看到高手们的代码,真晕。。。可惜只有你自己能看的懂!
------解决方案--------------------
为什么JSP页面里还有那么多逻辑处理
------解决方案--------------------
你在form标签中加入 enctype=“multipart/form-data”
------解决方案--------------------
<form method="POST" action="forumaddservlet?button=add&forumid=<%if(getedfb.getForumid()!=null){%><%=getedfb.getForumid()%><%}%>" name="form">
楼主,我感觉这个有问题,括号的对应好乱啊,希望下次写时能注意括号的对应,以及他们的缩进关系。