问题描述
action类packagecom.lwl.luzheng.action;importjava.util.List;importorg.springframework.transaction.annotation.Propagation;importorg.springframework.transaction.annotation.Transactional;importcom.lwl.luzheng.biz.JiBenXinXiBiz;importcom.lwl.luzheng.entity.JiBenXinXi;importcom.opensymphony.xwork2.ActionContext;importcom.opensymphony.xwork2.ActionSupport;@Transactional(propagation=Propagation.REQUIRED)publicclassJiBenXinXiActionextendsActionSupport{privateJiBenXinXijiBenXinXi;publicJiBenXinXigetJiBenXinXi(){returnjiBenXinXi;}publicvoidsetJiBenXinXi(JiBenXinXijiBenXinXi){this.jiBenXinXi=jiBenXinXi;}privateStringorderBy;publicStringgetOrderBy(){returnorderBy;}publicvoidsetOrderBy(StringorderBy){this.orderBy=orderBy;}privateJiBenXinXiBizjiBenXinXiBiz;publicJiBenXinXiBizgetJiBenXinXiBiz(){returnjiBenXinXiBiz;}publicvoidsetJiBenXinXiBiz(JiBenXinXiBizjiBenXinXiBiz){this.jiBenXinXiBiz=jiBenXinXiBiz;}@Overridepublicvoidvalidate(){}publicStringexecute(){Listlist=jiBenXinXiBiz.getJiBenXinXi();ActionContextcontext=ActionContext.getContext();//往session里放attributecontext.getSession().put("list",list);returnSUCCESS;}publicStringsearchJiBenXinXi(){Listlist=jiBenXinXiBiz.search(jiBenXinXi,orderBy);ActionContextcontext=ActionContext.getContext();//往session里放attributecontext.getSession().put("list",list);System.out.println("5555555555");returnnull;}}页面<%@pagecontentType="text/html;charset=gb2312"language="java"%><%@taglibprefix="s"uri="/struts-tags"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title>无标题文档</title><styletype="text/css"><!--#Layer1{position:absolute;left:0px;top:0px;width:2px;height:462px;z-index:1;}--></style><scriptlanguage="javascript">functiononload(){parent.mainFrame.location="fenye.jsp";}functioncheckType(){vargonmin=document.getElementById("gongmin");varfaren=document.getElementById("faren");vartype=document.getElementById("clientType").value;if(type=="法人或其他组织"){alert("fghjm");faren.readOnly=false;gonmin.value="";gonmin.readOnly=true;}elseif(type=="公民"){gonmin.readOnly=false;faren.readOnly=true;faren.value="";return;}}</script></head><bodyonload="onload()"><s:formname="form1"id="form1"method="post"action="jiBenXinXi!searchJiBenXinXi"><divid="Layer1"><tableheight="500"cellspacing="0"cellpadding="0"><tr><tdwidth="182"valign="top"bgcolor="#CCCCCC"><div><tablewidth="182"border="0"cellspacing="0"cellpadding="0"><tr><tdwidth="182"><ahref="#"class="A2"><divid="menu1"style="height:20px;text-align:center;"class="mouseOutStyle"onMouseOver="this.className='mouseOverStyle'"onMouseOut="this.className='mouseOutStyle'"><spanclass="td2">查询条件</strong></span></div></a><tablewidth="100%"border="0"cellpadding="0"cellspacing="0"><tr><tdwidth="10"> </td><tdwidth="10"> </td></tr><tr><td> </td><td>适用程序:</td></tr><tr><td> </td><td><selectname="jiBenXinXi.shiYongChengXu"id="select"style="WIDTH:150px"><option>全部</option><option>简易程序</option><option>一般程序</option></select></td></tr><tr><td> </td><td>案由:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.gistOfCase"/></td></tr><tr><td> </td><td>当事人类型:</td></tr><tr><td> </td><td><selectname="jiBenXinXi.dangShiRenLeiXing"id="clientType"style="WIDTH:150px"onchange="checkType()"><optionvalue="全部">全部</option><optionvalue="公民">公民</option><optionvalue="法人或其他组织">法人或其他组织</option></select></td></tr><tr><td> </td><td>公民:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.gongMinXingMing"id="gongmin"readonly/><br/></td></tr><tr><td> </td><td>法人或其他组织:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.FaRenDaiBiao"id="faren"readonly="readonly"/><br/></td></tr><tr><td> </td><td>违章车型:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.changPaiXingHao"/><br/></td></tr><tr><td> </td><td>违章车牌号:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.chePaiHao"/><br/></td></tr><tr><td> </td><td>案件状态:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.anJianZhuangTai"/><br/></td></tr><tr><td> </td><td>立案日期:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.liAnRiQi"/><br/></td></tr><tr><td> </td><td>结案日期:</td></tr><tr><td> </td><td><inputtype="text"name="jiBenXinXi.jieAnRiQi"/><br/></td></tr><tr><td> </td><td>排序方式:</td></tr><tr><td> </td><td><selectname=""><optionvalue="liAnRiQi">默认</option><optionvalue="shiYongChengXu">适用程序</option><optionvalue="gistOfCase">案由</option><optionvalue="anJianZhuangTai">案件状态</option></select></td></tr><tr><tdcolspan="2"align="center"height="30"><inputtype="submit"value="搜索"><br></td></tr></table></td></tr></table></div></td></tr></table></div></s:form></body></html>
解决方案
解决方案二:
你的strust配置呢?
解决方案三:
配置文件贴出来
解决方案四:
对应属性的set/get方法
解决方案五:
<s:formname="form1"id="form1"method="post"action="jiBenXinXi!searchJiBenXinXi.action">
解决方案六:
引用4楼redlotus_lyn的回复:
<s:formname="form1"id="form1"method="post"action="jiBenXinXi!searchJiBenXinXi.action">
+1
解决方案七:
引用4楼redlotus_lyn的回复:
<s:formname="form1"id="form1"method="post"action="jiBenXinXi!searchJiBenXinXi.action">
错<s:formname="form1"id="form1"method="post"action="jiBenXinXi。action!searchJiBenXinXi">动态调用方法lz我原来也这样写过但是有时候会出问题你可以在配置文件中直接配置看可以不