How can I declare a function inside GSP? I need something like taglib but declared inside GSP – it doesn’t matter outside
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t define methods in GSPs. But you can have anonymous functions if you want 😀
Example:
Though this example doesn’t make too much sense, as that little formatting could be inlined. For any kind of extra logic for the views, I would follow OverZealous recommendation and use a taglib.