在tomcat\conf的文件server.xml中增加
<Context path="/test" docBase="F:\\abc\\def" debug="0" reloadable="true" >
</Context>
<Context path="/test" docBase="F:\\abc\\def" debug="0" reloadable="true" >
</Context>
解决方案 »
- 多线程问题:每个线程休息不同的时间,然后继续执行
- 请教一个问题,如何把tomcat sqlserver web项目作成一个 安装包
- 使用哪个google Api 可以把google search嵌入我自己程序中
- 一个邮件程序
- jsp链接sql server 2000的错误?帮解决一下,跪求,我第一天接触JSP
- 高手指点指点我如何用JSP编写一个可以自动发送邮件的程序
- 这段jsp 代码怎样转换 servlet+javabean???(图片上传)
- java 通过modem接收传真!
- dhtmlXTree拖拽事件
- 在TOMCAT下如何用浏览器访问我的servlet
- 这样的问题如何解决呀,回答就有分,郁闷,谁来帮我----谢谢先!
- 传递数据是用的session().但要放很多数据,这么方是否得当?急
加入!
<host name="127.0.0.1">
<context path="/test" docbase="F:\\abc\\def"/>
</host>
PARSE error at line 156 column 11
org.xml.sax.SAXParseException: The content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servle
t-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,
resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-r
ef*)".
context 元素应该是放在 ContextManager 元素里面.这要看具体的dtd文件
<?xml version="1.0" encoding="ISO-8859-1"?><!ELEMENT Server (ContextManager+)>
<!ATTLIST Server
adminPort NMTOKEN "-1"
workDir CDATA "work"><!ELEMENT ContextManager (Context+, Interceptor*, Connector+)>
<!ATTLIST ContextManager
port NMTOKEN "8080"
hostName NMTOKEN ""
inet NMTOKEN ""><!ELEMENT Context EMPTY>
<!ATTLIST Context
path CDATA #REQUIRED
docBase CDATA #REQUIRED
defaultSessionTimeOut NMTOKEN "30"
isWARExpanded (true | false) "true"
isWARValidated (false | true) "false"
isInvokerEnabled (true | false) "true"
isWorkDirPersistent (false | true) "false"><!ELEMENT Interceptor EMPTY>
<!ATTLIST Interceptor
className NMTOKEN #REQUIRED
docBase CDATA #REQUIRED> <!ELEMENT Connector (Parameter*)>
<!ATTLIST Connector
className NMTOKEN #REQUIRED><!ELEMENT Parameter EMPTY>
<!ATTLIST Parameter
name CDATA #REQUIRED
value CDATA "">可以看到 ContextManager元素中可以包含一个或多个context.举个实现的例子,就是在server.xml的具体写法,省略了一些属性:
<Server>
<ContextManager>
<Context></Context>
</ContextManager>
</Server>
<ContextManager>
<Context path="/test" docBase="F:\\codeFactory\\test" debug="0" privileged="true"/>
</ContextManager>
改成这样也不行:
<ContextManager>
<Context path="/test" docBase="F:/codeFactory/test" debug="0" privileged="true"/>
</ContextManager>
这个,用不用加上去