Spring_配置Tiles時報錯:org.apache.tiles.template.NoSuchAttributeException:Attribute 'header' not found.

来源:https://www.cnblogs.com/dandelZH/archive/2018/05/22/9074442.html
-Advertisement-
Play Games

org.apache.tiles.template.NoSuchAttributeException: Attribute 'header' not found. ...


對所學知識內容的興趣可能成為學習動機。

  在Spring中使用Java配置Tiles 3時出錯:

org.apache.tiles.template.NoSuchAttributeException: Attribute 'header' not found.
    at org.apache.tiles.template.DefaultAttributeResolver.computeAttribute(DefaultAttributeResolver.java:50)
    at org.apache.tiles.template.InsertAttributeModel.resolveAttribute(InsertAttributeModel.java:165)
    at org.apache.tiles.template.InsertAttributeModel.execute(InsertAttributeModel.java:121)
    at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:299)
    at org.apache.jsp.WEB_002dINF.views.page_jsp._jspx_meth_t_005finsertAttribute_005f0(page_jsp.java:142)
    at org.apache.jsp.WEB_002dINF.views.page_jsp._jspService(page_jsp.java:91)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:750)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:720)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:96)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

  pom配置如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation
="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.cn.spring.study</groupId> <artifactId>spring-tiles</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <dependencies> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-core --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.11.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.3.11.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-test --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.3.11.RELEASE</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.1.6.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.tiles/tiles-extras --> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-extras</artifactId> <version>3.0.8</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.tiles/tiles-servlet --> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-servlet</artifactId> <version>3.0.8</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.tiles/tiles-api --> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-api</artifactId> <version>3.0.8</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-jsp</artifactId> <version>3.0.8</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-web --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.1.1.RELEASE</version> </dependency> </dependencies> </project>

  WebConfig類的配置如下:

package com.spring.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.tiles3.TilesConfigurer;
import org.springframework.web.servlet.view.tiles3.TilesViewResolver;

@Configuration
@EnableWebMvc
@ComponentScan("com.spring")
public class WebConfig extends WebMvcConfigurerAdapter {
    
    @Bean
    public TilesConfigurer tilesConfigurer() {
        TilesConfigurer tilesConfigurer = new TilesConfigurer();
        tilesConfigurer.setDefinitions(new String[] {
                "/WEB-INF/tiles.xml"
        });
        tilesConfigurer.setCheckRefresh(true);
        return tilesConfigurer;
    }
    
    @Bean
    public ViewResolver viewResolver() {
        return new TilesViewResolver();
    }
    
    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        // TODO Auto-generated method stub
        configurer.enable();
    }
    
}

  tiles.xml配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC 
    "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" 
    "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
    <!-- 定義base tile -->
    <definition name="base" template="/WEB-INF/views/page.jsp">        
    </definition>
    
    <definition name="index" extends="base">
        <put-attribute name="header" 
            value="/WEB-INF/views/header.jsp">
        </put-attribute>
        <put-attribute name="body" 
            value="/WEB-INF/views/home.jsp">
        </put-attribute>
        <put-attribute name="footer" 
            value="/WEB-INF/views/footer.jsp">
        </put-attribute>
    </definition>
    
</tiles-definitions>

  page.jsp配置如下:

<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="t" %>
<%@ page session="false" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Apache Tiles Template</title>
</head>
<body>
    <div id="header">
        <t:insertAttribute name="header" />
    </div>
    
    <div id="content">
        <t:insertAttribute name="body" />
    </div>
    
    <div id="footer">
        <t:insertAttribute name="footer" />
    </div>
    
</body>
</html>

  header.jsp配置如下:

<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<h5>header</h5>

  home.jsp配置如下:

<%@ taglib uri="http://www.springframework.org/tags" prefix="c" %>
<%@ page session="false" %>
<h1>Hello tiles!</h1>

  footer.jsp配置如下:

Copyright &copy;

  目錄結構如下:

 

 

 

 

 

 

 

 

 

 

 

 

  部署代碼至Tomcat,啟動時並無任何錯誤,啟動日誌如下:

五月 22, 2018 10:08:21 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java\jdk1.8.0_161\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Java/jdk1.8.0_161/bin/../jre/bin/server;C:/Java/jdk1.8.0_161/bin/../jre/bin;C:/Java/jdk1.8.0_161/bin/../jre/lib/amd64;.;C:\Java\jdk1.8.0_161\bin;C:\Java\jdk1.8.0_161\jre\bin;D:\apache-maven-3.5.3\bin;;C:\Users\Administrator\Desktop;;.
五月 22, 2018 10:08:21 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
五月 22, 2018 10:08:21 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
五月 22, 2018 10:08:21 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 973 ms
五月 22, 2018 10:08:21 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
五月 22, 2018 10:08:21 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.81
五月 22, 2018 10:08:21 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor F:\apache-tomcat-7.0.81\conf\Catalina\localhost\spring-tiles.xml
五月 22, 2018 10:08:21 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring-tiles' did not find a matching property.
五月 22, 2018 10:08:28 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
五月 22, 2018 10:08:28 下午 org.apache.catalina.core.ApplicationContext log
信息: Spring WebApplicationInitializers detected on classpath: [com.spring.config.SpringTilesWebAppInitialzer@1b6aca02]
五月 22, 2018 10:08:28 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
五月 22, 2018 10:08:30 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [151] milliseconds.
五月 22, 2018 10:08:30 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'dispatcher'
五月 22, 2018 10:08:30 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor F:\apache-tomcat-7.0.81\conf\Catalina\localhost\spring-tiles.xml has finished in 8,730 ms
五月 22, 2018 10:08:30 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor F:\apache-tomcat-7.0.81\conf\Catalina\localhost\src#WEB-INF.xml
五月 22, 2018 10:08:30 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring-tiles' did not find a matching property.
五月 22, 2018 10:08:33 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
五月 22, 2018 10:08:33 下午 org.apache.catalina.core.ApplicationContext log
信息: Spring WebApplicationInitializers detected on classpath: [com.spring.config.SpringTilesWebAppInitialzer@2b7f5883]
五月 22, 2018 10:08:33 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
五月 22, 2018 10:08:34 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'dispatcher'
五月 22, 2018 10:08:34 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor F:\apache-tomcat-7.0.81\conf\Catalina\localhost\src#WEB-INF.xml has finished in 3,683 ms
五月 22, 2018 10:08:34 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.81\webapps\docs
五月 22, 2018 10:08:35 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
五月 22, 2018 10:08:35 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.81\webapps\docs has finished in 1,210 ms
五月 22, 2018 10:08:35 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.81\webapps\examples
五月 22, 2018 10:08:37 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
五月 22, 2018 10:08:37 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
五月 22, 2018 10:08:37 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
五月 22, 2018 10:08:37 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@31567986')
五月 22, 2018 10:08:37 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.81\webapps\examples has finished in 2,395 ms
五月 22, 2018 10:08:37 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.81\webapps\host-manager
五月 22, 2018 10:08:39 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
五月 22, 2018 10:08:39 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.81\webapps\host-manager has finished in 1,192 ms
五月 22, 2018 10:08:39 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.81\webapps\manager
五月 22, 2018 10:08:40 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
五月 22, 2018 10:08:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.81\webapps\manager has finished in 976 ms
五月 22, 2018 10:08:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\apache-tomcat-7.0.81\webapps\ROOT
五月 22, 2018 10:08:40 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
五月 22, 2018 10:08:40 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\apache-tomcat-7.0.81\webapps\ROOT has finished in 876 ms
五月 22, 2018 10:08:40 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
五月 22, 2018 10:08:41 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
五月 22, 2018 10:08:41 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 19246 ms

  本地訪問時home.jsp時,好像header和footer沒有任何作用,如下:

  本次訪問page.jsp時,報錯:org.apache.tiles.template.NoSuchAttributeException: Attribute 'header' not found.

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 1、網頁打開檢查器,到達該路徑,再刷新網頁,點擊第一個“Attractions”文件,出現headers(重要)、response、cookies等信息 2、定位元素位置方法,找唯一特征: 用滑鼠右鍵定位該元素的標簽位置,找出這類信息的唯一性屬性,最後用“標簽+屬性”的方式定位該欄位信息。如定點陣圖片 ...
  • 我在之前的隨筆中介紹了function如何保存參數,如何實現調用相關知識。對於一個函數對象或者函數指針來說,應該很容易理解。不過對於如何在function中保存類的成員函數,這個還是值得一說的。 還是按照之前的方式,通過boost的type_index,我們可以比較容易的知道function的父類是 ...
  • 二.安裝hibernate插件 打開eclipse,點擊help-->eclipse marketplace,如圖輸入:Hibernate Tools,再點擊Goa按鈕,找到JBoss Tools 點擊install安裝 如圖選擇Hibernate Tools,點擊Confrm安裝。安裝完成後重啟e ...
  • 本博客起源於博主的大三NoSQL課程設計,採用python+MongoDB結合方式,將數據從txt文件導入MongoDB之中,再將其取出以作圖。主要技術是採用python與MongoDB結合存儲讀取方案,所以本博客截取了課設的部分內容,主要講解python操作MongoDB方案實現,以給想要學習py ...
  • list是一種有序的集合,可以隨時添加和刪除其中的元素。 用len()函數可以獲得list元素的個數。 用索引來訪問list中每一個位置的元素,索引是從0開始的。如果要取最後一個元素,除了計算索引位置外,還可以用-1作索引,直接獲取最後一個元素。以此類推,可以獲取倒數第2個、倒數第3個。 list是 ...
  • 6.16.3 使用嵌套迴圈,按下麵格式列印字母: F FE FED FEDC FEDCB FEDCBA 1 #include <stdio.h> 2 3 int main() 4 { 5 const int ROWS = 6; 6 7 for (int row(0); row != ROWS; ++ ...
  • Description The course of Software Design and Development Practice is objectionable. ZLC is facing a serious problem .There are many points in K-dimen ...
  • 方法一: public void reverse(String arr[]){ for(int i=arr.length-1;i>=0;i--){ System.out.println(arr[i]); } } 方法二: public static void reverse2(String arr[ ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...