資源簡介
基于JAVA EE的運用到servlet的簡單的網上商城代碼,是一個很簡單的原本。

代碼片段和文件信息
package?com.oreilly.struts.framework;
import?javax.servlet.http.*;
import?java.util.Locale;
import?org.apache.struts.action.Action;
import?org.apache.struts.action.RequestProcessor;
import?org.apache.struts.Globals;
/**
?*?A?customized?RequestProcessor?that?checks?the?user‘s?preferred?Locale
?*?from?the?request?each?time.?If?a?Locale?is?not?in?the?session?or
?*?the?one?in?the?session?doesn‘t?match?the?request?the?Locale?in?the
?*?request?is?set?to?the?session.
?*/
public?class?CustomRequestProcessor?extends?RequestProcessor?{
????protected?void?processLocale(HttpServletRequest?request
?????????????????????????????????HttpServletResponse?response)?{
??????//?Are?we?configured?to?select?the?Locale?automatically?
??????if?(!moduleConfig.getControllerConfig().getLocale())?{
????????return;
??????}
??????//?Get?the?Locale?(if?any)?that?is?stored?in?the?user‘s?session
??????HttpSession?session?=?request.getSession();
??????Locale?sessionLocale?=?(Locale)session.getAttribute(Globals.LOCALE_KEY);
??????//?Get?the?user‘s?preferred?Locale?from?the?request
??????Locale?requestLocale?=?request.getLocale();
??????//?If?was?never?a?Locale?in?the?session?or?it?has?changed?set?it
??????if?(sessionLocale?==?null?||??(sessionLocale?!=?requestLocale)?){
????????if?(log.isDebugEnabled())?{
??????????log.debug(“?Setting?user?locale?‘“?+?requestLocale?+?“‘“);
????????}
????????//?Set?the?new?Locale?into?the?user‘s?session
????????session.setAttribute(?Globals.LOCALE_KEY?requestLocale?);
??????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1568??2018-04-23?21:47??storefront\.classpath
?????文件????????386??2018-04-23?21:47??storefront\.project
?????文件?????????88??2018-04-23?21:48??storefront\.settings\org.eclipse.core.resources.prefs
?????文件???????3542??2018-04-23?21:50??storefront\build.xm
?????文件???????4018??2010-03-30?10:39??storefront\build.xm
?????文件???????4358??2010-03-30?10:39??storefront\build.xm
?????文件??????55553??2018-04-23?21:47??storefront\lib\caucho-jdbc-mysql-0.2.7.jar
?????文件?????117404??2018-04-23?21:47??storefront\lib\commons-beanutils.jar
?????文件?????195616??2018-04-23?21:47??storefront\lib\commons-collections.jar
?????文件??????81927??2018-04-23?21:47??storefront\lib\commons-dbcp.jar
?????文件?????100232??2018-04-23?21:47??storefront\lib\commons-digester.jar
?????文件??????14264??2018-04-23?21:47??storefront\lib\commons-fileupload.jar
?????文件?????175967??2018-04-23?21:47??storefront\lib\commons-lang.jar
?????文件??????31219??2018-04-23?21:47??storefront\lib\commons-logging.jar
?????文件?????????74??2018-04-23?21:47??storefront\lib\commons-logging.properties
?????文件??????37499??2018-04-23?21:47??storefront\lib\commons-pool.jar
?????文件??????30306??2018-04-23?21:47??storefront\lib\commons-resources.jar
?????文件??????20691??2018-04-23?21:47??storefront\lib\commons-services.jar
?????文件??????44391??2018-04-23?21:47??storefront\lib\commons-validator.jar
?????文件?????967576??2018-04-23?21:47??storefront\lib\hibernate-2.1.8.jar
?????文件??????65368??2018-04-23?21:47??storefront\lib\jakarta-oro.jar
?????文件???????6727??2018-04-23?21:47??storefront\lib\jdbc2_0-stdext.jar
?????文件??????72408??2018-04-23?21:47??storefront\lib\jsp-api.jar
?????文件?????158892??2018-04-23?21:47??storefront\lib\log4j.jar
?????文件?????422239??2018-04-23?21:47??storefront\lib\ojb-0.8.375.jar
?????文件??????81214??2018-04-23?21:47??storefront\lib\poolman.jar
?????文件???????1189??2018-04-23?21:47??storefront\lib\poolman.xm
?????文件???????2111??2018-04-23?21:47??storefront\lib\poolman.xm
?????文件??????93538??2018-04-23?21:47??storefront\lib\servlet-api.jar
?????文件?????488720??2018-04-23?21:47??storefront\lib\struts.jar
............此處省略836個文件信息
- 上一篇:java日記本
- 下一篇:Android項目源碼大學生畢設圖書管理系統
評論
共有 條評論