Context.xml文件缺少Tomcat 8

时间:2015-07-22 00:28:17

标签: java xml servlets web context.xml

我是Eclipse中创建动态Web项目的初学者。我需要 <SCRIPT type="text/javascript"> var y = 4; //this is a counter function swapRoast() { //This defines the function var x=document.images; //this automatically creates an array of all the images in the document starting with image0 and assigns them to variable'x' if (y <= 3); { //this should check that y <= 3 before running if (x[0].src.match('Roast_Vegetables.png')) //This tests if the source of image0 in the array matches the script { x[0].src=('Roast_Vegetables_Selected.png'); //If the source matches, then it is changed y ++; //should add 1 to the y count } else if (x[0].src.match('Roast_Vegetables_Selected.png')) //If the source doesn't match, then it tests a different source { x[0].src=('Roast_Vegetables.png'); //If the different source matches, then the script operates in reverse to the original IF y --; //should subtract 1 from the y count } } } function swapVege(obj) { var x=document.images; if (y <= 3); { if (x[1].src.match('Vegetables.png')) { x[1].src=('Vegetables_Selected.png'); y ++; document.getElementById("demo").innerHTML = y; } else if (x[1].src.match('Vegetables_Selected.png')) { x[1].src=('Vegetables.png'); y --; document.getElementById("demo").innerHTML = y; } } } 文件来设置数据库领域,但它不在context.xml下,而是在Tomcat的conf目录中找到它。我是否将Eclipse / Tomcat配置错误,因为所有来源都说该文件应该在META-INF中?如何在项目中添加META-INF文件?

我正在使用Eclipse火星和Tomcat 8。

修改 我阅读了评论中链接的帖子,它们不是重复的。坦率地说,我甚至无法理解对方的问题,尽管这可能是因为所有这些术语对我来说都是新的。

1 个答案:

答案 0 :(得分:1)

尽管Eclipse是一个很棒的工具,但我建议您使用NetBeans进行Web事务。

在Eclipse中,您可能找不到context.xml所在的meta-inf文件,找到可以检查以下内容的文件:

首先检查Eclipse中的工作区路径,假设它指向/root/workspace

然后浏览器文件夹,你应该有一个名为Servers的文件夹,如果你不想通过查看Eclipse中的服务器选项卡来找到它。

在Servers文件夹中,您会找到类似Tomcat v8.0 Server at localhost-config的内容,找到该文件夹​​,并在那里找到与tomcat相关的配置文件。

这是因为Eclipse也遵循其Web应用程序的工作空间架构,而NetBeans遵循Tomcat指定的内容。

请记住,在使用Eclipse时创建,编辑或删除tomcat的配置文件不会影响任何内容,因为将使用指定的文件。

<小时/> 服务器的东西也可以作为类似项目的项目server找到,你可以在包管理器上找到它,你可以在那里探索项目树,东西......