tomcat无需项目名即可访问该项目配置
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"><Context path="" docBase="/twithandSite"/> </Host>
String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort();request.setAttribute("base", basePath);