Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. <context-param>
  2. <param-name>contextConfigLocation</param-name>
  3. <param-value>/WEB-INF/spring/root-context.xml</param-value>
  4. </context-param>
  5.  
  6. <!-- Creates the Spring Container shared by all Servlets and Filters -->
  7. <listener>
  8. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  9. </listener>
  10.  
  11. <!-- Processes application requests -->
  12. <servlet>
  13. <servlet-name>appServlet</servlet-name>
  14. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  15. <init-param>
  16. <param-name>contextConfigLocation</param-name>
  17. <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
  18. </init-param>
  19. <load-on-startup>1</load-on-startup>
  20. </servlet>
  21.  
  22. <servlet-mapping>
  23. <servlet-name>appServlet</servlet-name>
  24. <url-pattern>/</url-pattern>
  25. </servlet-mapping>
  26.  
  27. <?xml version="1.0" encoding="UTF-8"?>
  28. <beans:beans xmlns="http://www.springframework.org/schema/mvc"
  29. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  30. xmlns:beans="http://www.springframework.org/schema/beans"
  31. xmlns:context="http://www.springframework.org/schema/context"
  32. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  33. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  34. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
  35.  
  36. <!-- Enables the Spring MVC @Controller programming model -->
  37. <annotation-driven />
  38.  
  39. <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
  40. <resources mapping="/resources/**" location="/resources/" />
  41. <resources mapping="/images/**" location="/images/" />
  42.  
  43. <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
  44. <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  45. <beans:property name="prefix" value="/WEB-INF/views/" />
  46. <beans:property name="suffix" value=".jsp" />
  47. </beans:bean>
  48. <context:component-scan base-package="com.totoroads.webservice.android" />
  49. </beans:beans>
  50.  
  51. @Path("/marker")
  52. public class GetLatLongMapMarker {
  53.  
  54. @GET
  55. @Path("/doMarker")
  56. @Produces("application/json;charset=utf-8")
  57. public String doMap() {
  58.  
  59. String carMaps = null;
  60.  
  61. ArrayList<CarMap> mapList = new ArrayList<CarMap>();
  62.  
  63. try {
  64. mapList = DBConnection.getAllMapMarker();
  65. Gson gson = new Gson();
  66. carMaps = gson.toJson(mapList);
  67. }
  68.  
  69. catch (Exception e) {
  70. // TODO Auto-generated catch block
  71. e.printStackTrace();
  72. }
  73.  
  74. return carMaps;
  75. }
  76. }
  77.  
  78. http://192.168.1.221:9999/restfulspringmvc/maker/doMarker
  79.  
  80. 02:12:23.239 [http-bio-9999-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/restfulspringmvc/maker/doMarker]
  81. 02:12:23.239 [http-bio-9999-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /maker/doMarker
  82. 02:12:23.240 [http-bio-9999-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/maker/doMarker]
  83. 02:12:23.241 [http-bio-9999-exec-3] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/restfulspringmvc/maker/doMarker] in DispatcherServlet with name 'appServlet'
  84. 02:12:23.245 [http-bio-9999-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement