成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

怎么在java中讀取xml配置參數(shù)

今天就跟大家聊聊有關(guān)怎么在java中讀取xml配置參數(shù),可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

按需定制開發(fā)可以根據(jù)自己的需求進(jìn)行定制,做網(wǎng)站、網(wǎng)站制作構(gòu)思過程中功能建設(shè)理應(yīng)排到主要部位公司做網(wǎng)站、網(wǎng)站制作的運用實際效果公司網(wǎng)站制作網(wǎng)站建立與制做的實際意義

paras.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xmlns:context="http://www.springframework.org/schema/context"
 xsi:schemaLocation="
  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
  
  
  <bean id="SysParam" class="com.wisoft.tysfrz.utils.SysParam">
  <!--行政區(qū)劃代碼前臺顯示默認(rèn)值-->
  <property name="zoneCode" value="36"></property>
  <!--二代證讀卡器讀取照片存儲位置-->
  <property name="sfzpicpath" value="d:\\"></property>
  <!--保存身份證照片相對路徑-->
  <property name="photoRealPath" value="r/project/imgs/photo/"></property>
 </bean>
</beans>

SysParam.java類文件

package com.wisoft.tysfrz.utils;

public class SysParam {
 //行政區(qū)劃代碼前臺顯示默認(rèn)值
 private String zoneCode;
 //二代證讀卡器讀取照片存儲位置
 private String sfzpicpath;
 //保存身份證照片相對路徑
 private String photoRealPath;
 public String getZoneCode() {
 return zoneCode;
 }
 public void setZoneCode(String zoneCode) {
 this.zoneCode = zoneCode;
 }
 public String getSfzpicpath() {
 return sfzpicpath;
 }
 public void setSfzpicpath(String sfzpicpath) {
 this.sfzpicpath = sfzpicpath;
 }
 public String getPhotoRealPath() {
 return photoRealPath;
 }
 public void setPhotoRealPath(String photoRealPath) {
 this.photoRealPath = photoRealPath;
 }
}

使用

private static ApplicationContext cpxac = new ClassPathXmlApplicationContext("tysfrz/spring/tysfrz_params.xml");
private static SysParam sysparam = (SysParam) cpxac.getBean("SysParam");
 
String photorealpath = sysparam.getPhotoRealPath();

需要引用包

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

java基本數(shù)據(jù)類型有哪些

Java的基本數(shù)據(jù)類型分為:1、整數(shù)類型,用來表示整數(shù)的數(shù)據(jù)類型。2、浮點類型,用來表示小數(shù)的數(shù)據(jù)類型。3、字符類型,字符類型的關(guān)鍵字是“char”。4、布爾類型,是表示邏輯值的基本數(shù)據(jù)類型。

看完上述內(nèi)容,你們對怎么在java中讀取xml配置參數(shù)有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。

網(wǎng)站欄目:怎么在java中讀取xml配置參數(shù)
當(dāng)前網(wǎng)址:http://jinyejixie.com/article10/iepodo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)、網(wǎng)頁設(shè)計公司網(wǎng)站導(dǎo)航、品牌網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站、Google

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)
葵青区| 孙吴县| 通海县| 石台县| 开化县| 新晃| 通州区| 万源市| 焦作市| 精河县| 县级市| 镇平县| 皮山县| 西丰县| 高州市| 禄劝| 崇明县| 小金县| 焉耆| 永丰县| 耒阳市| 江北区| 宾川县| 吴桥县| 汾阳市| 凤城市| 大石桥市| 大丰市| 青田县| 宣化县| 襄汾县| 曲水县| 田阳县| 垦利县| 承德市| 岑巩县| 黑河市| 舟曲县| 夏津县| 永清县| 岑溪市|