Search in sources :

Example 1 with SearcherTagHelper

use of com.agiletec.plugins.jacms.aps.tags.util.SearcherTagHelper in project entando-core by entando.

the class SearcherTag method doStartTag.

@Override
public int doStartTag() throws JspException {
    ServletRequest request = this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    try {
        String word = request.getParameter("search");
        SearcherTagHelper helper = new SearcherTagHelper();
        List<String> result = helper.executeSearch(word, reqCtx);
        this.pageContext.setAttribute(this.getListName(), result);
        request.setAttribute("search", word);
    } catch (Throwable t) {
        _logger.error("error in do start tag", t);
        // ApsSystemUtils.logThrowable(e, this, "doStartTag");
        throw new JspException("Error detected while initialising the tag", t);
    }
    return SKIP_BODY;
}
Also used : SearcherTagHelper(com.agiletec.plugins.jacms.aps.tags.util.SearcherTagHelper) ServletRequest(javax.servlet.ServletRequest) JspException(javax.servlet.jsp.JspException) RequestContext(com.agiletec.aps.system.RequestContext)

Aggregations

RequestContext (com.agiletec.aps.system.RequestContext)1 SearcherTagHelper (com.agiletec.plugins.jacms.aps.tags.util.SearcherTagHelper)1 ServletRequest (javax.servlet.ServletRequest)1 JspException (javax.servlet.jsp.JspException)1