由于还没有公认的答案,我发布了我的完整解决方案,它建立在@nationquest 的答案之上:private ConfigClass loadConfiguration(String path){ MutablePropertySources sources = new MutablePropertySources(); Resource res = new FileSystemResource(path); PropertiesFactoryBean propFactory = new PropertiesFactoryBean(); propFactory.setLocation(res); propFactory.setSingleton(false); // resolve potential references to local environment variables Properties properties = null; try { properties = propFactory.getObject(); for(String p : properties.stringPropertyNames()){ properties.setProperty(p, env.resolvePlaceholders(properties.getProperty(p))); } } catch (IOException e) { e.printStackTrace(); } sources.addLast(new PropertiesPropertySource("prefix", properties)); ConfigurationPropertySource propertySource = new MapConfigurationPropertySource(properties); return new Binder(propertySource).bind("prefix", ConfigClass.class).get();}最后三行是这里的相关部分。
1 回答
蝴蝶刀刀
TA贡献1801条经验 获得超8个赞
试试这个网址。
http://localhost:8080/dimensionAttributeValues/search/findDimensionAttributeValueByDimensionAttributeDimensionAttributeID?dimensionAttributeId=1&page=0&size=1&sort=chrValue,desc
.
这将按降序对您的数据进行排序。
添加回答
举报
0/150
提交
取消