<p>I am using the following servlet-mapping in my <code>web.xml</code> file:</p>

<pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;PostController&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.webcodei.controller.PostController&lt;/servlet-class&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;PostController&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt; 
</code></pre>

<p>To do some kind of a search. ex: <pre><code> <a href="http://www.myweb.com/The" rel="nofollow noreferrer">http://www.myweb.com/The</a> search string here </code></pre></p>

<p>But the problem is that CSS, JS and Images are treated like a search request. </p>

<p><b>There are any patterns that strip out *.css, *.js, *.gif and etc, so the requests don't need to pass through my controller?</b></p>

<p>Thank you so much, bye bye!</p>

Two options come to mind:
1) Typically, in web app like this, the "action" URLs that are handled by a servlet, are given either a sub-directory like "
```
/actions/*
```
" or are given an extension like "
```
*.action
```
" or "
```
*.do
```
" (this is what Struts does). This way it's clear which URLs are intended for the servlet. This is more of an inclusive solution, rather than the exclusive one you're asking for, but I don't think what you want is possible.
2) The slightly more adventurous option is to set up your web app server behind an apache install that serves up the images, css, etc as flat files, sending only everything else onto the app server. Typically, this is done to take the load off your app server. It would require you to copy all these files to a separete directory for apache to handle.