Search in sources :

Example 86 with JspWriter

use of javax.servlet.jsp.JspWriter in project adempiere by adempiere.

the class InfoLinkTag method doStartTag.

//	setOneLine
/**
	 *  Start Tag
	 *  @return SKIP_BODY
	 * 	@throws JspException
	 */
public int doStartTag() throws JspException {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
    //	creates wsc/wu
    Properties ctx = JSPEnv.getCtx(request);
    WebSessionCtx wsc = WebSessionCtx.get(request);
    //
    HttpSession session = pageContext.getSession();
    WebUser wu = (WebUser) session.getAttribute(WebUser.NAME);
    if (wu != null && wu.isLoggedIn()) {
        if (ctx != null) {
            WebInfo info = (WebInfo) session.getAttribute(WebInfo.NAME);
            if (info == null || wu.getAD_User_ID() != info.getAD_User_ID()) {
                info = new WebInfo(ctx, wu);
                session.setAttribute(WebInfo.NAME, info);
            }
        }
        //
        //	log.fine("WebUser exists - " + wu);
        //
        JspWriter out = pageContext.getOut();
        HtmlCode html = new HtmlCode();
        //
        if (wu.isCustomer() || wu.isVendor())
            menuBPartner(html, wsc.wstore);
        if (wu.isSalesRep())
            menuSalesRep(html, wsc.wstore);
        if (wu.isEmployee() || wu.isSalesRep())
            menuUser(html, wu.isEmployee(), wsc.wstore);
        menuAll(html, wsc.wstore);
        //
        html.output(out);
    } else {
        if (CLogMgt.isLevelFiner())
            log.fine("No WebUser");
        if (session.getAttribute(WebInfo.NAME) == null)
            session.setAttribute(WebInfo.NAME, WebInfo.getGeneral());
    }
    return (SKIP_BODY);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HtmlCode(org.compiere.util.HtmlCode) HttpSession(javax.servlet.http.HttpSession) WebUser(org.compiere.util.WebUser) Properties(java.util.Properties) WebSessionCtx(org.compiere.util.WebSessionCtx) JspWriter(javax.servlet.jsp.JspWriter) WebInfo(org.compiere.util.WebInfo)

Example 87 with JspWriter

use of javax.servlet.jsp.JspWriter in project adempiere by adempiere.

the class MessageTag method doStartTag.

//	setVar
/**
	 *  Start Tag
	 *  @return SKIP_BODY
	 * 	@throws JspException
	 */
public int doStartTag() throws JspException {
    if (m_txt != null && m_txt.length() > 0) {
        Properties ctx = JSPEnv.getCtx((HttpServletRequest) pageContext.getRequest());
        String msg = Msg.translate(ctx, m_txt);
        log.fine(m_txt + "->" + msg);
        //
        try {
            JspWriter out = pageContext.getOut();
            out.print(msg);
        } catch (Exception e) {
            throw new JspException(e);
        }
    }
    return (SKIP_BODY);
}
Also used : JspException(javax.servlet.jsp.JspException) Properties(java.util.Properties) JspWriter(javax.servlet.jsp.JspWriter) JspException(javax.servlet.jsp.JspException)

Example 88 with JspWriter

use of javax.servlet.jsp.JspWriter in project adempiere by adempiere.

the class RequestOrderRefTag method doStartTag.

//	setBPartner
/**
	 *  Start Tag
	 *  @return SKIP_BODY
	 */
public int doStartTag() {
    //	Parameter
    int C_BPartner_ID = 0;
    try {
        String info = (String) ExpressionUtil.evalNotNull("requestOrder", "bpartnerID", m_bpartnerID_el, String.class, this, pageContext);
        if (info != null && info.length() != 0)
            C_BPartner_ID = Integer.parseInt(info);
    } catch (Exception e) {
        log.severe("BPartner - " + e);
    }
    JspWriter out = pageContext.getOut();
    select select = getRefOrders(C_BPartner_ID);
    select.output(out);
    //
    return (SKIP_BODY);
}
Also used : org.apache.ecs.xhtml.select(org.apache.ecs.xhtml.select) JspWriter(javax.servlet.jsp.JspWriter)

Example 89 with JspWriter

use of javax.servlet.jsp.JspWriter in project adempiere by adempiere.

the class RequestTypeTag method doStartTag.

/**
	 *  Start Tag
	 *  @return SKIP_BODY
	 */
public int doStartTag() {
    JspWriter out = pageContext.getOut();
    select select = getRequestType();
    select.output(out);
    //
    return (SKIP_BODY);
}
Also used : org.apache.ecs.xhtml.select(org.apache.ecs.xhtml.select) JspWriter(javax.servlet.jsp.JspWriter)

Example 90 with JspWriter

use of javax.servlet.jsp.JspWriter in project freemarker by apache.

the class GetAndSetTag method doTag.

@SuppressWarnings("boxing")
@Override
public void doTag() throws JspException, IOException {
    NullArgumentException.check("name", name);
    Integer scopeInt = getScopeAsInteger();
    JspContext ctx = getJspContext();
    JspWriter out = ctx.getOut();
    out.write(scope == null ? "any:" : scope + ":");
    out.write(name);
    out.write(" was ");
    out.write(String.valueOf((scope == null ? ctx.getAttribute(name) : ctx.getAttribute(name, scopeInt))));
    if (scope == null) {
        ctx.setAttribute(name, value);
    } else {
        ctx.setAttribute(name, value, scopeInt);
    }
    out.write(", set to ");
    out.write(String.valueOf(value));
    out.write("\n");
}
Also used : JspContext(javax.servlet.jsp.JspContext) JspWriter(javax.servlet.jsp.JspWriter)

Aggregations

JspWriter (javax.servlet.jsp.JspWriter)145 IOException (java.io.IOException)72 JspException (javax.servlet.jsp.JspException)68 HttpServletRequest (javax.servlet.http.HttpServletRequest)17 JspWriteRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.JspWriteRuntimeException)14 PageContext (javax.servlet.jsp.PageContext)13 Iterator (java.util.Iterator)9 Engine (org.apache.wiki.api.core.Engine)9 JspContext (javax.servlet.jsp.JspContext)8 JspTagException (javax.servlet.jsp.JspTagException)8 OuterFormTagMissingRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.OuterFormTagMissingRuntimeException)7 ArrayList (java.util.ArrayList)6 Properties (java.util.Properties)6 HttpSession (javax.servlet.http.HttpSession)5 BodyContent (javax.servlet.jsp.tagext.BodyContent)5 org.apache.ecs.xhtml.select (org.apache.ecs.xhtml.select)5 Page (org.apache.wiki.api.core.Page)5 HtmlCode (org.compiere.util.HtmlCode)5 MissingParametersRuntimeException (org.jaffa.presentation.portlet.widgets.taglib.exceptions.MissingParametersRuntimeException)5 IPropertyRuleIntrospector (org.jaffa.rules.IPropertyRuleIntrospector)5