determineQuery(pageContext, sContext, req); sContext.setParams(determineParams(sContext, req, so, mailbox)); sContext.doSearch(mailbox);
if (sContext.getCurrentItemIndex() != si) sContext.setCurrentItemIndex(si); } catch (ServiceException e) { throw new JspTagException(e.getMessage(), e);
    public void doTag() throws JspException, IOException {        ZMailbox mailbox = getMailbox();        PageContext pageContext = (PageContext) getJspContext();        ServletRequest req = pageContext.getRequest();        int si = getInt(req, QP_SEARCH_INDEX, 0);        int so = getInt(req, QP_SEARCH_OFFSET, 0);        int usecache = getInt(req, QP_SEARCH_USE_CACHE, -1);        if (usecache == 1) mUseCache = true; // otherwise, leave it set to what was passed in...        String sc = req.getParameter(QP_SEARCH_CONTEXT);        SearchContext sContext = SearchContext.getSearchContext(pageContext, sc);        if (sContext != null) {            pageContext.setAttribute(mVar, sContext, PageContext.REQUEST_SCOPE);            if (si != -1) sContext.setCurrentItemIndex(si);            if ((sContext.getSearchResult().getOffset() != so) || !mUseCache) {                sContext.getParams().setOffset(so);                sContext.doSearch(mailbox);            }                    } else {            // if we get here, we don't have a session, or the one we had timed out            sContext = SearchContext.newSearchContext(pageContext);            pageContext.setAttribute(mVar, sContext, PageContext.REQUEST_SCOPE);            determineQuery(pageContext, sContext, req); // TODO: throw exception?            sContext.setParams(determineParams(sContext, req, so, mailbox));            sContext.doSearch(mailbox);        }        if (sContext.getCurrentItemIndex() != si) sContext.setCurrentItemIndex(si);    }