Improve visibility of the website
[proteocache.git] / server / compbio / controllers / IPDataController.java
@@ -16,20 +16,29 @@ import compbio.statistic.CassandraRequester;
  * @author Natasha Sherstneva
  */
 @Controller
-public class IPStatisticsController {
+public class IPDataController {
 
        @RequestMapping(value = "/ip/stat", method = RequestMethod.GET)
        public String initStatisticsForm(Map<String, Object> model) {
+               model.put("value", 5);
                return "queryIPStatistics";
        }
 
        @RequestMapping(value = "/ip", method = RequestMethod.GET)
        public String initOneIPForm(Map<String, Object> model) {
+               model.put("value", "127.0.0.1");
                return "queryIP";
        }
        
        @RequestMapping(value = "/ip/stat/querycounter", method = RequestMethod.GET)
        public String findIPwithCounter(@RequestParam("JobCounter") int counter, Map<String, Object> model) {
+               
+               if (counter < 1) {
+                       model.put("error", "The value must be greater than 0");
+                       model.put("value", counter);
+                       return "queryIPStatistics";
+               }
+
                final long startTime = System.currentTimeMillis();
                CassandraRequester cr = new CassandraRequester();
                List<DataBase> r = cr.readIpByCounter(counter);