Foren

Moving ext servlet filters to hook plugin

Szymon Marciniewicz, geändert vor 12 Jahren.

Moving ext servlet filters to hook plugin

New Member Beiträge: 18 Beitrittsdatum: 13.02.12 Neueste Beiträge
I'm working on liferay upgrade to version 6.1. Version 6.1 allows servlet filters in hook plugin. I just wanted to make sure if I'm doing things correctly.

So basically from WEB-INF/web.xml in my ext I'm moving my <filter>s definitions to WEB-INF/liferay-hook.xml in my hook plugin. Syntax for that is <servlet-filter> and <servlet-filter-mapping>.

My question is: do I also have to specify the same filters in web.xml in my hook plugin? I'm not really able to test that right now, and I don't want to move all the filters and then be wondering why it doesn't work. It compiles and builds and I can deploy it to the server, but still I would like to know if it is the right way to do it.

Thank you for help in advance.
thumbnail
Mika Koivisto, geändert vor 12 Jahren.

RE: Moving ext servlet filters to hook plugin

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
No need to define them in web.xml.
Szymon Marciniewicz, geändert vor 12 Jahren.

RE: Moving ext servlet filters to hook plugin

New Member Beiträge: 18 Beitrittsdatum: 13.02.12 Neueste Beiträge
Thank you. I am also wondering: Do I need web.xml in my hook plugin at all?

I have there welcome-file-list and jsp-config. I deleted that file today for testing purposes and I still could build and deploy my hook plugin, and I didn't notice any issues so far. I just want to be sure nothing will come up in further development phases.

Also if web.xml is needed in the hook plugin at some point - then when?
Thanks again.
thumbnail
Mika Koivisto, geändert vor 12 Jahren.

RE: Moving ext servlet filters to hook plugin

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
web.xml is not needed in hook plugins. Liferay deployer will automatically create it if it's missing as web.xml is required in all webapps and that's what all Liferay plugins are.