org.apache.coyote.Request.setCharacterEncoding()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(249)

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

Request.setCharacterEncoding介绍

暂无

代码示例

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

  1. /* */ public void setCharacterEncoding(String enc)
  2. /* */ throws UnsupportedEncodingException
  3. /* */ {
  4. /* 1472 */ if (this.usingReader) {
  5. /* 1473 */ return;
  6. /* */ }
  7. /* */
  8. /* 1476 */ byte[] buffer = new byte[1];
  9. /* 1477 */ buffer[0] = 97;
  10. /* 1478 */ String dummy = new String(buffer, enc);
  11. /* */
  12. /* 1481 */ this.coyoteRequest.setCharacterEncoding(enc);
  13. /* */ }
  14. /* */

代码示例来源:origin: tomcat/catalina

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. public void setCharacterEncoding(String enc)
  14. throws UnsupportedEncodingException {
  15. // Ensure that the specified encoding is valid
  16. byte buffer[] = new byte[1];
  17. buffer[0] = (byte) 'a';
  18. String dummy = new String(buffer, enc);
  19. // Save the validated encoding
  20. coyoteRequest.setCharacterEncoding(enc);
  21. }

代码示例来源:origin: jboss.web/jbossweb

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. public void setCharacterEncoding(String enc)
  14. throws UnsupportedEncodingException {
  15. if (usingReader)
  16. return;
  17. // Ensure that the specified encoding is valid
  18. byte buffer[] = new byte[1];
  19. buffer[0] = (byte) 'a';
  20. String dummy = new String(buffer, enc);
  21. // Save the validated encoding
  22. coyoteRequest.setCharacterEncoding(enc);
  23. }

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader)
  17. return;
  18. // Ensure that the specified encoding is valid
  19. byte buffer[] = new byte[1];
  20. buffer[0] = (byte) 'a';
  21. new String(buffer, enc);
  22. // Save the validated encoding
  23. coyoteRequest.setCharacterEncoding(enc);
  24. }

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader)
  17. return;
  18. // Ensure that the specified encoding is valid
  19. byte buffer[] = new byte[1];
  20. buffer[0] = (byte) 'a';
  21. new String(buffer, enc);
  22. // Save the validated encoding
  23. coyoteRequest.setCharacterEncoding(enc);
  24. }

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader)
  17. return;
  18. // Ensure that the specified encoding is valid
  19. byte buffer[] = new byte[1];
  20. buffer[0] = (byte) 'a';
  21. new String(buffer, enc);
  22. // Save the validated encoding
  23. coyoteRequest.setCharacterEncoding(enc);
  24. }

代码示例来源:origin: org.jboss.web/jbossweb

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. public void setCharacterEncoding(String enc)
  14. throws UnsupportedEncodingException {
  15. if (usingReader)
  16. return;
  17. // Ensure that the specified encoding is valid
  18. EncodingToCharset.toCharset(enc);
  19. // Save the validated encoding
  20. coyoteRequest.setCharacterEncoding(enc);
  21. }

代码示例来源:origin: codefollower/Tomcat-Research

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader) {
  17. return;
  18. }
  19. // Ensure that the specified encoding is valid
  20. byte buffer[] = new byte[1];
  21. buffer[0] = (byte) 'a';
  22. // Confirm that the encoding name is valid
  23. B2CConverter.getCharset(enc);
  24. // Save the validated encoding
  25. coyoteRequest.setCharacterEncoding(enc);
  26. }

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader) {
  17. return;
  18. }
  19. // Ensure that the specified encoding is valid
  20. byte buffer[] = new byte[1];
  21. buffer[0] = (byte) 'a';
  22. // Confirm that the encoding name is valid
  23. B2CConverter.getCharset(enc);
  24. // Save the validated encoding
  25. coyoteRequest.setCharacterEncoding(enc);
  26. }

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

  1. /**
  2. * Overrides the name of the character encoding used in the body of
  3. * this request. This method must be called prior to reading request
  4. * parameters or reading input using <code>getReader()</code>.
  5. *
  6. * @param enc The character encoding to be used
  7. *
  8. * @exception UnsupportedEncodingException if the specified encoding
  9. * is not supported
  10. *
  11. * @since Servlet 2.3
  12. */
  13. @Override
  14. public void setCharacterEncoding(String enc)
  15. throws UnsupportedEncodingException {
  16. if (usingReader) {
  17. return;
  18. }
  19. // Ensure that the specified encoding is valid
  20. byte buffer[] = new byte[1];
  21. buffer[0] = (byte) 'a';
  22. // Confirm that the encoding name is valid
  23. B2CConverter.getCharset(enc);
  24. // Save the validated encoding
  25. coyoteRequest.setCharacterEncoding(enc);
  26. }

相关文章

Request类方法