Creating liferay portlet - how to pass data to view.jsp from Java class?

后端 未结 3 476
遥遥无期
遥遥无期 2020-12-24 02:46

I\'m trying to create portlet in liferay with just only from a JSP file called view.jsp. What I need is:

  1. When the portlet loads, I want to call

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 03:29

    Your question is quite vague, I recommend to get some introduction to portlet development as it seems to be about the basic understanding of the infrastructure/specification.

    An attempt to answer your question by giving some pointers - apologies if they're also too vague:

    • init() is part of the portlet lifecycle and will be called once, when the portlet class is loaded.
    • You can pass values to your view by (for example) adding request attributes to your RenderRequest in doView()

    of course this varies with the portlet framework that you're using - the methods mentioned above are from the underlying portlet specification (i.e. JSR-286)

提交回复
热议问题