I am making a "blog-platform" where users can write articles, and I want each article to get its own URL. Therefore, I'd like every page with the URL /blog/*
to be sent to the same Servlet.
I have tried using web.xml like this:
<servlet>
<servlet-name>BlogServlet</servlet-name>
<servlet-class>package.BlogServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>BlogServlet</servlet-name>
<url-pattern>/blog/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>MainServlet</welcome-file>
</welcome-file-list>
This doesn't work. /blog
works, but /blog/
and /blog/any_string
only gives off a timeout after a while. What am I doing wrong? Is there any other way I could implement this, other than parameters?