我正在我的 Web 应用程序中实现 url 缓存。我在运行时在 ehcache.xml 文件中有错误。我正在使用 spring 2.5 jar 文件。
缓存文件
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false"
monitoring="autodetect" dynamicConfig="true" maxBytesLocalOnHeap="2m"
maxBytesLocalOffHeap="2m" maxBytesLocalDisk="2m">
<defaultCache eternal="false" maxElementsInMemory="1000"
overflowToDisk="false" diskPersistent="false" timeToIdleSeconds="0"
timeToLiveSeconds="600" memoryStoreEvictionPolicy="LRU" />
<cache name="videoItemsCache" eternal="false"
maxElementsInMemory="1000" timeToIdleSeconds="1200" timeToLiveSeconds="1200"
overflowToDisk="false" diskPersistent="false"
memoryStoreEvictionPolicy="LRU" />
</ehcache>
Run Code Online (Sandbox Code Playgroud)
错误是:
ERROR: VideoClubPortal 27-Sep-2012 11:53 context.ContextLoader Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from ServletContext resource [/WEB-INF/ehcache.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 31; cvc-elt.1: Cannot find the declaration of element …Run Code Online (Sandbox Code Playgroud) 我正在使用 Tapestry 开发 Web 应用程序。我正在使用 junit 测试套件测试我的应用程序,并使用 ant build 生成 war 文件和 html 报告。在我的 html 报告文件中,我有以下警告。
Multiple annotations found at this line:
- Attribute (width) is obsolete. Its use is discouraged in HTML5 documents.
- Attribute (cellpadding) is obsolete. Its use is discouraged in HTML5
documents.
- Undefined attribute value (0).
- Attribute (language) is obsolete. Its use is discouraged in HTML5 documents.
Run Code Online (Sandbox Code Playgroud)
以下是我的测试和报告生成代码。
<target name="test" depends="compile" description="Running Test Suite">
<mkdir dir="${target.data.dir}"/>
<mkdir dir="${target.htmlreports.dir}"/>
<junit fork="no" haltonfailure="no" showoutput="yes" printsummary="true" > …Run Code Online (Sandbox Code Playgroud) 我正在使用WebSocket开发angular2应用程序。我想使用基本身份验证打开Api连接。但是WebSocket不支持标头。我不知道如何在Api中添加基本身份验证。
let websocket = new WebSocket("ws://host:port/api/homepage?v=1");
this.websocket.onopen = (evt) => {
this.websocket.send("Hello World");
};
Run Code Online (Sandbox Code Playgroud)
上面的代码用来打开WebSocket连接。在这里添加基本身份验证。
我试图喜欢这个
// this.websocket.headers("Authorization", "Basic " + btoa(username + ":" + password));
Run Code Online (Sandbox Code Playgroud)
但这会引发错误
websocket中没有头方法