配置Tomcat数据源,在context.xml配置Resource,浏览器无法打开文件显示Below is a rendering of the page up to the first error

<Resource 	name="student" 
				auth="Container" 
				type="javax.sql.DataSource"
				maxActive="100" 
				maxIdle="30" 
				maxWait="10000" 
				username="root" 
				password="123456" 
				driverClassName="com.mysql.jdbc.Driver" 
				url="jdbc:mysql://localhost:3306/STUDENT?useSSL=false&serverTimezone=UTC" /> 

问题:浏览器中无法打开xml文件

解决办法:将“&”改为“&amp;”

<Resource 	name="student" 
				auth="Container" 
				type="javax.sql.DataSource"
				maxActive="100" 
				maxIdle="30" 
				maxWait="10000" 
				username="root" 
				password="123456" 
				driverClassName="com.mysql.jdbc.Driver" 
				url="jdbc:mysql://localhost:3306/STUDENT?useSSL=false&amp;serverTimezone=UTC" /> 

 最后成功打开啦!

猜你喜欢

转载自blog.csdn.net/weixin_52254591/article/details/124689849