title: Custom servlet/jsp in Liferay portlet
body: <p>I remember it was possible to add something like this to web.xml of a portlet and one could reach the jsp or servlet at <a href="http://host:8080/abcd/hw" rel="nofollow">http://host:8080/abcd/hw</a> .... </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;myjsp&lt;/servlet-name&gt;
      &lt;jsp-file&gt;/index.jsp&lt;/jsp-file&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;hello&lt;/param-name&gt;
          &lt;param-value&gt;test&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;myServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.example.Servlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;myjsp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/jsp/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;myServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/abcd/hw&lt;/url-pattern&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But now it kinda resolves into </p>
  
  <pre><code>INFO  [PortalImpl:4243] Current URL /abcd/hw generates exception: null
  </code></pre>
  
  <p>like if it was filtered away or something, but I haven't found anything when debugging it.</p>
  
  <p>I smell the problem here</p>
  
  <pre><code>13:48:58,587 DEBUG [ETagFilter:116] [http-8080-1]&gt; com.liferay.portal.servlet.filters.etag.ETagFilter /web/guest/abcd/hw
  13:48:58,588 DEBUG [I18nFilter:116] [http-8080-1]=&gt; com.liferay.portal.servlet.filters.i18n.I18nFilter /web/guest/abcd/hw
  13:48:58,588 DEBUG [SecureFilter:118] Access allowed for 127.0.0.1
  13:48:58,589 DEBUG [SecureFilter:138] https is not required
  13:48:58,589 DEBUG [SecureFilter:172] Not securing http://localhost:8080/web/guest/abcd/hw
  13:48:58,590 DEBUG [SecureFilter:116] [http-8080-1]==&gt; com.liferay.portal.servlet.filters.secure.SecureFilter /web/guest/abcd/hw
  13:48:58,645 INFO  [PortalImpl:4437] Current URL /abcd/hw generates exception: null
  13:48:58,646 DEBUG [SecureFilter:118] Access allowed for 127.0.0.1
  13:48:58,647 DEBUG [SecureFilter:138] https is not required
  13:48:58,647 DEBUG [SecureFilter:172] Not securing http://localhost:8080/c/portal/status
  13:48:58,648 DEBUG [SecureFilter:116] [http-8080-1]===&gt; com.liferay.portal.servlet.filters.secure.SecureFilter /c/portal/status
  13:48:58,649 DEBUG [MainServlet:359] Process service request
  </code></pre>