Java web????е??????????????????????
???????????? ???????[ 2012/3/12 10:10:10 ] ????????
?????????? Java web???????????????
????1??html???????
??????web????У??????????????http header: Content-type?????????????encoding?? ????????Content-Type: text/html; charset=UTF-8?? ???????UTF-8?????????????????html?????????????html???浽??????? ???????html????????meta????????????????????default?????????????????????????
????Meta???
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
????2??HttpRequest?????
????????????????????????????????????????????????????????????????????????filter?????request.setCharacterEncoding("UTF-8")?????????.??????????????????ISO-8859-1?????????????????????????????????????
????3??httpresponse?????
????httpresponse?п??????????????????????????????????response.setCharacterEncoding("UTF-8")??response.setContentType("text/html;charset=UTF-8")??????????????????????????response.setCharacterEncoding("UTF-8")?????response.setContentType("text/html;charset=UTF-8")?????????MIME?????????????????????????????????????????JSP??治????????????????JSP??????????????????????????????????????
????4??JSP???????
????????????????????????е??????????????????????Ч??????????????????е?????????????????
??????????????????1)??2)???????????????????????include??????JSP??????<%@includefile="BB.jsp"%>??<jsp:includepage="BB.jsp"/>????????????AA.jsp???????????includeBB.jsp?????BB.jsp?в????????????????????Ч????AA.jsp??BB.jsp?????AA.jsp???????????????б???
???????????ú????include?????????AA.jsp??BB.jsp?ж??????и?????????????
????1??<%@pagecontentType="text/html;charset=UTF-8"%>
????2??<%@pagepageEncoding="charset=UTF-8"%>
????3????web.xml?????????????
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
????5??web.xml??weblogic.xml?е?mime??????
??????web.xml?п??????mime????????????????????????????????????????????????3???????http response.setContentType??response.setCharacterEncoding?????????????磺
<mime-mapping>
<extension>html</extension>
<mime-type>text/html; charset=UTF-8</mime-type>
</mime-mapping>
??????weblogic.xml?п???????????mime????????????
<container-discriptor>
<default-mime-type>text/html; charset=UTF-8</default-mime-type>
</container-discriptor>
????????
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>UTF-8</java-charset-name>
</input-charset>
</charset-params>
????????????????????html?? http request?? http response ??jsp pages?к????????????????????????????????UTF-8???????????????????????mime mapping?????ú?????web.xml?????á?weblogic?е?????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11