小编mjg*_*irl的帖子

无法解析Spring属性占位符

我有我的配置:

<context:property-placeholder location="classpath:idm.properties" />

<bean id="idmPropertyHolder" class="fi.utu.resurssitilaus.idm.IdmPropertyHolder">
   <property name="url" value="${idm.url}" /> 
    <property name="user" value="${idm.user}" />
    <property name="password" value="${idm.password}" />
    <property name="proxyHost" value="${http.proxyHost}" />
    <property name="proxyPort" value="${http.proxyPort}" />
</bean>
Run Code Online (Sandbox Code Playgroud)

我收到了错误

    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'idmPropertyHolder' defined in ServletContext resource [/WEB-INF/idm-config.xml]: Could not resolve placeholder 'idm.url'
            at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:272)
            at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
            at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:640)
            at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:615)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) …
Run Code Online (Sandbox Code Playgroud)

spring

50
推荐指数
4
解决办法
22万
查看次数

用xpath开头查找webelement

我正在尝试使用Selenium Webdriver找到一个链接.我不想通过链接文本找到它,只想输入的实际链接.这可以通过使用Selenium的find元素通过xpath - 方法来完成,但是当我只知道该href文本的开头而不是整个文本时,语法是什么?

我想我正在使用某种方法启动xpath链接定位器.我没有准备好代码.

selenium

16
推荐指数
1
解决办法
3万
查看次数

Selenium Webdriver和Firefox 18

我的Selenium测试使用onMouseOver等功能

 List<WebElement> menuitems = getDriver().findElements(By.tagName("li"));
    Actions builder = new Actions(getDriver());
    WebElement menu = menuitems.get(2);
    getDriver().manage().timeouts().implicitlyWait(Constants.IMPLICITY_WAIT, TimeUnit.SECONDS);
    builder.moveToElement(menu).build().perform();
Run Code Online (Sandbox Code Playgroud)

我正在使用Firefox驱动程序.由于Firefox更新到版本18,我的测试停止了工作.我知道这与本机事件支持有关 - 但是版本18不支持本机事件,还是我能够启用它们?如果没有,我的代码是否有替换实现?

我正在使用selenium java 2.28.0.

firefox selenium

9
推荐指数
2
解决办法
1万
查看次数

在控制器spring3中重定向

在Spring 3中,您可以像这样简单地映射URL:

@RequestMapping(value = "/index.html", method = RequestMethod.GET)
public String index(Model model)  {
    return "index";
}
Run Code Online (Sandbox Code Playgroud)

是否有可能使这种方法有点重定向到另一个URL,如:

@RequestMapping(value = "/index.html", method = RequestMethod.GET)
public String index(Model model)  {
    return "second.html";
}

@RequestMapping(value = "/second.html", method = RequestMethod.GET)
public String second(Model model)  {
//put some staff in model
    return "second";
}
Run Code Online (Sandbox Code Playgroud)

spring spring-mvc

6
推荐指数
2
解决办法
3万
查看次数

日历月错了

我尝试在日历后的某些年份设置一个简单的日期:

字符串日期是此metod的参数.

     SimpleDateFormat format = new SimpleDateFormat("dd.mm.yyyy");

    String[] DateTimeParts = date.split(" ");
    String dt = DateTimeParts[0];
    String[] dateParts = dt.split("-");
    int d = Integer.parseInt(dateParts[2]);


    int y = Integer.parseInt(dateParts[0]);
    int m = Integer.parseInt(dateParts[1]);




    Calendar calendar = Calendar.getInstance(); 
    calendar.set(y, m-1, d);
    calendar.add(Calendar.YEAR, years);


    return format.format(calendar.getTime());
}
Run Code Online (Sandbox Code Playgroud)

我的问题是日期返回没有问题,但是月份数字是完全错误的,并且每次运行似乎都变得越来越大!我错过了什么?

java

2
推荐指数
1
解决办法
275
查看次数

target = _blank按类分类的CSS样式

如何使用class="disney"和定义应用于此链接的CSS样式target="_blank"

  <a class="disney" href="http://www.disney.com" target="_blank">disney.com</a>
Run Code Online (Sandbox Code Playgroud)

html css

1
推荐指数
1
解决办法
7782
查看次数

标签 统计

selenium ×2

spring ×2

css ×1

firefox ×1

html ×1

java ×1

spring-mvc ×1