Foren

Adding Servlet mapped in the ext-web's web.xml

James Smith, geändert vor 11 Jahren.

Adding Servlet mapped in the ext-web's web.xml

Junior Member Beiträge: 29 Beitrittsdatum: 11.02.12 Neueste Beiträge
Hi,
I am trying to add a servlet (i.e. HelloWorld) that is mapped to a URL pattern (i.e. using <url-pattern>) in ext-web's web.xml. I added the HelloWorld to the docroot\WEB-INF\ext-web\docroot\WEB-INF\web.xml and the HelloWorld.java in docroot\WEB-INF\ext-web\src. However, I checked the liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\ext\build-common-ext.xml and I cannot find anything that builds this servlet and deploy it to the liferay. I have tried creating a portlet project for this servlet, but still no luck. Somebody had similar problem and he resolved it by manually adding the jar containing the servlet (http://www.liferay.com/community/forums/-/message_boards/message/6136674)

Do I actually have to change the liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\ext\build-common-ext.xml to allow HelloWorld Servlet to be built and deployed correctly to Liferay?

Help!

Thanks
James Smith, geändert vor 11 Jahren.

RE: Adding Servlet mapped in the ext-web's web.xml

Junior Member Beiträge: 29 Beitrittsdatum: 11.02.12 Neueste Beiträge
Any taker? please help emoticon

James Smith:
Hi,
I am trying to add a servlet (i.e. HelloWorld) that is mapped to a URL pattern (i.e. using <url-pattern>) in ext-web's web.xml. I added the HelloWorld to the docroot\WEB-INF\ext-web\docroot\WEB-INF\web.xml and the HelloWorld.java in docroot\WEB-INF\ext-web\src. However, I checked the liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\ext\build-common-ext.xml and I cannot find anything that builds this servlet and deploy it to the liferay. I have tried creating a portlet project for this servlet, but still no luck. Somebody had similar problem and he resolved it by manually adding the jar containing the servlet (http://www.liferay.com/community/forums/-/message_boards/message/6136674)

Do I actually have to change the liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\ext\build-common-ext.xml to allow HelloWorld Servlet to be built and deployed correctly to Liferay?

Help!

Thanks



emoticonemoticon
thumbnail
Rafael Lluis, geändert vor 10 Jahren.

RE: Adding Servlet mapped in the ext-web's web.xml

Junior Member Beiträge: 30 Beitrittsdatum: 15.10.12 Neueste Beiträge
Same question here

We we're used to add the mapping in the web.xml included with Liferay directly (I know is not a good practise) how should it be done correctly? Do we need to copy the whole web.xml into the ext and then change it? or, are we suppose to add only the lines that change (the new mappings)?

Thank you
thumbnail
Rafael Lluis, geändert vor 10 Jahren.

RE: Adding Servlet mapped in the ext-web's web.xml

Junior Member Beiträge: 30 Beitrittsdatum: 15.10.12 Neueste Beiträge
Maybe the problem is that we're using Websphere. It seems to work on Tomcat but not in Websphere ¿any work around websphere and web.xml in ext?
thumbnail
Benjamin Seiller, geändert vor 10 Jahren.

RE: Adding Servlet mapped in the ext-web's web.xml

New Member Beiträge: 9 Beitrittsdatum: 05.09.12 Neueste Beiträge
Hello Rafael,

concerning your first question: You should be fine just adding your custom servlets and mappings to the ext-web web.xml, no need to copy everything from the original.
This works fine for us with Tomcat.
Concerning Websphere i don't have any clue, but you can check the deployed content of \webapps\ROOT\WEB-INF\web.xml on your application server to make sure your custom servlet mappings are being deployed properly.

Let me know about your findings!

Chers,
Benjamin

ps: Just found this:
http://issues.liferay.com/browse/LPS-9220
It might be you have to patch ExtHotDeployListener (or a class it is using) yourself if the bug still exists in the Liferay version you are using.