| 8 | import java.io.PrintWriter; |
| 9 | |
| 10 | @Controller |
| 11 | public class TwoDice { |
| 12 | @RequestMapping("/rollDice") |
| 13 | // public static void main(String[] args) { |
| 14 | public void main(HttpServletResponse response) throws IOException { |
| 15 | int idx1 = (int)(Math.random()*6)+1; |
| 16 | int idx2 = (int)(Math.random()*6)+1; |
| 17 | |
| 18 | response.setContentType("text/html"); |
| 19 | response.setCharacterEncoding("utf-8"); |
| 20 | PrintWriter out = response.getWriter(); |
| 21 | out.println("<html>"); |
| 22 | out.println("<head>"); |
| 23 | out.println("</head>"); |
| 24 | out.println("<body>"); |
| 25 | out.println("<img src='resources/img/dice"+idx1+".jpg'>"); |
| 26 | out.println("<img src='resources/img/dice"+idx2+".jpg'>"); |
| 27 | out.println("</body>"); |
| 28 | out.println("</html>"); |
| 29 | out.close(); |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected