Interface HttpServletRequest,HttpServletRequest req, req.setCharacterEncoding("GB2312");???

nirehs 2004-08-11 01:52:28
Interface HttpServletRequest,HttpServletRequest req, req.setCharacterEncoding("GB2312");
既然HttpServletRequest是一个接口 ,按接口的定义其中的方法一定没有方法体,也就是说setCharacterEncoding是没有实现的,如何还可以做req.setCharacterEncoding("GB2312");觉得Java的接口就是麻烦,
...全文
155 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuyang821225 2004-08-11
  • 打赏
  • 举报
回复
setCharacterEncoding
public void setCharacterEncoding(String env)
throws UnsupportedEncodingException
Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader().

Parameters:
env - a String containing the name of the chararacter encoding.
Throws:
UnsupportedEncodingException - if this is not a valid encoding
nirehs 2004-08-11
  • 打赏
  • 举报
回复
楼上想说什么呢,没太听明白
iversonxk 2004-08-11
  • 打赏
  • 举报
回复
你好好看看j2ee的文档吧
The servlet container creates an HttpServletRequest object and passes it as an argument to the servlet's service methods (doGet, doPost, etc).

minghuitian 2004-08-11
  • 打赏
  • 举报
回复
是吗 ?

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧