java mongodb

Welcome to MongoDB Web Application example. Earlier in MongoDB Java Example we learned how to use MongoDB java driver in standalone application. Today we are moving forward to integrate MongoDB in Java Servlet web application.

欢迎使用MongoDB Web应用程序示例。 在前面的MongoDB Java示例中,我们学习了如何在独立应用程序中使用MongoDB Java驱动程序。 今天,我们正在努力将MongoDB集成到Java Servlet Web应用程序中 。

MongoDB Web应用程序 (MongoDB Web Application)

We will create a web application where we will be manage Person data and store it in the MongoDB database. We will be able to create, read, update and delete Person records from the user interface and corresponding operations will be performed against MongoDB database.

我们将创建一个Web应用程序,用于管理Person数据并将其存储在MongoDB数据库中。 我们将能够从用户界面创建,读取,更新和删除Person记录,并且将对MongoDB数据库执行相应的操作。

First step is to create a dynamic web application in Eclipse and then convert it to Maven project, so that our maven based web application skeleton code is ready. Below image shows the final project structure and different components of it.

第一步是在Eclipse中创建一个动态Web应用程序,然后将其转换为Maven项目,以使基于maven的Web应用程序框架代码准备就绪。 下图显示了最终的项目结构及其不同的组成部分。

Let’s look into each of the components one by one.

让我们逐一研究每个组件。

MongoDB Web应用程序Maven依赖关系 (MongoDB Web Application Maven Dependencies)

Our final pom.xml file looks like below.

我们最终的pom.xml文件如下所示。

<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>MongoDBWebapp</groupId><artifactId>MongoDBWebapp</artifactId><version>0.0.1-SNAPSHOT</version><packaging>war</packaging><build><plugins><plugin><artifactId>maven-war-plugin</artifactId><version>2.3</version><configuration><warSourceDirectory>WebContent</warSourceDirectory><failOnMissingWebXml>false</failOnMissingWebXml></configuration></plugin><plugin><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.7</source><target>1.7</target></configuration></plugin></plugins><finalName>${project.artifactId}</finalName></build><dependencies><!-- MongoDB Java Driver --><dependency><groupId>org.mongodb</groupId><artifactId>mongo-java-driver</artifactId><version>2.12.3</version></dependency><!-- JSTL libraries for JSP pages --><dependency><groupId>jstl</groupId><artifactId>jstl</artifactId><version>1.2</version></dependency><dependency><groupId>taglibs</groupId><artifactId>standard</artifactId><version>1.1.2</version></dependency><!-- Servlet-API jar, only for compile time --><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency></dependencies>
</project>

Notice that we have MongoDB java driver dependency to connect to MongoDB server, JSTL and standard jars are required for using JSTL tags in the JSP pages.

请注意,我们具有MongoDB java驱动程序依赖项来连接到MongoDB服务器,在JSP页面中使用JSTL标记需要JSTL和标准jars。

部署描述符 (Deployment Descriptor)

Here is our deployment descriptor web.xml file details.

这是我们的部署描述符web.xml文件的详细信息。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"xmlns="https://java.sun.com/xml/ns/javaee"xsi:schemaLocation="https://java.sun.com/xml/ns/javaee https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"id="WebApp_ID" version="3.0"><display-name>MongoDBWebapp</display-name><context-param><param-name>MONGODB_HOST</param-name><param-value>localhost</param-value></context-param><context-param><param-name>MONGODB_PORT</param-name><param-value>27017</param-value></context-param><welcome-file-list><welcome-file>persons.jsp</welcome-file></welcome-file-list>
</web-app>
  • MongoDB server host and port details are configured as context parameters, rather than hardcoding them somewhere in the code.MongoDB服务器的主机和端口详细信息配置为上下文参数,而不是在代码中的某些地方对其进行硬编码。
  • We have single JSP page for view purposes, I have added it in the welcome file list to avoid empty page for web application home.为了查看目的,我们只有一个JSP页面,我在欢迎文件列表中添加了它,以避免Web应用程序主页出现空白页面。

模型Bean或POJO类 (Model Bean or POJO Class)

We have Person.java class as Model class, this bean will be saved as Mongo DBObject into database.

我们有Person.java类作为Model类,此bean将作为Mongo DBObject保存到数据库中。

Person.java

Person.java

package com.journaldev.mongodb.model;public class Person {// id will be used for primary key in MongoDB// We could use ObjectId, but I am keeping it// independent of MongoDB API classesprivate String id;private String name;private String country;public String getName() {return name;}public void setName(String name) {this.name = name;}public String getCountry() {return country;}public void setCountry(String country) {this.country = country;}public String getId() {return id;}public void setId(String id) {this.id = id;}
}

Notice that it has id attribute, this will be generated by MongoDB and it won’t be editable by user. This will serve as the primary key for MongoDB object. Notice that MongoDB record primary key is stored with “_id” key and when we retrieve it, it’s returned as ObjectId instance. For loose coupling, I am using String but we can also use ObjectId type.

请注意,它具有id属性,该属性将由MongoDB生成,并且用户无法对其进行编辑。 这将用作MongoDB对象的主键。 请注意,MongoDB记录主键与“ _id”键一起存储,当我们检索它时,它将作为ObjectId实例返回。 对于松散耦合,我正在使用String,但我们也可以使用ObjectId类型。

Since we are not using ObjectId for primary key, we need to convert it into the ObjectId and vice versa at several places.

由于我们没有使用ObjectId作为主键,因此我们需要在几个地方将其转换为ObjectId,反之亦然。

Java Bean到MongoDB DBObject转换器 (Java Bean to MongoDB DBObject Converter)

We have a helper class for converting Person object to MongoDB DBObject and vice versa.

我们有一个帮助程序类,用于将Person对象转换为MongoDB DBObject,反之亦然。

PersonConverter.java

PersonConverter.java

package com.journaldev.mongodb.converter;import org.bson.types.ObjectId;import com.journaldev.mongodb.model.Person;
import com.mongodb.BasicDBObjectBuilder;
import com.mongodb.DBObject;public class PersonConverter {// convert Person Object to MongoDB DBObject// take special note of converting id String to ObjectIdpublic static DBObject toDBObject(Person p) {BasicDBObjectBuilder builder = BasicDBObjectBuilder.start().append("name", p.getName()).append("country", p.getCountry());if (p.getId() != null)builder = builder.append("_id", new ObjectId(p.getId()));return builder.get();}// convert DBObject Object to Person// take special note of converting ObjectId to Stringpublic static Person toPerson(DBObject doc) {Person p = new Person();p.setName((String) doc.get("name"));p.setCountry((String) doc.get("country"));ObjectId id = (ObjectId) doc.get("_id");p.setId(id.toString());return p;}}

Conversion is very simple, just take a note of converting the id attribute to ObjectId and vice versa.

转换非常简单,只需注意将id属性转换为ObjectId,反之亦然。

MongoDB DAO实施 (MongoDB DAO Implementation)

We could have created a Person DAO interface and provided MongoDB implementation, but for simplicity we have simple MongoDB DAO implementation to expose different operations we can perform for Person object in MongoDB database.

我们可以创建一个Person DAO接口并提供MongoDB实现,但为简单起见,我们有一个简单的MongoDB DAO实现,以展示我们可以对MongoDB数据库中的Person对象执行的不同操作。

MongoDBPersonDAO.java

MongoDBPersonDAO.java

package com.journaldev.mongodb.dao;import java.util.ArrayList;
import java.util.List;import org.bson.types.ObjectId;import com.journaldev.mongodb.converter.PersonConverter;
import com.journaldev.mongodb.model.Person;
import com.mongodb.BasicDBObjectBuilder;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;//DAO class for different MongoDB CRUD operations
//take special note of "id" String to ObjectId conversion and vice versa
//also take note of "_id" key for primary key
public class MongoDBPersonDAO {private DBCollection col;public MongoDBPersonDAO(MongoClient mongo) {this.col = mongo.getDB("journaldev").getCollection("Persons");}public Person createPerson(Person p) {DBObject doc = PersonConverter.toDBObject(p);this.col.insert(doc);ObjectId id = (ObjectId) doc.get("_id");p.setId(id.toString());return p;}public void updatePerson(Person p) {DBObject query = BasicDBObjectBuilder.start().append("_id", new ObjectId(p.getId())).get();this.col.update(query, PersonConverter.toDBObject(p));}public List<Person> readAllPerson() {List<Person> data = new ArrayList<Person>();DBCursor cursor = col.find();while (cursor.hasNext()) {DBObject doc = cursor.next();Person p = PersonConverter.toPerson(doc);data.add(p);}return data;}public void deletePerson(Person p) {DBObject query = BasicDBObjectBuilder.start().append("_id", new ObjectId(p.getId())).get();this.col.remove(query);}public Person readPerson(Person p) {DBObject query = BasicDBObjectBuilder.start().append("_id", new ObjectId(p.getId())).get();DBObject data = this.col.findOne(query);return PersonConverter.toPerson(data);}}

MongoClient instance is required for any MongoDB operations, so I have created a constructor where we need to pass it.

任何MongoDB操作都需要MongoClient实例,因此我在需要传递它的地方创建了一个构造函数。

Our MongoDB operations setup classes are ready, we can move now to integrate it with the web application.

我们的MongoDB操作设置类已经准备就绪,我们现在可以将其与Web应用程序集成。

MongoDB ServletContextListener (MongoDB ServletContextListener)

MongoClient is thread safe and internally manages it’s own connection pool. Best practice is to create an instance of it and reuse it. We should close it when the application is shut down, that makes ServletContextListener implementation best choice to initialize and destroy it.

MongoClient是线程安全的,并且在内部管理它自己的连接池。 最佳实践是创建它的实例并重用它。 我们应该在应用程序关闭时关闭它,这使ServletContextListener实现成为初始化和销毁​​它的最佳选择。

MongoDBContextListener.java

MongoDBContextListener.java

package com.journaldev.mongodb.listener;import java.net.UnknownHostException;import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;import com.mongodb.MongoClient;@WebListener
public class MongoDBContextListener implements ServletContextListener {@Overridepublic void contextDestroyed(ServletContextEvent sce) {MongoClient mongo = (MongoClient) sce.getServletContext().getAttribute("MONGO_CLIENT");mongo.close();System.out.println("MongoClient closed successfully");}@Overridepublic void contextInitialized(ServletContextEvent sce) {try {ServletContext ctx = sce.getServletContext();MongoClient mongo = new MongoClient(ctx.getInitParameter("MONGODB_HOST"), Integer.parseInt(ctx.getInitParameter("MONGODB_PORT")));System.out.println("MongoClient initialized successfully");sce.getServletContext().setAttribute("MONGO_CLIENT", mongo);} catch (UnknownHostException e) {throw new RuntimeException("MongoClient init failed");}}}

Notice that I am using @WebListener annotation to configure it as listener class, your servlet container should support it or else you will have to use XML based configurations. I am using Apache Tomcat 7 that supports Servlet API annotations, so make sure you use compatible servlet container or change the code to use XML based configurations.

注意,我正在使用@WebListener批注将其配置为侦听器类,您的servlet容器应支持它,否则您将不得不使用基于XML的配置。 我正在使用支持Servlet API批注的Apache Tomcat 7,因此请确保使用兼容的servlet容器或将代码更改为使用基于XML的配置。

We are creating instance of MongoClient and adding it as context attribute, so that it will be accessible everywhere in the application.

我们正在创建MongoClient实例并将其添加为上下文属性,以便可以在应用程序中的任何位置访问它。

Servlet类 (Servlet Classes)

We have three servlet classes for CRUD operations, they have some validation logic to make sure input data is valid. If everything is fine with request parameters, then it’s using MongoDB DAO implementation to perform database operations and forward the request to the JSP page after setting correct attributes.

我们有三个用于CRUD操作的servlet类,它们具有一些验证逻辑来​​确保输入数据有效。 如果使用请求参数一切正常,那么它将使用MongoDB DAO实现来执行数据库操作,并在设置正确的属性后将请求转发到JSP页面。

AddPersonServlet.java

AddPersonServlet.java

package com.journaldev.mongodb.servlets;import java.io.IOException;
import java.util.List;import javax.servlet.RequestDispatcher;
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 com.journaldev.mongodb.dao.MongoDBPersonDAO;
import com.journaldev.mongodb.model.Person;
import com.mongodb.MongoClient;@WebServlet("/addPerson")
public class AddPersonServlet extends HttpServlet {private static final long serialVersionUID = -7060758261496829905L;protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {String name = request.getParameter("name");String country = request.getParameter("country");if ((name == null || name.equals(""))|| (country == null || country.equals(""))) {request.setAttribute("error", "Mandatory Parameters Missing");RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);} else {Person p = new Person();p.setCountry(country);p.setName(name);MongoClient mongo = (MongoClient) request.getServletContext().getAttribute("MONGO_CLIENT");MongoDBPersonDAO personDAO = new MongoDBPersonDAO(mongo);personDAO.createPerson(p);System.out.println("Person Added Successfully with id="+p.getId());request.setAttribute("success", "Person Added Successfully");List<Person> persons = personDAO.readAllPerson();request.setAttribute("persons", persons);RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);}}}

EditPersonServlet.java

EditPersonServlet.java

package com.journaldev.mongodb.servlets;import java.io.IOException;
import java.util.List;import javax.servlet.RequestDispatcher;
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 com.journaldev.mongodb.dao.MongoDBPersonDAO;
import com.journaldev.mongodb.model.Person;
import com.mongodb.MongoClient;@WebServlet("/editPerson")
public class EditPersonServlet extends HttpServlet {private static final long serialVersionUID = -6554920927964049383L;protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {String id = request.getParameter("id");if (id == null || "".equals(id)) {throw new ServletException("id missing for edit operation");}System.out.println("Person edit requested with id=" + id);MongoClient mongo = (MongoClient) request.getServletContext().getAttribute("MONGO_CLIENT");MongoDBPersonDAO personDAO = new MongoDBPersonDAO(mongo);Person p = new Person();p.setId(id);p = personDAO.readPerson(p);request.setAttribute("person", p);List<Person> persons = personDAO.readAllPerson();request.setAttribute("persons", persons);RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);}protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {String id = request.getParameter("id"); // keep it non-editable in UIif (id == null || "".equals(id)) {throw new ServletException("id missing for edit operation");}String name = request.getParameter("name");String country = request.getParameter("country");if ((name == null || name.equals(""))|| (country == null || country.equals(""))) {request.setAttribute("error", "Name and Country Can't be empty");MongoClient mongo = (MongoClient) request.getServletContext().getAttribute("MONGO_CLIENT");MongoDBPersonDAO personDAO = new MongoDBPersonDAO(mongo);Person p = new Person();p.setId(id);p.setName(name);p.setCountry(country);request.setAttribute("person", p);List<Person> persons = personDAO.readAllPerson();request.setAttribute("persons", persons);RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);} else {MongoClient mongo = (MongoClient) request.getServletContext().getAttribute("MONGO_CLIENT");MongoDBPersonDAO personDAO = new MongoDBPersonDAO(mongo);Person p = new Person();p.setId(id);p.setName(name);p.setCountry(country);personDAO.updatePerson(p);System.out.println("Person edited successfully with id=" + id);request.setAttribute("success", "Person edited successfully");List<Person> persons = personDAO.readAllPerson();request.setAttribute("persons", persons);RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);}}}

DeletePersonServlet.java

DeletePersonServlet.java

package com.journaldev.mongodb.servlets;import java.io.IOException;
import java.util.List;import javax.servlet.RequestDispatcher;
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 com.journaldev.mongodb.dao.MongoDBPersonDAO;
import com.journaldev.mongodb.model.Person;
import com.mongodb.MongoClient;@WebServlet("/deletePerson")
public class DeletePersonServlet extends HttpServlet {private static final long serialVersionUID = 6798036766148281767L;protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {String id = request.getParameter("id");if (id == null || "".equals(id)) {throw new ServletException("id missing for delete operation");}MongoClient mongo = (MongoClient) request.getServletContext().getAttribute("MONGO_CLIENT");MongoDBPersonDAO personDAO = new MongoDBPersonDAO(mongo);Person p = new Person();p.setId(id);personDAO.deletePerson(p);System.out.println("Person deleted successfully with id=" + id);request.setAttribute("success", "Person deleted successfully");List<Person> persons = personDAO.readAllPerson();request.setAttribute("persons", persons);RequestDispatcher rd = getServletContext().getRequestDispatcher("/persons.jsp");rd.forward(request, response);}}

Notice the use of @WebServlet annotation for configuring the URI pattern for each of the servlets. It will be used in JSP pages to send the request to correct servlet.

注意,使用@WebServlet批注为每个servlet配置URI模式。 在JSP页面中将使用它来发送请求以更正servlet。

JSP查看页面 (JSP View Page)

Final piece of the project is the view page, i am using JSTL tags for rendering the response html page.

该项目的最后一块是视图页面,我正在使用JSTL标签来呈现响应html页面。

persons.jsp

persons.jsp

<%@ taglib uri="https://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Persons Manage Page</title>
<style>
table,th,td {border: 1px solid black;
}
</style>
</head>
<body><%-- Person Add/Edit logic --%><c:if test="${requestScope.error ne null}"><strong style="color: red;"><c:outvalue="${requestScope.error}"></c:out></strong></c:if><c:if test="${requestScope.success ne null}"><strong style="color: green;"><c:outvalue="${requestScope.success}"></c:out></strong></c:if><c:url value="/addPerson" var="addURL"></c:url><c:url value="/editPerson" var="editURL"></c:url><%-- Edit Request --%><c:if test="${requestScope.person ne null}"><form action='<c:out value="${editURL}"></c:out>' method="post">ID: <input type="text" value="${requestScope.person.id}"readonly="readonly" name="id"><br> Name: <inputtype="text" value="${requestScope.person.name}" name="name"><br>Country: <input type="text" value="${requestScope.person.country}"name="country"><br> <input type="submit"value="Edit Person"></form></c:if><%-- Add Request --%><c:if test="${requestScope.person eq null}"><form action='<c:out value="${addURL}"></c:out>' method="post">Name: <input type="text" name="name"><br> Country: <inputtype="text" name="country"><br> <input type="submit"value="Add Person"></form></c:if><%-- Persons List Logic --%><c:if test="${not empty requestScope.persons}"><table><tbody><tr><th>ID</th><th>Name</th><th>Country</th><th>Edit</th><th>Delete</th></tr><c:forEach items="${requestScope.persons}" var="person"><c:url value="/editPerson" var="editURL"><c:param name="id" value="${person.id}"></c:param></c:url><c:url value="/deletePerson" var="deleteURL"><c:param name="id" value="${person.id}"></c:param></c:url><tr><td><c:out value="${person.id}"></c:out></td><td><c:out value="${person.name}"></c:out></td><td><c:out value="${person.country}"></c:out></td><td><ahref='<c:out value="${editURL}" escapeXml="true"></c:out>'>Edit</a></td><td><ahref='<c:out value="${deleteURL}" escapeXml="true"></c:out>'>Delete</a></td></tr></c:forEach></tbody></table></c:if>
</body>
</html>

Recommended Read: JSTL Tutorial, JSP EL and JSP implicit objects.

推荐阅读 : JSTL教程 , JSP EL和JSP隐式对象 。

MongoDB Java Web应用程序测试 (MongoDB Java Web Application Test)

Our application is ready for a test drive, below screenshots show some of the response pages of different CRUD operations.

我们的应用程序已准备好进行测试驱动,以下屏幕截图显示了不同CRUD操作的一些响应页面。

Home Page

主页

Create Person Page

创建人员页面

Read Person Page

阅读人页面

Update Person Page

更新人员页面

Delete Person Page

删除人员页面

You will also find below logs in the server log file.

您还将在服务器日志文件中找到以下日志。

MongoClient initialized successfully
Person Added Successfully with id=53ea76e70364b0028f507802
Person Added Successfully with id=53ea76fd0364b0028f507803
Person edit requested with id=53ea76e70364b0028f507802
Person edited successfully with id=53ea76e70364b0028f507802
Person deleted successfully with id=53ea76fd0364b0028f507803
MongoClient closed successfully

摘要 (Summary)

This post was intended to provide a complete example of using MongoDB server as data storage, you learned how to use MongoDB java driver for CRUD operations and create a web application. Download the final project from below link and explore more.

这篇文章旨在提供一个使用MongoDB服务器作为数据存储的完整示例,您学习了如何使用MongoDB Java驱动程序进行CRUD操作并创建Web应用程序。 从下面的链接下载最终项目并进行更多探索。

Download MongoDB Servlet Web Application Project下载MongoDB Servlet Web应用程序项目

翻译自: https://www.journaldev.com/4011/mongodb-java-servlet-web-application-example-tutorial

java mongodb

java mongodb_MongoDB Java Servlet Web应用程序示例教程相关推荐

  1. java web初级面试题_Java Web应用程序初学者教程

    java web初级面试题 Java Web Application is used to create dynamic websites. Java provides support for web ...

  2. ldap java_使用LDAP保护Java EE6中的Web应用程序

    ldap java 在上一篇文章中,我们解释了如何在通过传输层安全性(TLS)/安全套接字层(SSL)传输数据时保护数据. 现在让我们尝试了解如何为使用LDAP服务器进行身份验证的基于JEE 6的We ...

  3. 使用LDAP保护Java EE6中的Web应用程序

    在上一篇文章中,我们解释了如何在通过传输层安全性(TLS)/安全套接字层(SSL)传输数据时保护数据. 现在,让我们尝试了解如何为使用LDAP服务器进行身份验证的基于JEE 6的Web应用程序应用安全 ...

  4. Java中使用ArrayList的10个示例–教程

    Java中的ArrayList是HashMap之后最常用的集合类. Java ArrayList表示一个可自动调整大小的数组,并用于代替数组. 由于创建数组后我们无法修改数组的大小,因此我们更喜欢在J ...

  5. idea java 桌面应用_IDEA打包应用程序的教程图解

    为JAR创建工件配置选择:文件|项目结构(File | Project Structure),以打开"项目结构(Project Structure)"对话框.在"项目设置 ...

  6. Abp vnext Web应用程序开发教程 10 —— 书与作者的关系

    文章目录 关于本教程 下载源代码 介绍 向书实体添加关系 数据库和数据迁移 更新EF核心映射 添加新的EF核心迁移 更改数据播种器 应用层 数据传输对象 IBookAppService BookApp ...

  7. Abp vnext Web应用程序开发教程 9 —— 作者:用户界面

    文章目录 关于本教程 下载源代码 介绍 图书列表页面 Index.cshtml IndexModel.cshtml.cs Index.js 本地化 添加到主菜单 运行应用程序 创建模态 CreateM ...

  8. Abp vnext Web应用程序开发教程 8 —— 作者:应用程序层

    文章目录 关于本教程 下载源代码 介绍 IAuthorAppService AuthorDto GetAuthorListDto CreateAuthorDto UpdateAuthorDto Aut ...

  9. Abp vnext Web应用程序开发教程 7 —— 作者:数据库集成

    文章目录 关于本教程 下载源代码 介绍 数据库上下文 创建一个新的数据库迁移 实现IAuthorRepository 下一部分 关于本教程 本教程基于版本3.1 在本教程系列中,您将构建一个名为Acm ...

最新文章

  1. 【问题收录】Android Studio 2.2使用时出现问题总结
  2. 【Linux 操作系统】阿里云服务器 操作实战 部署C语言开发环境(vim配置,gcc) 部署J2EE网站(jdk,tomcat)
  3. 【数据结构】(面试题)使用两个栈实现一个队列(详细介绍)
  4. 【Gym - 101061F】Fairness(dp,思维)
  5. 福建高职计算机知识点,2013福建高职单招 计算机类专业 知识试题
  6. uboot——之初体验
  7. 采用truelicense进行Java规划license控制 扩展可以验证后,license 开始结束日期,验证绑定一个给定的mac住址...
  8. 闪修侠、极客修、千机网,手机维修选哪家?
  9. 三极管的经典模型——两个二极管连接和三极管人(transistor man)
  10. Android之Handler,举例说明如何更新UI
  11. 强大的发包工具fine packet builder
  12. matlab潮流计算仿真,MATLAB潮流计算仿真
  13. 美团java后端面试题目_美团笔试题(Java后端5题2小时)
  14. LTE中RB和RE、REG、CCE的定义
  15. 周末鸡汤|电子游戏教给你的人生一课 from Quora
  16. Unity 5如何设置物体透明
  17. 基于matlab指纹识别论文,毕业论文-基于Matlab的指纹识别
  18. [Vue warn]: Failed to resolve component: xxx
  19. MT6737 Android N 平台 Audio系统学习----录音到播放录音流程分析
  20. 自定义View 实现左右拖动脉象图

热门文章

  1. Clean Code 笔记
  2. 【转】OCaml基础知识
  3. Xilinx Altera FPGA中的逻辑资源(Slices VS LE)比较
  4. Getting Started with Processing 第五章的easing问题(2)
  5. MyEclipse项目里面出现红叉的解决方案?
  6. OTL翻译(4) -- otl_stream类
  7. Spring的声明式事务
  8. 谈谈我们的学习和我们的Blog
  9. Deep3DBox论文解读
  10. 读EasyPR开发详解实践感想1