Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Satheesh Ravi
How to use velocity scripts in jsp?
December 8, 2011 9:14 PM
Answer

Satheesh Ravi

Rank: Junior Member

Posts: 35

Join Date: November 24, 2011

Recent Posts

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?
Jan Gregor
RE: How to use velocity scripts in jsp?
December 9, 2011 6:01 AM
Answer

Jan Gregor

Rank: Regular Member

Posts: 224

Join Date: October 20, 2010

Recent Posts

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.
Samir Gami
RE: How to use velocity scripts in jsp?
December 9, 2011 7:33 AM
Answer

Samir Gami

Rank: Regular Member

Posts: 159

Join Date: February 3, 2011

Recent Posts

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......
Nagendra Kumar Busam
RE: How to use velocity scripts in jsp?
December 10, 2011 8:19 AM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 637

Join Date: July 7, 2009

Recent Posts

It's not a/never a good practice to mix jsp & velocity. Try whatever Jan/Samir is suggesting, that should help
Satheesh Ravi
RE: How to use velocity scripts in jsp?
December 12, 2011 11:16 PM
Answer

Satheesh Ravi

Rank: Junior Member

Posts: 35

Join Date: November 24, 2011

Recent Posts

K thanks.
Satheesh Ravi
RE: How to use velocity scripts in jsp?
December 12, 2011 11:16 PM
Answer

Satheesh Ravi

Rank: Junior Member

Posts: 35

Join Date: November 24, 2011

Recent Posts

Thanks for the reply Nagendra.