private ZSearchParams determineParams(SearchContext result, ServletRequest req, int so, ZMailbox mailbox) throws JspException {
private ZSearchParams determineParams(SearchContext result, ServletRequest req, int so, ZMailbox mailbox) throws ServiceException {
    private ZSearchParams determineParams(SearchContext result, ServletRequest req, int so, ZMailbox mailbox) throws JspException {        //String so = req.getParameter(QP_SEARCH_OFFSET);        ZSearchParams params = new ZSearchParams(result.getQuery());        params.setOffset(so);        params.setSortBy(mSortBy);        String st = req.getParameter(QP_SEARCH_TYPES);        if (st != null) mTypes = st;        params.setTypes(mTypes);        try {            if (mLimit == -1) {                mLimit = (int) (ZSearchParams.TYPE_CONTACT.equals(mTypes) ?                                        mailbox.getPrefs().getContactsPerPage() :                                        mailbox.getPrefs().getMailItemsPerPage());                if (mLimit == -1)                    mLimit = DEFAULT_SEARCH_LIMIT;            }            params.setLimit(mLimit);        } catch (ServiceException e) {            throw new JspTagException(e.getMessage(), e);        }        //params.setFetchFirstMessage(mFetch);        //params.setPeferHtml(mWanthtml);        //params.setMarkAsRead(mMarkread);        return params;    }