Skip to content

Commit

Permalink
Fix deployed exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 28, 2024
1 parent 8d9202d commit 79721b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/uniovi/controllers/PlayersController.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
Expand Down Expand Up @@ -246,9 +247,9 @@ public String changeRoles(HttpServletResponse response, @RequestParam String use

@GetMapping("/player/admin/questionManagement")
public String showQuestionManagementFragment(Model model) throws IOException {
File jsonFile = new File(QuestionGeneratorService.JSON_FILE_PATH);
Resource jsonFile = new ClassPathResource(QuestionGeneratorService.JSON_FILE_PATH);
ObjectMapper objectMapper = new ObjectMapper();
JsonNode json = objectMapper.readTree(jsonFile);
JsonNode json = objectMapper.readTree(jsonFile.getInputStream());
model.addAttribute("jsonContent", json.toString());

return "player/admin/questionManagement";
Expand Down

0 comments on commit 79721b7

Please sign in to comment.