小弟初学Struts。以前没使用Struts页面没有问题。使用框架后,把html普通标签都改成了Struts的html标签了。
代码是这样的:
<html:form action="shouye.do" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
.....
</table>
</html:form> 
即使换成
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<html:form action="shouye.do" method="post">
.....
</html:form>
</table>
总是无法显示页面。
错误提示:
org.apache.jasper.JasperException: Exception in JSP: /index.jsp:115
115:<html:form action="shouye.do" method="post">问题1:上面错误怎么回事?如何解决
问题2:form和table如何嵌套比较好?(在网上有搜过,但没找到比较明确的资料)
问题3:Struts框架中是不是一个form对应一个ActionForm Bean。假如一个jsp页我做了多个form,这一个JSP页面就要有多个ActionForm Bean?

解决方案 »

  1.   

    Action需要有对应的 ActionForm form放在那没关系 要保证都成对匹配 多个form可以对应一个ActionForm 只要ActionForm属性都有
      

  2.   

    呵呵,找到错误了。是我建的ActionForm Bean忘了继承ActionForm了。
    代码如下:public class indexFormbean extends ActionForm
    现在打分了,但问题可以继续讨论
    问题1:还是form和table问题。好象form和table好象有关系的。有时只有把form放table外面才不报错。有了解的高手可以讲解一下
    问题2:Struts是不是不好调试啊。JSP里没代码了。调试只能在那几个JAVA代码里调,错了都不好找。