use of javax.servlet.jsp.JspWriter in project logging-log4j2 by apache.
the class DumpTagTest method setUp.
@Before
public void setUp() {
this.output = new ByteArrayOutputStream();
this.writer = new OutputStreamWriter(this.output, UTF8);
this.context = new MockPageContext() {
private final MockJspWriter jspWriter = new MockJspWriter(writer);
@Override
public JspWriter getOut() {
return this.jspWriter;
}
};
this.tag = new DumpTag();
this.tag.setPageContext(this.context);
}
use of javax.servlet.jsp.JspWriter in project sling by apache.
the class TestEncodeTag method init.
/**
* Initializes the fields for this test.
*/
@SuppressWarnings("serial")
@Before
public void init() {
log.info("init");
encodeTag = new EncodeTag();
sb = new StringBuilder();
final JspWriter w = new JspWriter(0, false) {
public void newLine() throws IOException {
throw new UnsupportedOperationException();
}
public void print(boolean paramBoolean) throws IOException {
sb.append(paramBoolean);
}
public void print(char paramChar) throws IOException {
sb.append(paramChar);
}
public void print(int paramInt) throws IOException {
sb.append(paramInt);
}
public void print(long paramLong) throws IOException {
sb.append(paramLong);
}
public void print(float paramFloat) throws IOException {
sb.append(paramFloat);
}
public void print(double paramDouble) throws IOException {
sb.append(paramDouble);
}
public void print(char[] paramArrayOfChar) throws IOException {
sb.append(paramArrayOfChar);
}
public void print(String paramString) throws IOException {
sb.append(paramString);
}
public void print(Object paramObject) throws IOException {
sb.append(paramObject);
}
public void println() throws IOException {
throw new UnsupportedOperationException();
}
public void println(boolean paramBoolean) throws IOException {
throw new UnsupportedOperationException();
}
public void println(char paramChar) throws IOException {
throw new UnsupportedOperationException();
}
public void println(int paramInt) throws IOException {
throw new UnsupportedOperationException();
}
public void println(long paramLong) throws IOException {
throw new UnsupportedOperationException();
}
public void println(float paramFloat) throws IOException {
throw new UnsupportedOperationException();
}
public void println(double paramDouble) throws IOException {
throw new UnsupportedOperationException();
}
public void println(char[] paramArrayOfChar) throws IOException {
throw new UnsupportedOperationException();
}
public void println(String paramString) throws IOException {
throw new UnsupportedOperationException();
}
public void println(Object paramObject) throws IOException {
throw new UnsupportedOperationException();
}
public void clear() throws IOException {
throw new UnsupportedOperationException();
}
public void clearBuffer() throws IOException {
throw new UnsupportedOperationException();
}
public void flush() throws IOException {
throw new UnsupportedOperationException();
}
public void close() throws IOException {
throw new UnsupportedOperationException();
}
public int getRemaining() {
throw new UnsupportedOperationException();
}
public void write(char[] cbuf, int off, int len) throws IOException {
sb.append(cbuf);
}
};
pageContext = new MockPageContext() {
public JspWriter getOut() {
return w;
}
};
encodeTag.setPageContext(pageContext);
log.info("init Complete");
}
use of javax.servlet.jsp.JspWriter in project SpringStepByStep by JavaProgrammerLB.
the class HighlightTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
StringWriter stringWriter = new StringWriter();
getJspBody().invoke(stringWriter);
String highlightedValue = doHighlight(stringWriter.toString());
out.print(highlightedValue);
}
use of javax.servlet.jsp.JspWriter in project SpringStepByStep by JavaProgrammerLB.
the class StatusLabelTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
String statusLabel = TodoListUtils.getStatusLabel(status);
out.print(statusLabel);
}
use of javax.servlet.jsp.JspWriter in project tomcat by apache.
the class EchoAttributesTag method doTag.
@Override
public void doTag() throws JspException, IOException {
JspWriter out = getJspContext().getOut();
for (int i = 0; i < keys.size(); i++) {
String key = keys.get(i);
Object value = values.get(i);
out.println("<li>" + key + " = " + value + "</li>");
}
}
Aggregations