掲示板

Not able to Render JSP from Servelet Filter

8年前 に Madhav Gitte によって更新されました。

Not able to Render JSP from Servelet Filter

New Member 投稿: 4 参加年月日: 15/11/19 最新の投稿
Hi,
is there any way to render jsp from Servlet Filter

I have written
in my doFilter() {
----piece of code---

RequestDispatcher rd= request.getRequestDispatcher("/html/emailadmin/test.jsp");
rd.forward(request,response);
}

but not working emoticon

pls suggest me if anyone knows
Your response will be highly appreciated
Thanks in Advance
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: Not able to Render JSP from Servelet Filter

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Madhav Gitte:
is there any way to render jsp from Servlet Filter


I'm assuming that you're writing a servlet filter with a hook: That would intercept the full request, before the portal page is composed. If the JSP you want to render is part of a portlet, this will be a mismatch. Also, you might run into classloader issues - the servlet filter and the JSP might be running in different contexts. This is not easy or trivial in portal contexts. You should limit yourself to the portlet world with Liferay and stay away from servlets, servlet filters etc. for anything UI oriented. Liferay uses them for example for implementing single sign on systems - inherently non-UI components. But not for rendering a bit of UI - you should do the same.

Whatever you're trying to do: Let us know of the underlying problem and we might be able to come up with a suggestion.