spring mvc json内部服务器错误

时间:2013-07-22 21:11:18

标签: spring-mvc

我在从带有响应体的控制器返回JSON时遇到问题,我看到hibernate对数据库进行查询但是在将列表转换为json的时刻我遇到了firebug内部服务器错误500;

我的servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
 <beans:beans xmlns="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">


<annotation-driven />
<mvc:annotation-driven />

<mvc:default-servlet-handler />
<mvc:resources mapping="/resources/**" location="/resources/" />


<context:annotation-config />
<context:component-scan base-package="pl.daniluk.spotted.controller" />
<beans:bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <beans:property name="viewClass">
        <beans:value>
            org.springframework.web.servlet.view.tiles2.TilesView
        </beans:value>
    </beans:property>
    <beans:property name="contentType" value="text/html; charset=UTF-8"></beans:property>


</beans:bean>

<beans:bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    <beans:property name="definitions">
        <beans:list>
            <beans:value>/WEB-INF/tiles.xml</beans:value>
        </beans:list>
    </beans:property>
</beans:bean>

和@ResponseBody的控制器

@Controller
@RequestMapping("/place")
public class PlaceControler {

@Autowired
private PlaceService placeService;

@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public List<Place> getAllPlaces() {

    return placeService.getAllPlaces();
}

}

我犯错误的任何线索?

0 个答案:

没有答案