tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tommy Pham <>
Subject TC 9.0.21: ContextListener + Servlet app
Date Fri, 14 Jun 2019 20:10:26 GMT
Hello everyone,

I'm trying to write a lightweight and hopefully simple ContextListener +
Servlet application but running into 2 issues I'm unable to find resolution
for and hoping someone would please point me in the right direction:

1)  I'd like to have Tomcat's default servlet serve HTML files only within
directory /path/ and its' subdirectories.  However, I can only get it to
work with this URL mapping "/path/*".  My understanding is that the default
servlet will serve any files within /path/.  Can this be done with URL path
mapping or do I need to write a custom filter?  My servlet's mapping is
"/".  Tomcat's default servlet mapping has "/css/*", "/js/*", "/img/*", and

2)  I Have this small and simple HTML form:
<form method="post">
  <p><input id="text" type="text" size="80"></p>
  <p><input type="submit" value="enter"></p>
My servlet's doPost is triggered but when I iterate the
request.getParameterMap(), it's empty.  When I tried to
request.getParameter("text"), it returned 'null'.  I do have a filter in
place but it's only to log all request access to a database backend
eventually.  That filter is currently dumping it to log.  I've tried
disabling the filter but have the same result.

Thank you,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message