• 大小: 39.12MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-21
  • 语言: Java
  • 标签: Java  web  

资源简介

Java web开发的化妆品购物网站系统,内容齐全,代码可运行,有截图

资源截图

代码片段和文件信息

package com.backleoshop.servlet;

import java.io.IOException;
import java.lang.reflect.Method;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Back_baseServlet extends HttpServlet {

private static final long serialVersionUID = -4982176649519887957L;

protected static final String REDIRECT = “redirect:“;

@Override
protected void service(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
request.setCharacterEncoding(“UTF-8“);
String basePath = getServletContext().getContextPath();
String requestPath = request.getServletPath();
String methodName = requestPath.substring(requestPath.lastIndexOf(“/“) + 1);
methodName = methodName.substring(0methodName.length() - 3);

try {
Method method = this.getClass().getMethod(methodName HttpServletRequest.classHttpServletResponse.class);
String locPath = (String) method.invoke(this requestresponse);
if(locPath!=null){
if (locPath.startsWith(REDIRECT)) {
response.sendRedirect(basePath + locPath.substring(REDIRECT.length()));
} else if (locPath.equals(“noNavigate“)) {
System.out.println(“返回的地址为noNavigate时不进行跳转“);
} else {
getServletContext().getRequestDispatcher(locPath).forward(request
response);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}















 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-28 23:04  shop\
     目录           0  2018-06-28 23:03  shop\leoshop\
     文件        1264  2018-06-27 21:23  shop\leoshop\.classpath
     目录           0  2018-06-28 23:03  shop\leoshop\.externalToolBuilders\
     文件         548  2016-06-20 11:04  shop\leoshop\.externalToolBuilders\org.eclipse.wst.jsdt.core.javascriptValidator.launch
     目录           0  2016-06-28 21:05  shop\leoshop\.myeclipse\
     文件         294  2016-06-28 21:05  shop\leoshop\.mymetadata
     文件        1981  2016-06-20 11:04  shop\leoshop\.project
     目录           0  2018-06-28 23:03  shop\leoshop\.settings\
     文件         500  2016-06-14 14:31  shop\leoshop\.settings\.jsdtscope
     文件          74  2016-06-14 14:42  shop\leoshop\.settings\com.genuitec.eclipse.core.prefs
     文件          57  2016-06-14 14:41  shop\leoshop\.settings\com.genuitec.eclipse.j2eedt.core.prefs
     文件         247  2018-06-27 21:23  shop\leoshop\.settings\com.genuitec.eclipse.migration.prefs
     文件          97  2016-06-18 08:50  shop\leoshop\.settings\org.eclipse.core.resources.prefs
     文件         364  2016-06-14 14:31  shop\leoshop\.settings\org.eclipse.jdt.core.prefs
     文件         547  2018-06-27 21:23  shop\leoshop\.settings\org.eclipse.wst.common.component
     文件         361  2018-06-27 21:23  shop\leoshop\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-06-14 14:31  shop\leoshop\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-06-14 14:31  shop\leoshop\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件         412  2016-06-14 14:41  shop\leoshop\.settings\org.eclipse.wst.validation.prefs
     文件       18645  2018-06-28 14:09  shop\leoshop\leoshop.sql
     目录           0  2018-06-28 23:03  shop\leoshop\src\
     文件        3157  2018-06-27 21:21  shop\leoshop\src\c3p0-config.xml
     目录           0  2018-06-28 23:03  shop\leoshop\src\com\
     目录           0  2018-06-28 23:03  shop\leoshop\src\com\backleoshop\
     目录           0  2018-06-28 23:03  shop\leoshop\src\com\backleoshop\servlet\
     文件        1568  2016-06-27 21:07  shop\leoshop\src\com\backleoshop\servlet\Back_baseServlet.java
     文件       26828  2017-07-08 01:40  shop\leoshop\src\com\backleoshop\servlet\Back_LeoShopServlet.java
     目录           0  2018-06-28 23:03  shop\leoshop\src\com\leoshop\
     目录           0  2018-06-28 23:03  shop\leoshop\src\com\leoshop\annotation\
     文件         368  2016-06-27 21:07  shop\leoshop\src\com\leoshop\annotation\Transaction.java
............此处省略2099个文件信息

评论

共有 条评论