读书人

路径struts,该怎么解决

发布时间: 2012-03-12 12:45:32 作者: rapoo

路径struts
struts-config.xml
<action
name="healthExamFormBean"
path="/healthExamDealPages"
scope="request"
type="HealthCareStruts.ActionClass.healthExamAction"/>
请求:
xmlObj.open("get","healthExamDealPages.do?propertyData="+propertyData+"&property="+property+"&type="+1,true);

开始的时候我找个healthexam.jsp放在跟目录下面,页面可以正确执行~~
~~~~~~~~~但后来把页面放在跟目录的一个包HealthInfo下面后,才出错误
就报
2008-9-18 9:00:39 org.apache.struts.action.RequestProcessor processMapping
严重: Invalid path /HealthInfo/healthExamDealPages was requested
我记得页面放在那里并不重要,只要配置文件里写了就行但为什么我着报错误呢?(我的配置文件如上)


[解决办法]
你看看struts-config.xml里面配置的healthexam.jsp路径是不是正确
[解决办法]

JSP路径变了,而你没改struts-config.xml中的路径,所以请求找不到原来的JSP
[解决办法]
你把xmlObj.open("get","healthExamDealPages.do?propertyData="+propertyData+"&property="+property+"&type="+1,true);
改成xmlObj.open("get","/你的工程名/healthExamDealPages.do?propertyData="+propertyData+"&property="+property+"&type="+1,true);
这里用绝对路径.
[解决办法]

读书人网 >J2EE开发

热点推荐