updated with passed tests
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
package edu.msudenver.tsp.website;
|
||||
|
||||
|
||||
import lombok.extern.java.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@SpringBootApplication
|
||||
@Slf4j
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package edu.msudenver.tsp.website.controller;
|
||||
|
||||
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+10
-11
@@ -1,9 +1,8 @@
|
||||
package edu.msudenver.tsp.website;
|
||||
package edu.msudenver.tsp.website.controller;
|
||||
|
||||
import edu.msudenver.tsp.website.forms.Theorem;
|
||||
import edu.msudenver.tsp.website.controller.forms.Theorem;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -17,28 +16,28 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
public class TheoremEntryController {
|
||||
|
||||
|
||||
@RequestMapping("/welcome")
|
||||
public ModelAndView firstPage()
|
||||
{
|
||||
return new ModelAndView("welcome");
|
||||
}
|
||||
|
||||
@RequestMapping("/theorem")
|
||||
public ModelAndView theoremPage()
|
||||
{
|
||||
//System.out.println("Inside controller");
|
||||
|
||||
|
||||
return new ModelAndView("Theorem");
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
||||
public String saveTheorem(@Validated Theorem theorem, Model model) {
|
||||
|
||||
model.addAttribute("theromName1", theorem.getTheoremName1());
|
||||
model.addAttribute("theromName2", theorem.getTheoremName2());
|
||||
model.addAttribute("theromName", theorem.getTheoremName());
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
public ModelAndView firstPage() {
|
||||
return new ModelAndView("welcome");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package edu.msudenver.tsp.website.controller.forms;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
||||
public class Theorem {
|
||||
private String theoremName ;
|
||||
|
||||
|
||||
public String getTheoremName() {
|
||||
return theoremName;
|
||||
}
|
||||
|
||||
public void setTheoremName1(String theoremName) {
|
||||
this.theoremName = theoremName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package edu.msudenver.tsp.website.forms;
|
||||
|
||||
public class Theorem {
|
||||
private String theoremName1 ;
|
||||
private String theoremName2 ;
|
||||
|
||||
public String getTheoremName1() {
|
||||
return theoremName1;
|
||||
}
|
||||
|
||||
public void setTheoremName1(String theoremName) {
|
||||
this.theoremName1 = theoremName;
|
||||
}
|
||||
|
||||
public String getTheoremName2() {
|
||||
return theoremName2;
|
||||
}
|
||||
|
||||
public void setTheoremName2(String theoremName) {
|
||||
this.theoremName2 = theoremName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user