jspÖжÁÈ¡propertiesÎļþ
jspÖжÁÈ¡propertiesÎļþ£¬²¢°ÑÖµÉèµ½js±äÁ¿ÖУº
web_stderr.propertiesÎļþÄÚÈÝ£º
common.username.error.null = UserName can not be null.
common.username.error.invalid = UserName is invalid.
common.password.error.null = Password can not bu null.
common.password.error.invalid = Password is invalid.
common.login.error.user = The user can not been stored or password is wrong.
common.request.parameter.error = Request parameter error.
common.function.title.null = The tilte of function or is null.
common.session.timeout = The session has already expired.Please login again.
1.´æ´¢propertiesÎļþÄÚÈݵÄjs±äÁ¿(common-checkmessage.jsp)£º
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" import="java.util.ResourceBundle"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<%ResourceBundle res = ResourceBundle.getBundle("web_stderr"); %>
<mce:script type="text/javascript"><!--
var check_message_username_null = '<%=res.getString("common.username.error.null")%>';
var check_message_username_invalid = '<%=res.getString("common.username.error.invalid")%>';
var check_message_password_null = '<%=res.getString("common.password.error.null")%>';
var check_message_password_invalid = '<%=res.getString("common.password.error.invalid")%>';
// --></mce:script>
</head>
<body>
</body>
</html>
´ËʱֻҪÔÚÆäËûjspÖаüº¬¸ÃjspÎļþ£¬¾Í¿ÉÒÔÔÚjspºÍjsÎļþÖÐʹÓÃÕâЩ±äÁ¿¡£
Ïà¹ØÎĵµ£º
response.setContentType( "application/pdf" ); // MIME type for pdf doc
response.setHeader("Content-Disposition","attachment;filename=output.pdf;");
Sets the Content-Type header. Content-Type identifies the MIME type of the response document and the character set encoding.
To se ......
JSP¿ª·¢ÈëÃÅ
¸ÅÊö£º
JSP(Java Server Pages)ÊÇÓÉSun Microsystems¹«Ë¾³«µ¼¡¢Ðí¶à¹«Ë¾²ÎÓëÒ»Æð½¨Á¢µÄÒ»ÖÖ¶¯Ì¬ÍøÒ³¼¼Êõ±ê×¼¡£JSP¼¼ÊõÓеãÀàËÆASP¼¼Êõ£¬ËüÊÇÔÚ´«Í³µÄÍøÒ³HTMLÎļþ(*.htm,*.html)ÖвåÈëJava³ÌÐò¶Î(Scriptlet)ºÍJSP ±ê¼Ç(tag)£¬´Ó¶øÐγÉJSPÎļþ(*.jsp)¡£ ÓÃJSP¿ª·¢µÄWebÓ¦ÓÃÊÇ¿çÆ½Ì¨µÄ£¬¼ÈÄÜÔÚLinuxÏÂÔ ......
ÔÚÒ»¸öÏîÄ¿Öзּ¶Ñ¡ÔñÐÐÕþÇø»®Ê±Óõ½AJAX½øÐÐÎÞˢм¶Áª£¬ÎÒÔÚÒ³ÃæÖбàÂëÓõÄÊÇUTF-8£¬×ÜÊDZ¨½Å±¾´íÎó£¬
ÎÒ°ÑÒ³Ãæ±àÂë»»³ÉGBKÓÖÊÇÕý³£µÄ£¬ºóÀ´ÔÚÍøÉÏËÑË÷ÁËһϣ¬ÔÚÒýÈëJSʱ¼ÓÈë±àÂë¾Í¿ÉÒÔÁË£¬ÈçÏ£º
<script language="Javascript" src="js/jquery.js" charset="gb2312"></script> ......
ÕªÒª£ºËäÈ»session»úÖÆÔÚwebÓ¦ÓóÌÐòÖб»²ÉÓÃÒѾºÜ³¤Ê±¼äÁË£¬µ«ÊÇÈÔÈ»ÓкܶàÈ˲»Çå³þsession»úÖÆµÄ±¾ÖÊ£¬ÒÔÖÁ²»ÄÜÕýÈ·µÄÓ¦ÓÃÕâÒ»¼¼Êõ¡£±¾ÎĽ«ÏêϸÌÖÂÛsessionµÄ¹¤×÷»úÖÆ²¢ÇÒ¶ÔÔÚJava web applicationÖÐÓ¦ÓÃsession»úÖÆÊ±³£¼ûµÄÎÊÌâ×÷³ö½â´ð¡£
Ŀ¼£º
Ò»¡¢ÊõÓïsession
¶þ¡¢HTTPÐÒéÓë״̬±£³Ö
Èý¡¢Àí½âcookie» ......
1£¬Ð½¨Ò»web¹¤³Ì£¬½«Êý¾Ý¿âÁ¬½Ó°üÌí¼ÓÈëlibÎļþ¼ÐÏ¡£
2£¬Ð½¨jspÒ³Ãæ£¬ÄÚÈÝÈçÏ£º
<%@ page language="java" import="java.util.*" import="java.sql.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+re ......