spring-3

org.springframework.web.servlet.DispatcherServlet noHandlerFound for basic spring example

狂风中的少年 提交于 2020-01-07 06:07:38
问题 I'm getting following error when i try to deploy the application in tomcat server. Please help me solve this issue. localhost:8080/EnhancedRoyaltyTool/ is my home page and it is throwing the error. Log Message: Aug 02, 2013 8:33:37 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_25\jre\bin;C:\Windows\Sun\Java

org.springframework.web.servlet.DispatcherServlet noHandlerFound for basic spring example

邮差的信 提交于 2020-01-07 06:06:46
问题 I'm getting following error when i try to deploy the application in tomcat server. Please help me solve this issue. localhost:8080/EnhancedRoyaltyTool/ is my home page and it is throwing the error. Log Message: Aug 02, 2013 8:33:37 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_25\jre\bin;C:\Windows\Sun\Java

PropertyPlaceholderConfigurer not loading programmatically

依然范特西╮ 提交于 2020-01-04 10:38:08
问题 I have a custom ApplicationContext class where I'm trying to programmatically load a PropertyPlaceholderConfigurer, then use the placeholders in my XML config file. I've tried three different approaches so far, and each time I get an error like this: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '${domain}.testId' is defined What I am doing wrong? Context class public class MyApplicationContext extends GenericApplicationContext { public MyApplicationContext

Spring 3.0 unable to forward request from HandlerInterceptorAdapter

﹥>﹥吖頭↗ 提交于 2020-01-03 02:24:27
问题 I want to redirect to home page if session get invalid. My spring-servlet.xml is <mvc:interceptors> <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" /> <mvc:interceptor> <mvc:mapping path="/**" /> <bean class="com.xxx.MyInterceptor" /> </mvc:interceptor> </mvc:interceptors> Interceptor : public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if ((null == request.getSession(false)) || (null == request

Elegant way to get Locale in Spring Controller [duplicate]

一世执手 提交于 2020-01-02 01:07:12
问题 This question already has an answer here : Finding Locale from Controller in Spring MVC (1 answer) Closed last year . I'm looking for a cleaner way (in Spring 3.2) to get the current locale than explicitly calling LocaleContextHolder.getLocale() at the start of each Controller method. It has to be compatible with Java annotation, as I'm not using the XML config. Here's what I'm doing currently. @Controller public class WifeController { @Autowired private MessageSource msgSrc; @RequestMapping

How to use @RequestBody with a JSONP request?

梦想与她 提交于 2020-01-01 17:05:24
问题 I am trying to perform an ajax request using the jsonp data type due to cross domain issues in a clustered environment. I can make jsonp requests to methods mapped with no @RequestBody parameters, but when I do try to implement a RequestMapping with a @RequestBody parameter I get a 415 Unsupported Media Type error. Usually when I get this problem it is due to some property not mapping correctly between the json object posted and the Java object it is mapped to in Spring. But the only

PropertyPlaceholderConfigurer vs ReloadableResourceBundleMessageSource

不问归期 提交于 2020-01-01 14:25:43
问题 Searching Google on how to configure property file in Spring 3 and I got many different answers. I found that ReloadableResourceBundleMessageSource and PropertyPlaceholderConfigurer can be used for getting properties from property files. Can somebody please explain the difference between these? 回答1: PropertyPlaceholderConfigurer used for properties files to be used in the application context or inside the code with with @value. ResourceBundleMessageSource used for Internationalization &

PropertyPlaceholderConfigurer vs ReloadableResourceBundleMessageSource

六月ゝ 毕业季﹏ 提交于 2020-01-01 14:25:38
问题 Searching Google on how to configure property file in Spring 3 and I got many different answers. I found that ReloadableResourceBundleMessageSource and PropertyPlaceholderConfigurer can be used for getting properties from property files. Can somebody please explain the difference between these? 回答1: PropertyPlaceholderConfigurer used for properties files to be used in the application context or inside the code with with @value. ResourceBundleMessageSource used for Internationalization &

Setting an active profile for AbstractAnnotationConfigDispatcherServletInitializer that can be use with @PropertySource?

时光毁灭记忆、已成空白 提交于 2020-01-01 12:38:30
问题 I'm using the AbstractAnnotationConfigDispatcherServletInitializer to configure my web application. I also have an @Configuration class I use for creating a few beans. In this class, I use the @PropertySource annotation to load a properties file for various settings (e.g. database connection details). Currently, I use Maven profiles with Ant tasks to create the correct properties file(s) for my runtime environment. That is, I get Maven to move a "prod.properties" or "dev.properties" to

Connecting to JMX server in spring throws exception!

Deadly 提交于 2020-01-01 09:21:58
问题 So when I try to connect to jmx from jconsole I get this exception: Caused by: java.rmi.ConnectException: Connection refused to host: 78.84.17.116; nested exception is: java.net.ConnectException: Connection timed out: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) ... I was trying to connect to such url in jconsole: service:jmx:rmi:///jndi/rmi://78.84.17.116:43030/test My jmx spring