• ASP.NET How to define controller type dynamically at runtime in core MVC


    Yesterday, a friend asked me a question on wechat: he hoped to achieve the goal of ASP.NET The extension of core MVC application, such as uploading a C ා script during the running process of the program, registering the controller type defined in it to the application, and asking if I have a good solution. […]

  • Upload file instance in spring MVC


    Spring MVC (annotation) upload file need to pay attention to several places:1. The enctype of the form is “multipart / form data”, which is required for uploading files2、 applicationContext.xml to configure: Copy codeThe code is as follows: <! — when uploading files, the multipartresolver processor needs to be configured — > <bean>     <property name=”defaultEncoding” […]

  • Asp.net MVC realizes the function of generating excel and downloading


    The example of this article is shared for you Asp.net MVC to generate excel and download the specific code, for your reference, the specific content is as follows Due to the requirements on the project, it is necessary to export Excel files with specified conditions. After a lot of twists and turns, it finally came […]

  • Explain the fuzzy query of data query module based on MVC


    Complete a simple MVC based data query module, which requires fuzzy query according to name. Index.jsp: <%@ page import=”student.TestBean” %> <%@ page import=”java.util.List” %> <%@ page import=”java.util.ArrayList” %> <%@ page language=”java” contentType=”text/html; charset=UTF-8″ pageEncoding=”UTF-8″%> <% List<TestBean> list = (List<TestBean>)request.getAttribute(“list”); if(list == null){ list = new ArrayList<TestBean>(); } %> <!doctype html> <html lang=”en”> <head> <meta charset=”UTF-8″> […]

  • An example analysis of MVC based on Java Web


    This paper describes the basic MVC of Java Web implementation. Share with you for your reference. The details are as follows: login.jsp ——Input file for view sectionsuccess.jsp ——Output file of view sectionfailure.jsp ——Output file of view sectionLoginBean.java ——Model partLoginServlet.java ——Controller partweb.xml ——Configuration file of web application The following is a brief introduction: 1、login.jsp The function […]

  • Talking about ASP.NET Implementation of MVC to prevent cross Site Request Forgery (CSRF) attack


    In the HTTP post request, we look at the following code in view and controller several times: Called in 1.View Html.AntiForgeryToken ()。 2. The [validate anti forgery token] annotation is added to the method in the controller. This seemingly one-to-one writing is actually to avoid introducing Cross Site Request Forgery (CSRF) attacks. This form of […]

  • JSP uses JDBC to complete dynamic verification and MVC to complete data query


    In this paper, JSP uses JDBC to complete dynamic verification and MVC to complete data query. Share with you for your reference. The details are as follows: 1、 Objectives: ① Master the basic process of JDBC linked database;② Master the use of JDBC for data query. 2、 Main contents: ① On the basis of the […]

  • Three methods of spring MVC unified exception handling


    This article mainly introduces three methods of spring MVC unified exception handling. The example code is introduced in detail in this article, which has certain reference learning value for your study or work. You can refer to the following for your friends In the development of spring MVC application, no matter for the underlying database […]

  • Implementation of simple hello world in spring MVC


    1、 Project construction 1. You can use the spring MVC framework in new projects. Or create a simple project and add framework support to add spring MVC framework. 2. Delete the jar package of the automatically generated lib, and use the POM file to manage the package. The directory structure is shown in the figure […]

  • Two ways to transfer values of asp.net MVC drop-down box


    In the past, when webform was used, the drop-down box only needed to bind the code directly in the background. Now let’s take a look at the dropdownlist in MVC if and accept the value passed from the controller. First: use dropdownlist Controller code: public ActionResult Index() { //1.1 querying data of yzseriesentity List<Model.YzSeriesEntity> seriesList […]

  • Explain how to set the selected item for dropdownlistfor in MVC


    1. Front end cshtml 2. New page – when the page is loaded, the company information is loaded from the database 3. Modify page – when loading the page, load all company information from the database, judge according to the company ID of the record line to be modified, and set the company as selected […]

  • Implementation example of wechat payment H5 developed by asp.net MVC (external browser payment)


    H5 payment refers to that the merchant displays goods or services on the mobile terminal webpage outside the wechat client. When the user confirms to use wechat payment on the above page, the merchant initiates this service to call the wechat client for payment. It is mainly used for the scenario of the touch-screen mobile […]