<?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>Spring and multiple portlet requestMapping in pluginsSDK [SOLVED]</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=5720290" />
  <subtitle>Spring and multiple portlet requestMapping in pluginsSDK [SOLVED]</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=5720290</id>
  <updated>2026-04-07T01:52:01Z</updated>
  <dc:date>2026-04-07T01:52:01Z</dc:date>
  <entry>
    <title>RE: Spring and multiple portlet requestMapping in pluginsSDK [SOLVED]</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14114830" />
    <author>
      <name>Julien Ripault</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=14114830</id>
    <updated>2012-05-25T12:40:08Z</updated>
    <published>2012-05-25T12:40:08Z</published>
    <summary type="html">It&amp;#39;s a shame that there is no other means to do that expect creating many spring context files (one for each portlet) ...</summary>
    <dc:creator>Julien Ripault</dc:creator>
    <dc:date>2012-05-25T12:40:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Spring and multiple portlet requestMapping in pluginsSDK</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5721231" />
    <author>
      <name>Gustavo Fernández Gómez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5721231</id>
    <updated>2010-09-01T13:11:16Z</updated>
    <published>2010-09-01T13:11:16Z</published>
    <summary type="html">interesting question thanks</summary>
    <dc:creator>Gustavo Fernández Gómez</dc:creator>
    <dc:date>2010-09-01T13:11:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Spring and multiple portlet requestMapping in pluginsSDK</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5720982" />
    <author>
      <name>Aritz Galdos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5720982</id>
    <updated>2010-09-01T12:42:35Z</updated>
    <published>2010-09-01T12:42:35Z</published>
    <summary type="html">Well.. I found out the solution for my own problem.&lt;br /&gt;&lt;br /&gt;Actually I was doing something wrong.&lt;br /&gt;&lt;br /&gt;Each portlet had (and has) its own context descriptor xml file.&lt;br /&gt;&lt;br /&gt;In which among other things there was a clause&lt;br /&gt;&lt;blockquote&gt;&amp;lt;context:component-scan base-package=&amp;#34;com.test&amp;#34; /&amp;gt;  &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Wich defines the path of the package in which looks for components.&lt;br /&gt;&lt;br /&gt;This clause was the same in both portlets so each portlet&amp;#39;s DefaultAnnotationHandlerMapping tried to map all the controllers causing conflicts.&lt;br /&gt;&lt;br /&gt;The solution is as easy as this.&lt;br /&gt;&lt;br /&gt;I sepparated controllers in more specific packages like com.test.plet1 and com.test.plet2 and modified in consecuence each portlets context definition.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;context:component-scan base-package=&amp;#34;com.test.plet1&amp;#34; /&amp;gt;  &lt;/blockquote&gt;&lt;br /&gt;and&lt;br /&gt;&lt;blockquote&gt;&amp;lt;context:component-scan base-package=&amp;#34;com.test.plet2&amp;#34; /&amp;gt;  &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope it to be usefull for someone else &lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif" &gt;</summary>
    <dc:creator>Aritz Galdos</dc:creator>
    <dc:date>2010-09-01T12:42:35Z</dc:date>
  </entry>
  <entry>
    <title>Spring and multiple portlet requestMapping in pluginsSDK [SOLVED]</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5720289" />
    <author>
      <name>Aritz Galdos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=5720289</id>
    <updated>2010-09-01T11:40:48Z</updated>
    <published>2010-09-01T11:40:48Z</published>
    <summary type="html">Hi people:&lt;br /&gt;&lt;br /&gt; I am working with Liferay´s pluginsSDK and I intend to develop multiple portlets bunbled in the same war file.&lt;br /&gt;&lt;br /&gt; With Liferay IDE, I create the portlets, configure Spring conf files and create the needed controllers.&lt;br /&gt;&lt;br /&gt; Every thing works fine with one single portlet. I created one sinple controller and decorated it with @Controller and @RequestMapping(&amp;#34;view&amp;#34;) annotations.&lt;br /&gt;&lt;br /&gt; Great. But when I add a second porltet and I add its controller annotated the same way, it crashes during the deployment.&lt;br /&gt;&lt;blockquote&gt;Caused by: java.lang.IllegalStateException: Cannot map handler [prueba01Plet02] to URL path [/view]: There is already handler [com.test.Prueba01Plet02@104c0de] mapped.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;It sais that cannot map a handler to the URL &amp;#34;view&amp;#34; because there is a handler already mapped.&lt;br /&gt;&lt;br /&gt;I guess that the handler already mapped is the first one and crashes when trys to map the second one.&lt;br /&gt;&lt;br /&gt;Well as far as I know, @RequestMapping(&amp;#34;view&amp;#34;) at class level, means that it is mapping this controller to portlets view mode. And each porltet has its own view mode called view. How can I map each controller of each portlet?&lt;br /&gt;&lt;br /&gt;Saying it simply: How can I decorate two controller of two different portlets with  @RequestMapping(&amp;#34;view&amp;#34;) in a single war?&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t know if I explained it clear enough but... I am stuck!&lt;br /&gt;&lt;br /&gt;Thanks in advance!!</summary>
    <dc:creator>Aritz Galdos</dc:creator>
    <dc:date>2010-09-01T11:40:48Z</dc:date>
  </entry>
</feed>
