You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pranav Lal <pr...@gmail.com> on 2017/05/15 15:34:23 UTC

Tomcat 9: using static files in my servlet

	Hi all,

I am using tomcat version 9.0.0.M20
My question is that my servlet needs to read files and write a log of what it
did. Where do I place the files to be read? Do I put then in the
C:\tomcat\webapps\cisoWeb\WEB-INF folder? 
Note:
I am using windows 10 creators update for development but will switch to Linux
when I deploy the program.
background: 
I have created a servlet using the quorum programming language.(
https://quorumlanguage.com/) The servlet is a chatbot. The program asks the user
a question, looks up the answer and then returns a response. The bot is using
AIML as a database. There is a java library I am using to handle the AIML so the
need for java to run on the server.

I am including my web.xml and the context.xml files. I am not sure what I am
doing wrong but whenever I run my servlet, I am told that a file is not found.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
        <servlet-name>Processor</servlet-name>
        <servlet-class>web.servlet.Processor</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Processor</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>Processor</welcome-file>
    </welcome-file-list>
</web-app>

Context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path=""/>

Pranav


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org