Message Boards

Use custom (or liferay) classes into hook jsp module

Nikita Laitinen, modified 3 Years ago.

Use custom (or liferay) classes into hook jsp module

Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts
Hi there!

I've got a problem.
I have a core jsp module that overrides liferay core theme jsp files.
Structure of this module looks like:



I used this article https://help.liferay.com/hc/en-us/articles/360017881172-JSP-Overrides-Using-Custom-JSP-Bag-
But the problem is:
When I import some class (my custom class from other module or liferay util) I got the next error
the idea of error ->



another example
I have utils package that contains different classes. That package is exported. When I import it in corejsp hook jsp files I get the same problem.
If i import it into main java file of corejsp hook it works.
I suppose that the problem is context. (I just know it, but how it works and how to solve it according to my module structure I don't know. What i have to change or add in my module corejsp??)Help me, please
thumbnail
Olaf Kock, modified 3 Years ago.

RE: Use custom (or liferay) classes into hook jsp module

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
Nikita Laitinen:

I have a core jsp module that overrides liferay core theme jsp files.


That, together with the error message that you cite sounds like a bad solution to an otherwise benign problem. What are you trying to achieve when you go this path?
And why do you post images of text? This won't be indexed, is harder to read, impossible to quote (by copy/paste, or highlight). Please post text as text. And the external image doesn't load, making your question incomplete.
Nikita Laitinen:


I have utils package that contains different classes. That package is exported. When I import it in corejsp hook jsp files I get the same problem.
If i import it into main java file of corejsp hook it works.
I suppose that the problem is context. (I just know it, but how it works and how to solve it according to my module structure I don't know. What i have to change or add in my module corejsp??)Help me, please


It looks like you're introducing a dependency of the core to one of the modules, e.g. Journal. As Journal is also dependent on core, this introduces a circular dependency that's not in there in the first place. Yet another signal that the solution you chose to implement your problem isn't an appropriate solution.
Please tell us about the problem that you're trying to solve, and we can come up with a solution suggestion that's better practice.
Nikita Laitinen, modified 3 Years ago.

RE: RE: Use custom (or liferay) classes into hook jsp module

Junior Member Posts: 44 Join Date: 12/18/19 Recent Posts

Hi
I got it. Next time i'll post using text.

I have a web content portlet. It contains some info (let's say it is settings - user choice). I would like to read this info inside corejspfragment module. Depending on the info I got previously I would like to load or not scripts from site setting -> advanced -> analytics (corejspfragment module). I would like to compare the names of the fields (web content and site analytics fields) and load it by some condition