o(╥﹏╥)oSad

WeChat cannot downloadjfinal demo, but just click on the upper right corner and select open in browser or Safari!
jfinal demo

jfinal demo

JFinal is an extremely fast WEB + ORM framework based on the Java language. Its core design goals are rapid development, small amount of code, simple learning, powerful functions, lightweight, easy to expand, and Restful. While having all the advantages of the Java language, you also have the development efficiency of ruby, python, php and other dynamic languages! Save you more time to spend with your lover, family and friends :)

JFinal 1.9 has more than 20 enhancements and improvements for the features that developers are most concerned about. In addition to providing global support for configuration files, it also strengthens support for JFinal as a server and client in the mobile Internet era. For example, XmlRender and JsonRender can extremely conveniently develop Xml and Json server programs, and HttpKit can be extremely simple and similar to WeChat public platform API for communication. In addition to functional enhancements, the code has also been optimized and streamlined, making it lighter, faster, and more enjoyable ^_^

jfinal demo

JFinal has the following main features:

MVC architecture, exquisite design and easy to use

Follow COC principles, zero configuration, no xml

Original Db + Record mode, flexible and convenient

ActiveRecord support makes database development extremely fast

Automatically load modified java files without restarting the web server during development

AOP support, interceptor configuration is flexible and powerful

Plugin architecture, strong scalability

Multi-view support, supports FreeMarker, JSP, Velocity

Powerful Validator backend verification function

It is fully functional and has most of the functions of struts2.

Small size of only 248K and no third-party dependencies

jfinal small example

Understand the structure and characteristics of jfinal

Picture first

jfinal demo

jfinal demo

jfinal demo

1. Build a database (I use Oracle database, others are relatively similar)

-- Create tablecreate table CLASSES
(
classesid NUMBER not null,
classesname VARCHAR2(20),
classesaddress VARCHAR2(50)
);-- Create tablecreate table STUDENT
(
studentid NUMBER not null,
studentname VARCHAR2(10),
student NUMBER,
studentsex VARCHAR2(2),
classesid NUMBER); alter table STUDENT add constraint FK_CLASSESID foreign key (CLASSESID) references CLASSES (CLASSESID);

Create a new project, I use myeclipse, first import the jar package

jfinal demo

2. Entity class
Classes.java

package com.demo.model;import com.jfinal.plugin.activerecord.Model;public class Classes extends Model<Classes> { public static final Classes dao = new Classes();
}

Student.java

package com.demo.model;import com.jfinal.plugin.activerecord.Model;public class Student extends Model<Student> { public static final Student dao = new Student(); public Classes getClasses() { return Classes.dao.findById (get("classesid"));
}

}

What is this entity class?

That's right! ! ~ ActiveRecord is one of the core components of jfinal. Operating the database through ActiveRecord will greatly reduce the amount of code and greatly improve development efficiency. The configuration is later. I use Model here. Model is the most important component in ActiveRecord. One, it acts as the Model part in the MVC pattern.
By inheriting Model, User in the above code immediately has many convenient methods for operating the database. The dao static object declared in User is defined to facilitate query operations, and this object is not necessary. Model based on ActiveRecord does not need to define properties, getter and setter methods, XML configuration, and Annotation configuration, which greatly reduces the amount of code. For common Model methods, see the official API.

JFinal also has an original Db + Record mode. The Db class and its supporting Record class provide richer database operation functions in addition to the Model class. When using Db and Record classes, there is no need to map database tables. Record is equivalent to a general Model. For common Db methods, see the official API.

JFinal 1.9 changelog

1: Add PropKit and Prop to facilitate global configuration. The default directory for loading configuration files is changed to the class path, which is in line with Maven habits.

2: Enhance the EL output of jstl under jsp, add ModelRecordElResolver, change the default value of JspRender.isSupportActiveRecord to false, and use EL enhancement by default

3: Add HttpKit and EncryptionKit to facilitate communication and encryption with third-party APIs, and to facilitate the development of projects such as WeChat public accounts

4: Add Controller.renderXml(String) to facilitate the development of xml server projects

5: Enhanced FileRender, file download supports multi-thread download and breakpoint resume function

6: Improve the transaction function of DbPro.tx() and Tx interceptor, add rollback when Error is thrown, and enhance transaction security

7: Optimize ActionHandler's performance in judging static resources, and support writing logs when Errors are thrown, making it easier to troubleshoot errors when the JVM crashes.

8: Improve Oracle's ARP initialization performance when the amount of table data is extremely large. The sql condition in OracleDialect.forTableBuilderDoBuild() is changed to rownum<1, and fillStatement() adds judgment on Timestamp.

9: Optimize JsonRender and add the JsonRender.addExcludeAttrs() method to exclude attributes that you do not want to convert to json when renderingJson(). By default, attributes automatically generated after tomcat turns on SSL are excluded, making it easier for tomcat to support SSL.

10: Optimize StrKit.firstCharToLowerCase, firstCharToUpperCase, performance improved by 2.1 times

11: Enhance HandlerKit and add renderError404() to facilitate rendering of 404 pages in Handler

12: Enhance FakeStaticHandler to support filtering of non-pseudo-static action requests

13: Streamline the code related to JFinalConfig and configuration loading and reading

14: ICallback.run() was renamed call()

15: Open Table.getColumnTypeMap() to facilitate developers to expand the ARP function, and make the map returned read-only to ensure safety

16: Add Controller.renderText(String, ContentType) to facilitate text rendering of various Content Types

17: Add the com.jfinal.plugin.activerecord.OrderedFieldContainerFactory class to facilitate the development of database query tool projects so that the iterative output order of attributes in the model is consistent with the field order after SQL select.

18: Optimize DruidPlugin, change the default value of driverClass to null so that the new version of Druid can automatically detect this value

19: Improve EhCachePlugin and add RenderInfo and RenderType to solve thread safety issues when caching render objects.

20: Optimize SessionInViewInterceptor and skip processing JsonRender to improve performance

21: Support public no-parameter methods in Controller to become non-action, add com.jfinal.ext.interceptor.NotAction, usually used in scenarios where the controller needs to provide public no-parameter methods in the interceptor

22: Optimize JsonKit, change the visibility of listToJson and mapToJson methods to private, and code that relies on these methods can call the toJson() method instead.

23: Optimize Render, remove the implementation of the Serializable interface, delete the transient keyword and serialVersionUID attribute in all Render inheritance classes

Document list and instructions for use

1:jfinal-1.9-bin.jar

The only jar package necessary to develop a jfinal project, all other jar packages are not necessary

2:jfinal-1.9-src.zip

jfinal 1.9 source code

3: jfinal-1.9-bin-with-src.jar

The integration of jfinal 1.9 development package + source code facilitates non-maven developers to debug and view the source code during development, so that they can view the source code in the IDE without binding jfinal-1.9-src.zip separately.

4: jetty-server-8.1.8.jar

jetty-server-8.1.8.jar is used to support web servers such as tomcat jetty without additional installation

You can start development with , and it is also a necessary package to support hot deployment. Pay special attention to the need to remove the jetty-server-8.1.8.jar package when using tomcat to develop or deploy to avoid conflicts.

5: All jar packages in the jfinal-1.9-lib directory

Commonly used and potentially used jar packages prepared for developers to facilitate access by non-maven users. For details, please see the description file in the jfinal-1.9-lib directory: "jfinal-1.9-library file dependencies and usage instructions.txt"

Version: 1.9 official latest version | Update time: 2024-11-01

Similar recommendations

Latest updates

jfinal demo comments

  • 1st floor Huajun netizen 2019-09-08 01:17:20
    jfinal demo is very useful, thank you! !
  • 2nd floor Huajun netizen 2018-12-09 16:45:29
    The jfinal demo software is very easy to use, the download speed is very fast, and it is very convenient!
  • 3rd floor Huajun netizen 2020-10-25 18:02:56
    jfinal demo is awesome! 100 million likes! ! !

Recommended products

Everyonealso likeThese:

+

This application has not passed real-name authentication and you can download it through the mobile assistant.

CancelOK