Foren
How to use velocity scripts in jsp?
Satheesh Ravi, geändert vor 12 Jahren.
How to use velocity scripts in jsp?
Junior Member Beiträge: 35 Beitrittsdatum: 25.11.11 Neueste Beiträge
Hi,
I am using liferay 6.1. I would like to use velocity scripts instead of scriptlets for accessing the web content. I tried including $user.getGreeting() but it is printing it as a text. I am new to liferay. Can anyone help please?
I am using liferay 6.1. I would like to use velocity scripts instead of scriptlets for accessing the web content. I tried including $user.getGreeting() but it is printing it as a text. I am new to liferay. Can anyone help please?
Jan Gregor, geändert vor 12 Jahren.
RE: How to use velocity scripts in jsp?
Regular Member Beiträge: 224 Beitrittsdatum: 20.10.10 Neueste Beiträge
Hi,
What exactly do you need to do ? Basically including vm macros in jsp does not make a sense, as both technologies are more or less based on the same principle and i dont think you win a lot by doing it by VM . Take a look at the ThemeDisplay object, which can be retrieved from each portal request. This object holds a lot of important informations which can be used in your jsp and also available for theme.
Regards,
Jan.
What exactly do you need to do ? Basically including vm macros in jsp does not make a sense, as both technologies are more or less based on the same principle and i dont think you win a lot by doing it by VM . Take a look at the ThemeDisplay object, which can be retrieved from each portal request. This object holds a lot of important informations which can be used in your jsp and also available for theme.
Regards,
Jan.
Samir Gami, geändert vor 12 Jahren.
RE: How to use velocity scripts in jsp?
Regular Member Beiträge: 162 Beitrittsdatum: 04.02.11 Neueste Beiträge
Its not good practice to embed velocity code in jsp , There are many classes in liferay which hold the user/request information's , ThemeDisplay, PortalUtil......
Satheesh Ravi, geändert vor 12 Jahren.
RE: How to use velocity scripts in jsp?
Junior Member Beiträge: 35 Beitrittsdatum: 25.11.11 Neueste Beiträge
K thanks.
Nagendra Kumar Busam, geändert vor 12 Jahren.
RE: How to use velocity scripts in jsp?
Liferay Master Beiträge: 678 Beitrittsdatum: 07.07.09 Neueste Beiträge
It's not a/never a good practice to mix jsp & velocity. Try whatever Jan/Samir is suggesting, that should help
Satheesh Ravi, geändert vor 12 Jahren.
RE: How to use velocity scripts in jsp?
Junior Member Beiträge: 35 Beitrittsdatum: 25.11.11 Neueste Beiträge
Thanks for the reply Nagendra.