问题描述
这几天遇到这样一种现象,就是在myeclipse中修改项目后,有时候可以保存到tomcat中已发布的项目中,但有时候根本存不上,但重新发布有时候好使,但有时候也不好使,于是我把tomcat中的已发布的项目手七删除,再重新发布,存上了。但今天虽然这种方法也不好使了。我真不知道是什么原因,没有规律,有时候好使有时候不好使,大家有人遇到过这种现象吗?我现在调程序的时间要比写程序的时间多很多,真是很郁闷呀,把jdk、eclipse、tomcat缷载重装也不好使。大家谁有办法吗?
解决方案
解决方案二:
遇到这种问题我一般会在这几个目录里面找相关的文件删D:ProgramFilesTomcat5.0confCatalinalocalhostD:ProgramFilesTomcat5.0workCatalinalocalhostD:ProgramFilesTomcat5.0webapps下面是tomcat文档中关于<context>的说明:ThewebapplicationusedtoprocesseachHTTPrequestisselectedbyCatalinabasedonmatchingthelongestpossibleprefixoftheRequestURIagainstthecontextpathofeachdefinedContext.Onceselected,thatContextwillselectanappropriateservlettoprocesstheincomingrequest,accordingtotheservletmappingsdefinedinthewebapplicationdeploymentdescriptorfile(whichMUSTbelocatedat/WEB-INF/web.xmlwithinthewebapp'sdirectoryhierarchy).YoumaydefineasmanyContextelementsasyouwish.EachsuchContextMUSThaveauniquecontextpath,whichisdefinedbythepathattribute.Inaddition,youMUSTdefineaContextwithacontextpathequaltoazero-lengthstring.ThisContextbecomesthedefaultwebapplicationforthisvirtualhost,andisusedtoprocessallrequeststhatdonotmatchanyotherContext'scontextpath.InadditiontonestingContextelementsinsideaHostelement,youcanalsostoretheminindividualfiles(witha".xml"extension)inthe$CATALINA_HOME/conf/[enginename]/[hostname]/directory.SeeAutomaticApplicationDeploymentformoreinformation.Thismethodallowsdynamicreconfigurationofthewebapplication,sincethemainconf/server.xmlfilecannotbereloadedwithoutrestartingTomcat.Pleasenotethatfortomcat5.x,unliketomcat4.x,itisNOTrecommendedtoplace<Context>elementsdirectlyintheserver.xmlfile.Instead,putthemintheMETA-INF/context.xmldirectoryofyourWARfileortheconfdirectoryasdescribedabove.