I want to write a simple java source code for a liferay portlet. While I am writing source code for a liferay portlet do I also need to any changes in portlet.xml
, liferay-portlet.xml
, liferay.display.xml
and web.xml
I dont see any information regarding this anywhere.
Any help and suggestions would be much appreciated.
Asked
Active
Viewed 508 times
1

VC1
- 1,660
- 4
- 25
- 42

user1983063
- 139
- 1
- 2
- 10
2 Answers
2
You have to define the portlet class in the portlet.xml
file, it is a fully qualified class name like come.help.me.portlet.HelpPortlet
when the portlet will be executed (either by putting on the page or when the page is accessed with the portlet or when any action done on the portlet), this portlet class' methods will be called.
If you are using the liferay-sdk then your portlet class should be in portlet-folder/docroot/WEB-INF/src/eu/ibacz/example/NewPortlet.java
of your portlet.

Felix Christy
- 2,179
- 1
- 19
- 32
-
Thank you Felix. I have defined the classname as eu.ibacz.example.NewPortlet in portlet.xml file. where eu.ibacz.example is the package name and NewPortlet is the class name of this package.
eu.ibacz.example.NewPortlet . What about in build.xml? – user1983063 Mar 06 '13 at 13:25
2
you create a liferay mvc portlet .Just create a liferay project-> liferay portlet and write your java code inside portlet.It will automatically change in portlet.xml, liferay-portlet.xml, liferay.display.xml and web.xml

Biswajit
- 2,434
- 2
- 28
- 35