package uk.ac.prospects.w4.webapp;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author vasileiosl
 *         Date: 15/11/12
 *         Time: 11:12
 */
@Controller
public class W4Controller {

	@RequestMapping(value="/{page}.htm", method = RequestMethod.GET)
	public ModelAndView anyPage(@PathVariable String page){

		ModelAndView model = new ModelAndView(page);
		model.addObject("msg", "Any page");
		return model;
	}

}

@@ -27,17 +27,19 @@
 .webapp;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -80,16 +80,17 @@
 troller;
+%0D
 %0Aimport 
@@ -142,16 +142,17 @@
 ariable;
+%0D
 %0Aimport 
@@ -206,16 +206,17 @@
 Mapping;
+%0D
 %0Aimport 
@@ -269,16 +269,17 @@
 tMethod;
+%0D
 %0Aimport 
@@ -327,13 +327,308 @@
 iew;
-%0A
+%0D%0Aimport org.xml.sax.SAXException;%0D%0Aimport uk.ac.prospects.w4.domain.Course;%0D%0Aimport uk.ac.prospects.w4.repository.CourseGenerator;%0D%0A%0D%0Aimport javax.xml.parsers.ParserConfigurationException;%0D%0Aimport javax.xml.xpath.XPathExpressionException;%0D%0Aimport java.io.IOException;%0D%0Aimport java.util.List;%0D%0A%0D
 %0A/**
+%0D
 %0A * 
@@ -645,16 +645,17 @@
 sileiosl
+%0D
 %0A *     
@@ -672,16 +672,17 @@
 15/11/12
+%0D
 %0A *     
@@ -700,12 +700,14 @@
 1:12
+%0D
 %0A */
+%0D
 %0A@Co
@@ -714,16 +714,17 @@
 ntroller
+%0D
 %0Apublic 
@@ -743,17 +743,19 @@
 roller %7B
-%0A
+%0D%0A%0D
 %0A%09@Reque
@@ -769,17 +769,19 @@
 ng(value
-=
+ = 
 %22/%7Bpage%7D
@@ -814,16 +814,17 @@
 hod.GET)
+%0D
 %0A%09public
@@ -875,10 +875,13 @@
 age)
-%7B%0A
+ %7B%0D%0A%0D
 %0A%09%09M
@@ -923,16 +923,17 @@
 w(page);
+%0D
 %0A%09%09model
@@ -962,16 +962,17 @@
  page%22);
+%0D
 %0A%09%09retur
@@ -983,11 +983,418 @@
 del;
+%0D
 %0A%09%7D
-%0A%0A%7D
+%0D%0A%0D%0A%09@RequestMapping(value = %22/test.htm%22, method = RequestMethod.GET)%0D%0A%09public void retrieveCourseProviderAndCourse() throws IOException, SAXException, XPathExpressionException, ParserConfigurationException %7B%0D%0A%09%09//ModelAndView model = new ModelAndView(page);%0D%0A%09%09List%3CCourse%3E courses = CourseGenerator.generateCoursesFromJsonSearchResult(%22%22);%0D%0A%09%09System.out.println(courses.size());%0D%0A%09%09//return model;%0D%0A%09%7D%0D%0A%0D%0A%7D%0D
 %0A

add test method for w4 controller