Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Simon Marcini
Moving ext servlet filters to hook plugin
February 29, 2012 8:41 AM
Answer

Simon Marcini

Rank: New Member

Posts: 18

Join Date: February 13, 2012

Recent Posts

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.
Mika Koivisto
RE: Moving ext servlet filters to hook plugin
February 29, 2012 4:37 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1499

Join Date: August 7, 2006

Recent Posts

No need to define them in web.xml.
Simon Marcini
RE: Moving ext servlet filters to hook plugin
March 9, 2012 4:00 PM
Answer

Simon Marcini

Rank: New Member

Posts: 18

Join Date: February 13, 2012

Recent Posts

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.
Mika Koivisto
RE: Moving ext servlet filters to hook plugin
March 9, 2012 4:14 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1499

Join Date: August 7, 2006

Recent Posts

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.