use of javax.servlet.jsp.JspWriter in project wildfly by wildfly.
the class InternalTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
out.println("Internal Tag!");
}
use of javax.servlet.jsp.JspWriter in project OpenClinica by OpenClinica.
the class AlertTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspContext context = getJspContext();
JspWriter tagWriter = context.getOut();
StringBuilder builder = new StringBuilder("");
List<String> messages = (ArrayList) context.findAttribute("pageMessages");
if (messages != null) {
for (String message : messages) {
builder.append(message);
builder.append("<br />");
}
}
tagWriter.println(builder.toString());
}
use of javax.servlet.jsp.JspWriter in project OpenClinica by OpenClinica.
the class TableTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspContext context = getJspContext();
JspWriter tagWriter = context.getOut();
boolean isViewData = datacontext != null && datacontext.equalsIgnoreCase(VIEW_DATA_ENTRY);
DisplaySectionBean dBean = (DisplaySectionBean) context.findAttribute("section");
StudyBean studyBean = (StudyBean) context.findAttribute("study");
// tabId is used to seed the tabindex attributes of the form's input
// elements,
// according to the section's tab number
int tabId;
// this is for viewDataEntryServlet
Object tabObject = context.findAttribute("tabId");
if (tabObject == null) {
// this is for DataEntryServlet
tabObject = context.findAttribute("tab");
}
if (tabObject == null) {
tabObject = new Integer("1");
}
tabId = new Integer(tabObject.toString());
if (dBean != null) {
HorizontalFormBuilder formBuilder = new HorizontalFormBuilder();
// FormBuilder sets tabindexSeed to 1 in its constructor
if (tabId > 1)
formBuilder.setTabindexSeed(tabId);
formBuilder.setDataEntry(isViewData);
formBuilder.setEventCRFbean(dBean.getEventCRF());
formBuilder.setDisplayItemGroups(dBean.getDisplayFormGroups());
formBuilder.setSectionBean(dBean.getSection());
if (studyBean != null) {
formBuilder.setStudyBean(studyBean);
}
tagWriter.println(formBuilder.createMarkup());
} else {
tagWriter.println("The section bean was not found<br />");
}
/*
* FormBuilderTest builder = new FormBuilderTest();
* tagWriter.println(builder.createTable());
*/
}
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);
}
Aggregations