Java源码示例:io.undertow.attribute.ReadOnlyAttributeException
示例1
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
ServletRequest req = context.getServletRequest();
if (req instanceof HttpServletRequest) {
HttpSession session = ((HttpServletRequest) req).getSession(false);
if (session != null) {
session.setAttribute(attributeName, newValue);
}
}
}
}
示例2
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
context.getCurrentServletContext().setAttribute(attributeName, newValue);
}
}
示例3
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
context.getServletRequest().setAttribute(attributeName, newValue);
} else {
Map<String, String> attrs = exchange.getAttachment(HttpServerExchange.REQUEST_ATTRIBUTES);
if(attrs == null) {
exchange.putAttachment(HttpServerExchange.REQUEST_ATTRIBUTES, attrs = new HashMap<>());
}
attrs.put(attributeName, newValue);
}
}
示例4
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
ServletRequest req = context.getServletRequest();
if (req instanceof HttpServletRequest) {
HttpSession session = ((HttpServletRequest) req).getSession(false);
if (session != null) {
session.setAttribute(attributeName, newValue);
}
}
}
}
示例5
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
context.getCurrentServletContext().setAttribute(attributeName, newValue);
}
}
示例6
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
if (context != null) {
context.getServletRequest().setAttribute(attributeName, newValue);
} else {
Map<String, String> attrs = exchange.getAttachment(HttpServerExchange.REQUEST_ATTRIBUTES);
if(attrs == null) {
exchange.putAttachment(HttpServerExchange.REQUEST_ATTRIBUTES, attrs = new HashMap<>());
}
attrs.put(attributeName, newValue);
}
}
示例7
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Request Character Encoding", newValue);
}
示例8
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Request line", newValue);
}
示例9
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Session ID", newValue);
}
示例10
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
RelativePathAttribute.INSTANCE.writeAttribute(exchange, newValue);
}
示例11
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
RequestURLAttribute.INSTANCE.writeAttribute(exchange, newValue);
}
示例12
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Locale", newValue);
}
示例13
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException();
}
示例14
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Session ID", newValue);
}
示例15
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Requested session ID from cookie", newValue);
}
示例16
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Requested session ID from cookie", newValue);
}
示例17
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException(NAME, newValue);
}
示例18
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Request Character Encoding", newValue);
}
示例19
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Request line", newValue);
}
示例20
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Session ID", newValue);
}
示例21
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
RelativePathAttribute.INSTANCE.writeAttribute(exchange, newValue);
}
示例22
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
RequestURLAttribute.INSTANCE.writeAttribute(exchange, newValue);
}
示例23
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Locale", newValue);
}
示例24
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException();
}
示例25
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Session ID", newValue);
}
示例26
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Requested session ID from cookie", newValue);
}
示例27
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException("Requested session ID from cookie", newValue);
}
示例28
@Override
public void writeAttribute(final HttpServerExchange exchange, final String newValue) throws ReadOnlyAttributeException {
throw new ReadOnlyAttributeException(NAME, newValue);
}
示例29
@Override
public void writeAttribute(HttpServerExchange exchange, String newValue)
throws ReadOnlyAttributeException
{
throw new ReadOnlyAttributeException();
}