We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i use the follow mvc config,but the mvc:interceptores not working,i google it,and most answers told that not use
<mvc:annotation-driven />
i want to the internal reason,thanks
<context:component-scan base-package="com"> <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> </context:component-scan> <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/"/> <bean id="ucInterceptor" class="com.cyberdis.hands.component.uc.UCInterceptor"/> </mvc:interceptor> </mvc:interceptors> <!-- Enables the Spring MVC @Controller programming model --> <mvc:annotation-driven /> <!-- @ResponseBody --> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <property name="messageConverters"> <list> <bean class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/plain;charset=UTF-8</value> </list> </property> </bean> </list> </property> </bean> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <bean class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean" id="cnManager"> <property name="favorPathExtension" value="true"/> <property name="ignoreAcceptHeader" value="true" /> <property name="defaultContentType" value="text/html" /> <property name="mediaTypes"> <map> <entry key="html" value="text/html" /> <entry key="json" value="application/json" /> <entry key="xml" value="application/xml" /> <entry key="msg" value="application/message" /> </map> </property> </bean>
The text was updated successfully, but these errors were encountered:
and i can not useing @responsebody annotation to convert object to json,i add jackjson jar in my classpath like in your pom.xml
@RequestMapping(value="test",produces={"application/json"}) public @ResponseBody FBUser json(HttpServletRequest request,HttpServletResponse response){ /* CustomerUser cusUser = null; if(cusUser == null){ cusUser = new CustomerUser(); cusUser.setStrCusrName("hailiang"); } request.setAttribute("userInfo", cusUser);*/ FBUser fu = new FBUser(); fu.setUserEmail("abc"); return fu; }
Sorry, something went wrong.
i use:
<property name="favorPathExtension" value="false"/>
and your demo project is not working
No branches or pull requests
i use the follow mvc config,but the mvc:interceptores not working,i google it,and most answers told that not use
i want to the internal reason,thanks
The text was updated successfully, but these errors were encountered: