Combination View Flat View Tree View
Threads [ Previous | Next ]
Sorin Silaghi
how can I overwrite a liferay method from the ext environment
February 15, 2008 5:05 AM

Sorin Silaghi

Rank: Junior Member

Posts: 40

Join Date: September 10, 2007

Recent Posts


I have one small problem ... there is a bug in liferay 4.3.6:

Now in order to fix this I would have to overwrite a method in ... I'd love to do that from the extended environment but I'm not sure what's the best way.... If a make another class with the same package and name in the ext environment will the build system replace the original class with mine ? (like with jsp files ?) .... If not can I register a new bean that extends BBCodeUtil to replace it ???? Or can I register, in general, a custom bean to replace an existing one ? like for example UserServiceImpl ... or any other service for that mater ...

Thank You,
Artur Linhart
RE: how can I overwrite a liferay method from the ext environment
February 16, 2008 3:37 PM

Artur Linhart

Rank: Expert

Posts: 459

Join Date: September 13, 2007

Recent Posts

OK, I think You can make it with ext environment, but if You want just change some small thing, You can copy the source of the class, make your modifications, create the class-file by compiling it and then put it into the directory webapps/ROOT/WEB-INF/classes/package/to/the/modified/class/
- everything what is in the directory WEB-INF/classes will be loaded before everything in jars in the lib directory - so You can be sure it will be your modified class which will be loaded and not the original one from liferay... Your modified class has to have the same method signatures like the old one.

Of course, if you then have hundreds of such modified clases with huge functionality, it gets more problematic... but with the simple modification I think it is better than deal with the ext environment.

with regards, Archie