📄 shopservlet.java
字号:
package com.publish.shop.util.servlets;import java.io.IOException;import javax.servlet.ServletException;import org.apache.struts.action.ActionServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.util.Locale;import com.publish.shop.util.javabeans.Debug;import com.publish.shop.util.javabeans.Utility;import com.publish.shop.util.javabeans.Constants;//import com.publish.shop.util.javabeans.ResourceLocator;public class ShopServlet extends ActionServlet { public void init() throws ServletException { super.init(); try { String lsResourcePath = this.getInitParameter("application"); Utility.setResourcePath(lsResourcePath); String lsDebug = this.getInitParameter("Debug"); if (lsDebug.equals("true")) Debug.setDebugFlag(true); else Debug.setDebugFlag(false); String dataSourceName = this.getInitParameter("DataSource");// ResourceLocator.setDataSourceJndiName(dataSourceName); String PageLength = this.getInitParameter("PageLength"); Constants.setPage_Length(Integer.parseInt(PageLength)); } catch(Exception e) { e.printStackTrace(); Debug.println(e.toString()); } } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { request.setCharacterEncoding("GB2312"); Locale lLocale = Locale.SIMPLIFIED_CHINESE; response.setLocale(lLocale); super.doGet(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { request.setCharacterEncoding("GB2312"); Locale lLocale = Locale.SIMPLIFIED_CHINESE; response.setLocale(lLocale); super.doPost(request, response); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -