org.glassfish.grizzly.http.server.Request.appendRequestURL()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.glassfish.grizzly.http.server.Request.appendRequestURL方法的一些代码示例,展示了Request.appendRequestURL的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.appendRequestURL方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Request
类名称:Request
方法名:appendRequestURL

Request.appendRequestURL介绍

[英]Appends the reconstructed URL the client used to make the request. The appended URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

Because this method returns a StringBuffer, not a String, you can modify the URL easily, for example, to append query parameters.

This method is useful for creating redirect messages and for reporting errors.
[中]追加客户端用于发出请求的重建URL。附加的URL包含协议、服务器名称、端口号和服务器路径,但不包括查询字符串参数。
由于此方法返回的是StringBuffer,而不是String,因此您可以轻松地修改URL,例如,添加查询参数。
此方法对于创建重定向消息和报告错误非常有用。

代码示例

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public StringBuffer getRequestURL() {
  6. if (request == null) {
  7. throw new IllegalStateException("Null request object");
  8. }
  9. return Request.appendRequestURL(request, new StringBuffer());
  10. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

  1. /**
  2. * Reconstructs the URL the client used to make the request.
  3. * The returned URL contains a protocol, server name, port
  4. * number, and server path, but it does not include query
  5. * string parameters.
  6. * <p>
  7. * Because this method returns a <code>StringBuilder</code>,
  8. * not a <code>String</code>, you can modify the URL easily,
  9. * for example, to append query parameters.
  10. * <p>
  11. * This method is useful for creating redirect messages and
  12. * for reporting errors.
  13. *
  14. * @return A <code>StringBuffer</code> object containing the
  15. * reconstructed URL
  16. */
  17. public StringBuilder getRequestURL() {
  18. final StringBuilder url = new StringBuilder();
  19. return appendRequestURL(this, url);
  20. }

相关文章

Request类方法