Skip to content

Commit

Permalink
fix servlet
Browse files Browse the repository at this point in the history
  • Loading branch information
dima committed Dec 17, 2023
1 parent 5a95b79 commit d7f06bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ru/javawebinar/topjava/web/MealServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MealServlet extends HttpServlet {

@Override
public void init() {
springContext = new ClassPathXmlApplicationContext("spring/spring-app.xml");
springContext = new ClassPathXmlApplicationContext("spring/spring-app.xml", "spring/spring-db.xml");
mealController = springContext.getBean(MealRestController.class);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ru/javawebinar/topjava/web/SecurityUtil.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package ru.javawebinar.topjava.web;

import ru.javawebinar.topjava.model.AbstractBaseEntity;

import static ru.javawebinar.topjava.util.MealsUtil.DEFAULT_CALORIES_PER_DAY;

public class SecurityUtil {

private static int id = 1;
private static int id = AbstractBaseEntity.START_SEQ;

public static int authUserId() {
return id;
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ <h3>Проект <a href="https://github.com/xzer122/topjava" target="_blank">Ja
<form method="post" action="users">
<b style="font-size: large">Meals of&nbsp;</b>
<select name="userId">
<option value="1">User</option>
<option value="2">Admin</option>
<option value="100000">User</option>
<option value="100001">Admin</option>
</select>
<button type="submit">Select</button>
</form>
Expand Down

0 comments on commit d7f06bd

Please sign in to comment.