主布局


package com.example.dell.day1215; import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle; import com.example.dell.day1215.adapter.MyAdapter; public class MainActivity extends AppCompatActivity { private ViewPager viewPager;
private TabLayout tab;
private MyAdapter adapter; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initData(); } private void initData() {
//添加适配器
adapter = new MyAdapter(getSupportFragmentManager());
viewPager.setAdapter(adapter);
tab.setupWithViewPager(viewPager);
} private void initView() {
//寻找资源id
viewPager = findViewById(R.id.viewpager);
tab = findViewById(R.id.tab);
}
}

适配器

开始适配器


package com.example.dell.day1215.adapter; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import com.example.dell.day1215.fragment.AFragment;
import com.example.dell.day1215.fragment.BFragment; public class MyAdapter extends FragmentPagerAdapter {
private String[] menues=new String[]{
"电影","资讯","视频","我的"
};
public MyAdapter(FragmentManager fm) {
super(fm);
} @Nullable
@Override
public CharSequence getPageTitle(int position) {
return menues[position];
} @Override
public Fragment getItem(int i) {
switch (i){
case 0:
return new AFragment();
case 1:
return new BFragment();
case 2:
return new BFragment();
default:
return new BFragment();
} } @Override
public int getCount() {
return menues.length;
}
}

子适配器


package com.example.dell.day1215.adapter; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter; import com.example.dell.day1215.fragment.aAFragment;
import com.example.dell.day1215.fragment.aBFragment; public class aMyAdapter extends FragmentPagerAdapter {
//定义集合
private String[] menu=new String[]{
"正在上映","即将上映"
};
public aMyAdapter(FragmentManager fm) {
super(fm);
} @Nullable
@Override
public CharSequence getPageTitle(int position) {
return menu[position];
} @Override
public Fragment getItem(int i) {
switch (i){
case 0:
return new aAFragment();
case 1:
return new aBFragment();
}
return null;
} @Override
public int getCount() {
return menu.length;
}
}

list加载适配器


package com.example.dell.day1215.adapter; import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView; import com.example.dell.day1215.Bean.MovieBean;
import com.example.dell.day1215.R;
import com.nostra13.universalimageloader.core.ImageLoader; import java.util.ArrayList;
import java.util.List; public class LISTVIEWBaseAdapter extends BaseAdapter {
private Context context;
private List<MovieBean.ResultBean> list; public LISTVIEWBaseAdapter(Context context) {
this.context = context;
list=new ArrayList<>();
}
//更新数据
public void setList(List<MovieBean.ResultBean> list1) {
list.clear();
if (list1!=null){
this.list = list1;
}
notifyDataSetChanged();
}
//追加数据
public void addData(List<MovieBean.ResultBean> d){
if (d!=null){
list.addAll(d);
}
notifyDataSetChanged();
}
@Override
public int getCount() {
return list.size();
} @Override
public Object getItem(int position) {
return list.get(position);
} @Override
public long getItemId(int position) {
return position;
} @Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView==null){
holder = new ViewHolder();
convertView=LayoutInflater.from(context).inflate(R.layout.list,parent,false);
holder.img=convertView.findViewById(R.id.img);
holder.text=convertView.findViewById(R.id.text);
convertView.setTag(holder);
}else{
holder = (ViewHolder) convertView.getTag();
}
holder.text.setText(list.get(position).getName());
ImageLoader.getInstance().displayImage(list.get(position).getImageUrl(),holder.img);
return convertView;
}
class ViewHolder{
ImageView img;
TextView text;
}
}

list2适配器


package com.example.dell.day1215.adapter; import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView; import com.example.dell.day1215.Bean.MovieBean;
import com.example.dell.day1215.R;
import com.nostra13.universalimageloader.core.ImageLoader; import java.util.ArrayList;
import java.util.List; public class LISTVIEWBaseAdapter2 extends BaseAdapter { private Context context;
private List<MovieBean.ResultBean> blist; public LISTVIEWBaseAdapter2(Context context) {
this.context = context;
blist=new ArrayList<>();
} public void setBlist(List<MovieBean.ResultBean> blist1) {
blist.clear();
if (blist1!=null){
this.blist = blist;
}
notifyDataSetChanged();
}
public void addDatab(List<MovieBean.ResultBean> n){
if (n!=null){
blist.addAll(n);
}
notifyDataSetChanged();
}
@Override
public int getCount() {
return blist.size();
} @Override
public Object getItem(int position) {
return blist.get(position);
} @Override
public long getItemId(int position) {
return position;
} @Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder2 holder;
if (convertView==null){
holder = new LISTVIEWBaseAdapter2.ViewHolder2();
convertView=LayoutInflater.from(context).inflate(R.layout.list,parent,false);
holder.img=convertView.findViewById(R.id.img);
holder.text=convertView.findViewById(R.id.text);
convertView.setTag(holder);
}else{
holder = (LISTVIEWBaseAdapter2.ViewHolder2) convertView.getTag();
}
holder.text.setText(blist.get(position).getName());
ImageLoader.getInstance().displayImage(blist.get(position).getImageUrl(),holder.img);
return convertView;
}
class ViewHolder2{
ImageView img;
TextView text;
}
}

Bean类


package com.example.dell.day1215.Bean; import java.util.List; public class MovieBean {
private String message;
private String status;
private List<ResultBean> result; public String getMessage() {
return message;
} public void setMessage(String message) {
this.message = message;
} public String getStatus() {
return status;
} public void setStatus(String status) {
this.status = status;
} public List<ResultBean> getResult() {
return result;
} public void setResult(List<ResultBean> result) {
this.result = result;
} public static class ResultBean { private boolean followMovie;
private int id;
private String imageUrl;
private String name;
private int rank;
private String summary; public boolean isFollowMovie() {
return followMovie;
} public void setFollowMovie(boolean followMovie) {
this.followMovie = followMovie;
} public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} public String getImageUrl() {
return imageUrl;
} public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
} public String getName() {
return name;
} public void setName(String name) {
this.name = name;
} public int getRank() {
return rank;
} public void setRank(int rank) {
this.rank = rank;
} public String getSummary() {
return summary;
} public void setSummary(String summary) {
this.summary = summary;
}
}
}

fragment


package com.example.dell.day1215.fragment; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup; import com.example.dell.day1215.R;
import com.example.dell.day1215.adapter.aMyAdapter; public class AFragment extends Fragment { private TabLayout atab;
private ViewPager aviewpager; @Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment1, container, false);
return view;
} @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
atab = view.findViewById(R.id.atab);
aviewpager = view.findViewById(R.id.aviewpager);
//设置适配器
aMyAdapter adapter = new aMyAdapter(getChildFragmentManager());
aviewpager.setAdapter(adapter);
atab.setupWithViewPager(aviewpager);
}
}

fragment1


package com.example.dell.day1215.fragment; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup; import com.example.dell.day1215.R; public class BFragment extends Fragment {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment2, container, false);
return view;
}
}

子fragment


package com.example.dell.day1215.fragment; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.Toast; import com.example.dell.day1215.Bean.MovieBean;
import com.example.dell.day1215.R;
import com.example.dell.day1215.adapter.LISTVIEWBaseAdapter;
import com.example.dell.day1215.util.NewUtil;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView; public class aAFragment extends Fragment { private PullToRefreshListView pull;
private LISTVIEWBaseAdapter adapter;
private String uri="http://172.17.8.100/movieApi/movie/v1/findHotMovieList?count=10&page=";
private int page=1;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.afragment1, container, false);
return view;
} @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
pull = view.findViewById(R.id.pull);
//添加适配器
adapter = new LISTVIEWBaseAdapter(getContext());
pull.setAdapter(adapter); pull.setMode(PullToRefreshBase.Mode.BOTH);
pull.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
@Override
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) { //下载
page=1;
//初始化数据
initData();
} @Override
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) { //刷新
initData();
page++;
}
});
initData();
} private void initData() {
NewUtil.requestData(uri + page, MovieBean.class, new NewUtil.CallBack<MovieBean>() { @Override
public void onsuccess(MovieBean nowBean) {
if (nowBean.getResult().size()==0){
pull.onRefreshComplete();
Toast.makeText(getActivity(),"没有数据",Toast.LENGTH_SHORT).show();
}
if (page==1){ //更新
adapter.setList(nowBean.getResult());
}else{ //追加
adapter.addData(nowBean.getResult());
}
page++;
pull.onRefreshComplete();
} });
}
}

子2布局


package com.example.dell.day1215.fragment; import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.Toast; import com.example.dell.day1215.Bean.MovieBean;
import com.example.dell.day1215.R;
import com.example.dell.day1215.adapter.LISTVIEWBaseAdapter2;
import com.example.dell.day1215.util.NewUtil;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView; public class aBFragment extends Fragment {
private PullToRefreshListView pull;
private String uri="http://172.17.8.100/movieApi/movie/v1/findHotMovieList?count=10&page=";
private int page=1;
private LISTVIEWBaseAdapter2 adapter2; @Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.afragment1, container, false);
return view;
} @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
pull = view.findViewById(R.id.pull);
//添加适配器
adapter2 = new LISTVIEWBaseAdapter2(getContext());
pull.setAdapter(adapter2); pull.setMode(PullToRefreshBase.Mode.BOTH);
pull.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
@Override
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) { //下载
page=1;
//初始化数据
initData();
} @Override
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) { //刷新
initData();
page++;
}
});
initData();
} private void initData() {
NewUtil.requestData(uri + page, MovieBean.class, new NewUtil.CallBack<MovieBean>() { @Override
public void onsuccess(MovieBean downBean) {
if (downBean.getResult().size()==0){
pull.onRefreshComplete();
Toast.makeText(getActivity(),"没有数据",Toast.LENGTH_SHORT).show();
}
if (page==1){ //更新
adapter2.setBlist(downBean.getResult());
}else{ //追加
adapter2.addDatab(downBean.getResult());
}
page++;
pull.onRefreshComplete();
} });
}
}

sqi类


package com.example.dell.day1215.sqilite; import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper; public class SQLiteHelper extends SQLiteOpenHelper { public SQLiteHelper(Context context) {
super(context,"User.db", null, 1);
} @Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table data(id integer primary key autoincrement," +
"title text," +
"summary text," +
"image_url text)");
} @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { }
}

util


package com.example.dell.day1215.util; import android.annotation.SuppressLint;
import android.os.AsyncTask; import com.google.gson.Gson; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection; import static android.icu.lang.UCharacter.GraphemeClusterBreak.T; public class NewUtil {
public interface CallBack<T>{
void onsuccess(T t);
}
@SuppressLint("StaticFieldLeak")
public static void requestData(String e, final Class calzz, final CallBack callBack){
new AsyncTask<String,Void,Object>(){ @Override
protected Object doInBackground(String... strings) {
return requestData(strings[0],calzz);
} @Override
protected void onPostExecute(Object o) {
callBack.onsuccess(o);
}
}.execute(e);
} private static <T> T requestData(String string, Class calzz) {
return(T) new Gson().fromJson(requestData(string),calzz);
} private static String requestData(String string) {
try {
URL url = new URL(string);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setConnectTimeout(5000);
urlConnection.setReadTimeout(5000);
int responseCode = urlConnection.getResponseCode();
if (responseCode==200){
String result=stream2String(urlConnection.getInputStream());
return result;
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
} private static String stream2String(InputStream inputStream) throws IOException {
StringBuilder stringBuilder = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
for (String tmp=br.readLine();tmp!=null;tmp=br.readLine()){
stringBuilder.append(tmp);
}
return stringBuilder.toString();
}
}

APP设置图片


package com.example.dell.day1215; import android.app.Application;
import android.graphics.Bitmap; import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; public class App extends Application {
@Override
public void onCreate() {
super.onCreate(); ImageLoaderConfiguration loaderConfiguration = new ImageLoaderConfiguration.Builder(this)
.memoryCacheSize(10)
.diskCacheSize(10 * 1024 * 1024)
.defaultDisplayImageOptions(new DisplayImageOptions.Builder()
.bitmapConfig(Bitmap.Config.RGB_565)
.showImageOnLoading(R.mipmap.ic_launcher)
.showImageOnFail(R.mipmap.ic_launcher)
.showImageForEmptyUri(R.mipmap.ic_launcher)
.cacheOnDisk(true)
.cacheInMemory(true)
.build()
).build();
ImageLoader.getInstance().init(loaderConfiguration);
}
}

抽取类


package com.example.dell.day1215; import android.content.Context;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.AttributeSet;
import android.view.View; public abstract class BaseActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initData();
initView();
}
protected abstract void initView();
protected abstract void initData();
}

布局viewPager+Fragment+侧拉


<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_weight="1"
android:background="#ff00"
android:layout_width="match_parent"
android:layout_height="700dp">
</android.support.v4.view.ViewPager>
<android.support.design.widget.TabLayout
android:id="@+id/tab"
app:tabMode="fixed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff99"
></android.support.design.widget.TabLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/cela"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="start"
android:background="#f0f0">
<ImageView
android:layout_width="match_parent"
android:layout_height="150dp"
android:src="@mipmap/ic_launcher"
/>
<LinearLayout
android:layout_gravity="center"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/text01"
android:layout_weight="1"
android:textSize="30dp"
android:text="设置头像"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/text02"
android:layout_weight="1"
android:textSize="30dp"
android:text="放大电路"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/text03"
android:layout_weight="1"
android:textSize="30dp"
android:text="公开规范"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>

TabLayout+ViewPager


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.design.widget.TabLayout
android:id="@+id/atab"
app:tabMode="fixed"
android:background="#0f0"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="@+id/aviewpager"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#f679"
></android.support.v4.view.ViewPager>
</LinearLayout>

来源:https://blog.csdn.net/jiaxiaofei622/article/details/85013037

推荐条+fragment的更多相关文章

  1. 【转】【Android UI设计与开发】第07期:底部菜单栏(二)Fragment的详细介绍和使用方法

    原始地址:http://blog.csdn.net/yangyu20121224/article/category/1431917/1 由于TabActivity在Android4.0以后已经被完全弃 ...

  2. 对于Fragment的一些理解

    前言 Fragment想必大家不陌生吧,在日常开发中,对于Fragment的使用也很频繁,现在主流的APP中,基本的架构也都是一个主页,然后每个Tab项用Fragment做布局,不同选项做切换,使用起 ...

  3. Android开发 ---Fragment片段布局

    前言 Fragment想必大家不陌生吧,在日常开发中,对于Fragment的使用也很频繁,现在主流的APP中,基本的架构也都是一个主页,然后每个Tab项用Fragment做布局,不同选项做切换,使用起 ...

  4. <Android 基础(三 十)> Fragment (3) ~ PreferenceFragment

    简介 PreferenceFragment , 展示一系列的Preference条目并且当与用户有交互时,产生的值会自动保存到SharedPreferences中,通过PreferenceManage ...

  5. Fragment 底部菜单栏

    实例讲解一 实例效果图: 点击wifi“按钮”显示的界面: 项目结构 具体代码编写 1.左边页面布局界面,frag_list.xml: <?xml version="1.0" ...

  6. Android应用经典主界面框架之中的一个:仿QQ (使用Fragment, 附源代码)

    备注:代码已传至https://github.com/yanzi1225627/FragmentProject_QQ 欢迎fork,如今来审视这份代码,非常多地方写的不太好,欢迎大家指正.有时间我会继 ...

  7. Android开发笔记(10)——使用Fragment传递

    转载请注明:http://www.cnblogs.com/igoslly/p/6911165.html 由于最近废寝忘食地在开发App,没来得及及时做总结,没有用很高级的部件,勉强也使用一些功能完成了 ...

  8. fragment基础 fragment生命周期 兼容低版本

    fragment入门 ① 创建一个类继承Fragment 重写oncreateView方法 public class FirstFragment extends Fragment { @Overrid ...

  9. 基于Tags的简单内容推荐的实现

    原来为了简单方便,自己小网站上的文章页的相关内容推荐就是从数据库里随机抽取数据来填充一个列表,所以一点相关性都没有,更本没有办法引导用户去访问推荐内容. 算法选择 如何能做到相似内容的推荐呢,碍于小网 ...

随机推荐

  1. 区块链入门到实战(18)之以太坊(Ethereum) – 什么是智能合约

    作用:提供优于传统合约的安全方法,并减少与合约相关的其他交易成本. 以太坊网络基石:以太坊虚拟币和智能合约. 智能合约(Smart contract )是一种旨在以信息化方式传播.验证或执行合同的计算 ...

  2. IntelliJ IDEA 2019 的安装与破解

    IDEA 全称 IntelliJ IDEA,是java编程语言开发的集成环境.IntelliJ在业界被公认为最好的java开发工具,尤其在智能代码助手.代码自动提示.重构.J2EE支持.各类版本工具( ...

  3. swagger的导出

    swagger-export是一个提供swagger文档导出功能的服务,不依赖于具体的API接口服务实现,你可以很方便地导出html和pdf两种格式的静态文档.源码来自swagger导出静态API文档 ...

  4. 安装Apache所踩的的坑

    刚开始接触PHP等一些脚本语言,需要建立一个本地的服务器,变进行安装了Apache.在其中碰到了诸多问题,和大家一一分享一下. 一.刚解压完成后使用cmd面板进入解压完成的apache的bin目录下, ...

  5. python好用的测试库-Nose

    前序: python除了unittest,还有一款更快捷的nose,nose可以说是对unittest的一种简化吧,但是他不需要unittest那种必须有固有的格式,他只需要文件,类名,方法名等含有t ...

  6. Nginx 前端项目配置 包含二级目录和接口代理

    Nginx是目前用的比较多的一个前端服务器 其优点是配置简单修改一下server就能用 并发性能比较好,具体怎么好就看这个吧 开撸 1.找到nginx (liunx系统,已安装) whereis ng ...

  7. servlet web项目连接数据库报错

    报错信息类似这样: Wed May 27 14:15:54 CST 2020 WARN: Establishing SSL connection without server's identity v ...

  8. Java中构建长字符串的四种模式

    回字有四种写法,构建字符串也有四种方式. 用+号最快,第二第三种可读性好,第四种是log4j自有的.下面请见代码: package logbackCfg; import java.text.Messa ...

  9. 快速启动CMD窗口的办法

    在 文件管理器的 地址栏输入cmd回车,cmd会快速在此路径下打开. --END-- 2020-01-07

  10. Eclipse插件打开编辑器

    今天终于可以闲一天,想来想去就乱写点东西吧,说不定对有些新人有点帮助呢-_- 用Eclipse API的方式来打开编辑器,可能对任何一个插件开发者都不是很陌生的操作了.但是,还是建议你忍着看一下,全当 ...