当前位置: 首页 > news >正文

做外贸的经常浏览的三个网站项目推广

做外贸的经常浏览的三个网站,项目推广,网站设计面试问题,手机网址怎么输入day65 web项目 页面设计 仿照小米官网&#xff0c;将首页保存到本地为一个html页面&#xff0c;再将html页面保存为jsp页面&#xff0c;在项目中的web.xml文件中配置了欢迎页 <welcome-file-list><welcome-file>TypesServlet</welcome-file> </welcome-…

day65

web项目

页面设计

仿照小米官网,将首页保存到本地为一个html页面,再将html页面保存为jsp页面,在项目中的web.xml文件中配置了欢迎页

<welcome-file-list><welcome-file>TypesServlet</welcome-file>
</welcome-file-list>
package com.saas.servlet;
​
import com.saas.entity.Types;
import com.saas.service.ITypesService;
import com.saas.service.impl.TypesServiceImpl;
​
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
​
@WebServlet("/TypesServlet")
public class TypesServlet extends HttpServlet {
​private ITypesService typesService = new TypesServiceImpl();
​@Overrideprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {List<Types> types = typesService.getAllTypes();
​req.setAttribute("types", types);
​req.getRequestDispatcher("types.jsp").forward(req, resp);}
}
package com.saas.service;
​
import com.saas.entity.Types;
​
import java.util.List;
​
public interface ITypesService {List<Types> getAllTypes();
}
package com.saas.service.impl;
​
import com.saas.dao.ITypesDao;
import com.saas.dao.impl.TypesDaoImpl;
import com.saas.entity.Types;
import com.saas.service.ITypesService;
​
import java.util.List;
​
public class TypesServiceImpl implements ITypesService {
​private ITypesDao typesDao = new TypesDaoImpl();
​@Overridepublic List<Types> getAllTypes() {return typesDao.getAllTypes();}
}
package com.saas.dao;
​
import com.saas.entity.Types;
​
import java.util.List;
​
public interface ITypesDao {List<Types> getAllTypes();
}
package com.saas.dao.impl;
​
import com.saas.dao.ITypesDao;
import com.saas.entity.Types;
import com.saas.util.DruidUtil;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
​
import java.sql.SQLException;
import java.util.List;
​
public class TypesDaoImpl implements ITypesDao {
​private QueryRunner qr = new QueryRunner(DruidUtil.getDataSource());
​
​@Overridepublic List<Types> getAllTypes() {try {return qr.query("select * from types", new BeanListHandler<Types>(Types.class));} catch (SQLException e) {throw new RuntimeException(e);}}
}
package com.saas.util;
​
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;
​
import javax.sql.DataSource;
​
public class DruidUtil {
​private static Env env = Env.getInstance();
​public static DataSource getDataSource(){try {DruidDataSource dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(env);
​dataSource.setUrl(env.getProperty("url"));dataSource.setUsername(env.getProperty("user"));dataSource.setPassword(env.getProperty("pass"));dataSource.setDriverClassName(env.getProperty("driver"));
​return dataSource;} catch (Exception e) {throw new RuntimeException(e);}}
}
package com.saas.util;
​
import java.io.IOException;
import java.util.Properties;
​
public class Env extends Properties {
​private static final long serialVersionUID = 1L;
​private static Env env = new Env();
​private Env() {super();try {load(getClass().getResourceAsStream("/db.properties"));} catch (IOException e) {throw new RuntimeException(e);}}
​public static Env getInstance() {return env;}
​public static String get(String key) {return env.getProperty(key);}
}
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/mi?characterEncoding=utf-8
user=root
pass=Abc@1234
页面代码

将页面展示出来

http://www.hengruixuexiao.com/news/46297.html

相关文章:

  • 婚恋网站 没法做网站维护主要做什么
  • 常见的网站开发工具重庆森林台词
  • 自己做的网站如何上传文件百度学术查重
  • 网站开发公司怎么能接到单子网站换友链平台
  • 漫画门户网站怎么做的品牌运营管理有限公司
  • 个人如何网站备案指数平滑法
  • 知名草根博客 卢松松网站被攻击公众号软文是什么意思
  • 晚上一个人睡不着偷偷看b站谷歌搜索引擎为什么打不开
  • 设计师网站欣赏昆明seo优化
  • 旅游网站建设 策划书上海网站建设关键词排名
  • 静态网站开发技术和动态网站开发技术的区别软文营销案例200字
  • 国外网站 dns百度的seo关键词优化怎么弄
  • 淄博企业网站建设哪家专业网络推广员具体做什么的
  • 网站建设公司选择标准百度权重10的网站
  • 互联网保险的特点有哪些网站如何优化
  • 网站在线建站阿里云官网首页
  • 邢台网站推广费用微信推广平台自己可以做
  • wordpress chess简述seo和sem的区别与联系
  • 便利的网站建设公司网文推广怎么做
  • 如何做企业推广seo网站优化服务商
  • 做网站要付哪些钱欧美seo查询
  • 人民政府门户网站首页自媒体引流推广
  • 做微商想做个网站软文代发
  • 网站怎么做舆情监测搜什么关键词比较刺激
  • 网站做字工具营销方案怎么写
  • 租空间开网站哈尔滨最新今日头条新闻
  • ubuntu怎么打开wordpress武汉seo公司
  • 网站建设的英语做优化的网站
  • 东莞互联网大公司有哪些免费网站seo排名优化
  • 市住房城乡建设管理委官方网站收录