Java在线文档:http://tool.oschina.net/apidocs/apidoc?api=jdk-zh
******常用jar包:
javaJDK下载地址:http://jdk.java.net/archive/
java快速寻找jar包:http://www.mvnrepository.com/
maven包:https://maven.apache.org/download.cgi、安装步骤:https://blog.youkuaiyun.com/nicole_33/article/details/90739361
下载mysql 的jar包程序驱动包:http://www.mysql.com/downloads/connector/j
struts2jar包下载:http://struts.apache.org/download.cgi
jstl和el包下载地址:http://tomcat.apache.org/taglibs/ 、http://tomcat.apache.org/taglibs/standard/
jason包下载地址如右: https://sourceforge.net/projects/json-lib/files/、解释https://blog.youkuaiyun.com/Chance00/article/details/86481157
Spring需要下载的包:http://repo.spring.io/release/org/springframework/spring/、http://www-us.apache.org/dist//commons/logging/source/commons-logging-1.2-src.zip 解释https://blog.youkuaiyun.com/u013309870/article/details/72285902
Spring中使用DBCP:使用步骤https://blog.youkuaiyun.com/weixin_44117272/article/details/94716724、http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi、http://commons.apache.org/proper/commons-pool/download_pool.cgi
log4家:http://logging.apache.org/log4j/2.x/download.html
AOP需要的jar包:http://www.eclipse.org/aspectj/downloads.php#stable_release、https://www.eclipse.org/aspectj/
HIbenate需要的包:http://hibernate.org/orm/releases/、https://dev.mysql.com/downloads/connector/j/、解释https://blog.youkuaiyun.com/songdongwan/article/details/60871820
struts需要的包:http://struts.apache.org
mybatis包:https://github.com/mybatis/mybatis-3/releases eclipse中生成mybatis插件https://www.jianshu.com/p/38610774bd78、mybatis整合Spring包https://github.com/mybatis/spring/releases
c3po包:
dbUtils包:
beanUtils包:
DBCP: DBCP(DataBase connection pool),数据库连接池。是 apache 上的一个 java 连接池项目,也是 tomcat 使用的连接池组件。单独使用dbcp需要2个包:commons-dbcp.jar,commons-pool.jar由于建立数据库连接是一个非常耗时耗资源的行为,所以通过连接池预先同数据库建立一些连接,放在内存中,应用程序需要建立数据库连接时直接到连接池中申请一个就行,用完后再放回去。下载地址:http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi、http://commons.apache.org/proper/commons-pool/download_pool.cgi
********常用框架:
集成开发工具(IDE):Eclipse、MyEclipse、Spring Tool Suite(STS)、Intellij IDEA、NetBeans、JBuilder、JCreator
JAVA服务器:tomcat、jboss、websphere、weblogic、resin、jetty、apusic、apache
负载均衡:nginx、lvs
web层框架:Spring MVC、Struts2、Struts1、Google Web Toolkit(GWT)、JQWEB
服务层框架:Spring、EJB
持久层框架:Hibernate、MyBatis、JPA、TopLink
数据库:Oracle、MySql、MSSQL
项目构建:maven、ant
持续集成:Jenkins
版本控制:SVN、CVS、VSS、GIT
私服:Nexus
消息组件:IBM MQ、RabbitMQ、ActiveMQ
日志框架:Commons Logging、log4j 、slf4j、IOC
缓存框架:memcache、redis、ehcache、jboss cache
RPC框架:Hessian、Dubbo
规则引擎:Drools
工作流:Activiti
跑批:Spring Batch
通用查询框架:Query DSL
代码静态检查工具:FindBugs、PMD
Linux操作系统:SUSE Linux、CentOS
常用工具:PLSQL Developer(Oracle)、Navicat(MySql)、FileZilla(FTP)、Xshell(SSH)、putty(SSH)、SecureCRT(SSH)、jd-gui(反编译)
大数据框架:Hadoop \Storm\Spark 、第四代大数据处理框架FLink、CDH(Hadoop 的升级版)、Hadoop生态圈相关技术:Zookeeper、Hive、Hbase、Sqoop、Flume
电商框架:SpringMVC+Spring+MyBatis+Dubbox
社交:SpringMVC+SpringBoot+Spring+ Mybatis系统架构,Maven多模块架构
教育:SpringMVC+SpringBoot+Spring+SpringData微服务系统架构
旅游:SpringMVC+SpringBoot+Spring+ SpringDataJPA系统架构,
企业服务:后端架构:spring boot+Spring Data+SpringCloud+Apache Shiro前端架构:VueJS+element-UI+axios+webpack
租房:后端架构:SpringBoot+StringMVC+Dubbo+Mybatis前端架构:React.js+html5+百度地图+微信小程序
医疗:SpringMVC+Spring+MyBatis+Dubbo+Zookeeper+Spring Security+Apache POI+Echarts主流分布式架构
*****常用快捷键:
在eclipse中编写代码有许多的快捷方式,写主函数main的时候,可以先只写一个main然后按Alt+?出现一些函数的选择,现在可以不用先管,直接按Enter键,eclipse就帮我们完整的代码;先写syso,然后按Alt+?再按Enter就了,
菜单栏的Toggle Breadcrumb-------快速产看当前类的目录结构
command +F:查找当前类的内容
command +O : 查找工程中的内容
command +shift+O : 查找工程中的内容
alt+?或alt+/:自动补全代码或者提示代码
ctrl+o:快速outline视图
ctrl+shift+r:打开资源列表
ctrl+shift+f:格式化代码
ctrl+page down或ctrl+page up: 选项卡之间快速切换
shift+enter及ctrl+shift+enter: 在当前行上或者下边创建空白
Alt+方向键上下:上下行交换内容或把当前行内容把上或下移动
Control+Alt+方向上下键:复制高亮显示的一行或多行
ctrl+m:当前编辑页面窗口最大化
ctrl+d:删除当前行
ctrl+shift+x和ctrl+shift+y:英文字母大小写的转换
ctrl+shift+o:自动引入包和删除无用包
Jsp中的自动导包的快捷键是ALT+/)
******注释快捷键:
设置注释:eclipse->preference->general->keys->Addjavadoc Comment
文档注释alt + command+J;编辑文档注释模版:Window-->Preferences-->Java-->Code Style --> Code Templates --> Comments --> types --> Edit
普通的注释:command+/
****快速实现接口:alt+command+s(或者右键source)->override implements;
****快速生成set和get方法:alt+command+s(或者右键source)->General SettsAndGetts;
****eclipse中创建package / folder source / folder 的区别:https://blog.youkuaiyun.com/u011217058/article/details/67632122
****在终端中寻找被占用的端口,删除进程;
https://blog.youkuaiyun.com/qq_37486501/article/details/82670282
sudo lsof -i -n -P | grep 8080寻找
sudo kill -9 2008删除
*******可以查看工作空间,并设置是否每次提示加载;http://www.cnblogs.com/oucbl/p/6071140.html
主菜单 Window > Preferences > General > Startup and Shutdown
****终端中输入netstat -ano 找到所有占用端口号的程序
tomcat/conf/server.xml中可以修改端口号;
windows上的IIS服务默认占用80端口。
动态web资源的目录结构是固定的:(只要有serverlet和jsp就是动态的web资源),
WEB-INF =>web.xml(是程序的入口文件,配置文件是必须的);classes(可选);lib(可选);
服务器上的虚拟路径默认和项目名称一样(一般设置成一样的)。直接赋值的项目需要修改虚拟路径(新创建的项目不需要修改虚拟路径);
项目右键-》properties-》myeclipse-》web-》修改虚拟路径web context content。
tomcat/conf/tomact-user.xml中配置tomcat的管理员,需要重启服务器。
web程序的部署有三种方式:1.项目复制到webapps下面;2:配置虚拟路径:直接修改配置文件和自己编写一个配置文件(推荐使用)。
*******jar包的引用:
Eclipse中,工程属性的Java Build Path的Library标签页下,有如下几个按钮:
Add Jars ----添加Jar包,是指本Eclipse当前包含的工程中,在工程列表下选取即可
Add External Jars---添加外部的Jar,是指外部的,需要用文件管理器,在电脑硬盘上选取。
Add Variable---添加变量,Eclipse的编译时用到的环境变量
Add Library--添加库,是指一些已经定义好的jar的集合。
Add Class Floder--添加类的目录,是指本Eclipse范围中的,在工程列表下选取接口。
Add External Folder--添外部类的目录,需要用文件管理器,在电脑硬盘上选取。
Add jars和Add External Jars与Add Library中User Libraries的添加的JAR包,是否会被打入最终的可执行文件中,这取决于在Order And Export中是否点选。
一个工程,引用其他工程,可以在工程属性的java Build Path的Projects标签下Add,这种引用,并不会将被引用的工程中的源文件,打入到当前工程生成的可执行文件中,
如需打入,可以用Source标签下Link Source(Browse,,,,被引用工程的路径)完成。
JRE System Library、Referenced Libraries、Web App Libraries的区别:https://www.cnblogs.com/chenmingjun/p/9752792.html
1.Referenced Libraries是编译环境下使用的JAR包,
所谓编译环境下使用的JAR包, 就是你在Eclipse中进行源文件的编写的时候,所需要引用到的类都从Referenced Libraries这个集合中的JAR包中拿;在项目发布的时候 Referenced Libraries 下面的jar包不会被打包。
2./web-inf/lib中的JAR包是运行时环境下使用的JAR包,所谓运行时环境下使用的JAR包,就是说你在运行你的项目的时候所需要使用的JAR包的集合;
3.Web App Libraries: 关于web项目没有看到Web App Libraries,可以通过右键项目 --> built path --> Configure built path --> 点击libraries标签 --> 选择右边的 Add Library… 按钮 ,在弹出的窗口中选择 Web App Libraries 添加即可。
- Web App Libraries 的主要作用是让eclipse导出war包的时候,会把其目录下的所有jar或者项目中的工程引用都导出到WEB-INF/lib文件夹下。
- Web App Libraries中的jar包在eclipse中项目属性的Java EE Module Dependencies 配置的。如果你勾上了,或者添加了外部jar包,都会在WEB-INF/lib文件夹下生成。
- 当然,如果你直接在WEB-INF/lib文件夹下,copy一个jar进入,刷新一下,Web App Libraries 也会自动增加一个jar的引用。简单说,Java EE Module Dependencies的配置只针对Web App Libraries。
根目录下个src并列的libraries管理者所有的jar包。
**以 com.sun 开头的 jar 包是 JDK 的扩展包,com.sun.image.codec.jpeg.JPEGCodec 是用于图片 压缩的类。
*****服务器端重定向:
1.用setHeader()方法设置响应头,为刷新“refresh”,然后设置几秒后刷新的时间和url地址;response.setHeader("refresh", "3;url=xxx");3秒后重定向。
或者同时设置下面两句话:
response.setStatue(302);
response.setHeader("location","day01/default.html");//注意重定向的路径都是相对于客户端的
2.//立即重定向;重定向到list,是get请求
response.sendRedirect("list");
*************************************常用小功能*************************************************
***随机数:
String wods="abcdefghijklnopqrstuvwxyz1234567890";
Random random=new Random();
int index=random.nextInt(words.length());//获取随机数
char ch=words.charAt(index);//获取指定下标的字符
****日期格式设置:
User user = new User();
user.setName("zs");
user.setBirthday(new Date());
JsonConfig config = new JsonConfig();
config.registerJsonValueProcessor( Date.class, new DateProcessor());//DateProcessor类中是设置日期的格式
JSONObject obj = JSONObject.fromObject(user,config);
String str = obj.toString();
import java.util.Date;
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;
/**
* 提供转换规则
* 比如将日期转换成 "2011-12-7"这样的字符串 * @author teacher
*
*/
public class DateProcessor implements JsonValueProcessor{
private String pattern = "yyyy-MM-dd";
public void setPattern(String pattern) {
this.pattern = pattern;
}
public Object processArrayValue(Object arg0, JsonConfig arg1) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format((Date)arg0);
}
public Object processObjectValue(String arg0, Object arg1, JsonConfig arg2) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format((Date)arg1);
}
}