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 e3ead5d commit 8d9202d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/uniovi/controllers/PlayersController.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
Expand Down Expand Up @@ -271,7 +272,7 @@ public String saveQuestions(HttpServletResponse response, @RequestParam String j
printer.indentArraysWith(indenter); // Indent JSON arrays

ObjectMapper mapper = new ObjectMapper();
mapper.writer(printer).writeValue(new FileOutputStream(QuestionGeneratorService.JSON_FILE_PATH), node);
mapper.writer(printer).writeValue(new ClassPathResource(QuestionGeneratorService.JSON_FILE_PATH).getFile(), node);
return "Questions saved";
}
catch (Exception e) {
Expand Down

0 comments on commit 8d9202d

Please sign in to comment.