1
19
20 package com.liferay.taglib.portlet;
21
22 import com.liferay.portal.kernel.util.MethodInvoker;
23 import com.liferay.portal.kernel.util.MethodWrapper;
24 import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
25
26 import javax.servlet.jsp.JspException;
27 import javax.servlet.jsp.tagext.TagSupport;
28
29
35 public class DefineObjectsTag extends TagSupport {
36
37 public int doStartTag() throws JspException {
38 Thread currentThread = Thread.currentThread();
39
40 ClassLoader contextClassLoader = currentThread.getContextClassLoader();
41
42 try {
43 currentThread.setContextClassLoader(
44 PortalClassLoaderUtil.getClassLoader());
45
46 MethodWrapper methodWrapper = new MethodWrapper(
47 _TAG_CLASS, _TAG_DO_START_METHOD, new Object[] {pageContext});
48
49 MethodInvoker.invoke(methodWrapper);
50 }
51 catch (Exception e) {
52 throw new JspException(e);
53 }
54 finally {
55 currentThread.setContextClassLoader(contextClassLoader);
56 }
57
58 return SKIP_BODY;
59 }
60
61 public int doEndTag() {
62 return EVAL_PAGE;
63 }
64
65 private static final String _TAG_CLASS =
66 "com.liferay.portal.servlet.taglib.portlet.DefineObjectsTagUtil";
67
68 private static final String _TAG_DO_START_METHOD = "doStartTag";
69
70 }