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);
}
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);
}
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);
}
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);
}
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");
}
Aggregations