<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Accessing Liferay Servlet On /pattern rather /o/pattern</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112275060" />
  <subtitle>Accessing Liferay Servlet On /pattern rather /o/pattern</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112275060</id>
  <updated>2026-04-04T17:31:37Z</updated>
  <dc:date>2026-04-04T17:31:37Z</dc:date>
  <entry>
    <title>RE: Accessing Liferay Servlet On /pattern rather /o/pattern</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112346650" />
    <author>
      <name>John O'Flaherty</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112346650</id>
    <updated>2019-02-14T12:39:34Z</updated>
    <published>2019-02-14T12:39:34Z</published>
    <summary type="html">Hi Olaf,&lt;br /&gt;&lt;br /&gt;A third party js authentication library was looking for a particular folder structure which was the root of my problem. Following your update I removed this obstacle and was no longer contrained by this requirement. Thank you very much indeed as your update was very helpful and got me on the right track. &lt;br /&gt;&lt;br /&gt;Thank you again,&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;John</summary>
    <dc:creator>John O'Flaherty</dc:creator>
    <dc:date>2019-02-14T12:39:34Z</dc:date>
  </entry>
  <entry>
    <title>RE: Accessing Liferay Servlet On /pattern rather /o/pattern</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112276396" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112276396</id>
    <updated>2019-02-08T11:49:28Z</updated>
    <published>2019-02-08T11:49:28Z</published>
    <summary type="html">&lt;blockquote&gt;John O&amp;amp;amp;#39;FlahertyHi all,&lt;br /&gt;&lt;br /&gt;I am re-engineering a servlet application to run as a series of DXP modules. One of the contraints is that the original servlet runs on /proxy pattern, i&amp;#39;ve implemented a dxp component class on the same pattern following this knowledgebase article (https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/servlets-in-a-module). &lt;br /&gt;&lt;br /&gt;When i access localhost/o/proxy/v1/query/search i successfully access my servlet. My intention is to access this servlet on the pattern /proxy/v1/query/search. Is this possible to achieve within liferay or should i look to deploy a traditional servlet directly to tomcat ?&lt;br /&gt;&lt;/blockquote&gt;OSGi components are resolved by the OSGi runtime - and as I understand, it doesn&amp;#39;t handle arbitrary URLs, but those starting with /o/, thus you&amp;#39;re stuck with this access pattern.&lt;br /&gt;You might need to be able to work around this contraint with a reverse proxy or some URL rewriting, but honestly, I&amp;#39;d just change the path in the servlet. Configurable URLs or context paths aren&amp;#39;t the worst in servlets. And as you configure the &amp;#34;servlet context&amp;#34; anyway, you might as well configure it as /o/pattern instead of /pattern.&lt;br /&gt;&lt;br /&gt;There might be other ways around this, but allowing this blindly would quickly ambiguate the purpose of those URLs: E.g. you couldn&amp;#39;t create a servlet under the paths /web/ or /group/ in Liferay, as those names are already taken. The same with arbitrary pagenames: example.com/web/guest/pattern will also be found as example.com/pattern. And there we are back at the reason why there&amp;#39;s a reserved namespace.</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-02-08T11:49:28Z</dc:date>
  </entry>
  <entry>
    <title>Accessing Liferay Servlet On /pattern rather /o/pattern</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112275059" />
    <author>
      <name>John O'Flaherty</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112275059</id>
    <updated>2019-02-08T10:42:45Z</updated>
    <published>2019-02-08T10:42:45Z</published>
    <summary type="html">Hi all,&lt;br /&gt;&lt;br /&gt;I am re-engineering a servlet application to run as a series of DXP modules. One of the contraints is that the original servlet runs on /proxy pattern, i&amp;#39;ve implemented a dxp component class on the same pattern following this knowledgebase article (https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/servlets-in-a-module). &lt;br /&gt;&lt;br /&gt;When i access localhost/o/proxy/v1/query/search i successfully access my servlet. My intention is to access this servlet on the pattern /proxy/v1/query/search. Is this possible to achieve within liferay or should i look to deploy a traditional servlet directly to tomcat ?&lt;br /&gt;&lt;br /&gt;My component annotation is below: &lt;br /&gt;&lt;br /&gt;@Component(&lt;br /&gt;        property = {&lt;br /&gt;            &amp;#34;osgi.http.whiteboard.context.path=/&amp;#34;,&lt;br /&gt;            &amp;#34;osgi.http.whiteboard.servlet.pattern=/proxy/v1/query/search&amp;#34;&lt;br /&gt;        },&lt;br /&gt;        service = Servlet.class&lt;br /&gt;    )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please let me know if there are any questions or if i can provide more information.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;John</summary>
    <dc:creator>John O'Flaherty</dc:creator>
    <dc:date>2019-02-08T10:42:45Z</dc:date>
  </entry>
</feed>
