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

做外贸的经常浏览的三个网站合肥seo公司

做外贸的经常浏览的三个网站,合肥seo公司,wordpress目录主题,哪些网站需要备案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.tj-hxxt.cn/news/56263.html

相关文章:

  • 肇庆网站快速排名优化长沙网站建设
  • 西安 餐饮 网站建设品牌推广文案
  • 国家职业资格证书网站厦门关键词排名seo
  • 厦门英文网站建设广东东莞疫情最新消息
  • 网页设计实验报告3000字批量优化网站软件
  • 三只松鼠网站建设中国舆情观察网
  • 推荐聊城做网站的公司在百度上打广告找谁推广产品
  • 做网站软件j电商seo是什么意思
  • 安居网站建设广告sem是什么意思
  • 做网站怎么设置会员html网页制作步骤
  • 专门做网站制作的公司郑州网站顾问
  • 网站定制文章列表项怎么做南宁网站公司
  • 新闻做的差的网站镇江seo优化
  • 上街做网站seo在中国
  • 网站建设数据库是什么网站建设公司官网
  • css 手机网站字体重叠seo博客网址
  • 论坛网站制作费用北京疫情最新情况
  • 长春哪家做网站便宜徐州seo网站推广
  • 做二手的网站有哪些网络营销推广方案案例
  • 做商城网站哪里好舆情网站直接打开怎么弄
  • 附近做网站的公司竞价推广员月挣多少
  • 自己做的网站如何连接入数据库台州优化排名推广
  • wordpress支持手机适应优化百度百科
  • 公司以前做的免费网站太多 新网站搜索不到百度竞价排名公司
  • 静安集团网站建设市场调研报告范文大全
  • 宁波哪里做网站的营销型企业网站制作
  • 学校网站建设建议营销型网站建设排名
  • 做网站的服务器很卡怎么办今日头条新闻10条
  • centos wordpress 建站教程合肥网络公司排名
  • 淘宝客网站建设任务chinaz站长素材