001
014
015 package com.liferay.portal.kernel.dao.search;
016
017 import com.liferay.portal.kernel.bean.BeanPropertiesUtil;
018 import com.liferay.portal.kernel.servlet.DirectRequestDispatcherFactoryUtil;
019 import com.liferay.portal.kernel.servlet.PipingServletResponse;
020
021 import javax.servlet.RequestDispatcher;
022 import javax.servlet.ServletContext;
023 import javax.servlet.http.HttpServletRequest;
024 import javax.servlet.http.HttpServletResponse;
025 import javax.servlet.jsp.PageContext;
026
027
030 public class JSPSearchEntry extends SearchEntry {
031
032 @Override
033 public Object clone() {
034 JSPSearchEntry jspSearchEntry = new JSPSearchEntry();
035
036 BeanPropertiesUtil.copyProperties(this, jspSearchEntry);
037
038 return jspSearchEntry;
039 }
040
041 public String getPath() {
042 return _path;
043 }
044
045 public HttpServletRequest getRequest() {
046 return _request;
047 }
048
049 public HttpServletResponse getResponse() {
050 return _response;
051 }
052
053 public ServletContext getServletContext() {
054 return _servletContext;
055 }
056
057 @Override
058 public void print(PageContext pageContext) throws Exception {
059 if (_servletContext != null) {
060 RequestDispatcher requestDispatcher =
061 DirectRequestDispatcherFactoryUtil.getRequestDispatcher(
062 _servletContext, _path);
063
064 requestDispatcher.include(
065 _request, new PipingServletResponse(pageContext));
066 }
067 else {
068 pageContext.include(_path);
069 }
070 }
071
072 public void setPath(String path) {
073 _path = path;
074 }
075
076 public void setRequest(HttpServletRequest request) {
077 _request = request;
078 }
079
080 public void setResponse(HttpServletResponse response) {
081 _response = response;
082 }
083
084 public void setServletContext(ServletContext servletContext) {
085 _servletContext = servletContext;
086 }
087
088 private String _path;
089 private HttpServletRequest _request;
090 private HttpServletResponse _response;
091 private ServletContext _servletContext;
092
093 }