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 d7f06bd commit be83188
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 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", "spring/spring-db.xml");
springContext = new ClassPathXmlApplicationContext("spring/spring-app.xml");
mealController = springContext.getBean(MealRestController.class);
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/ru/javawebinar/topjava/web/SecurityUtil.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
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 = AbstractBaseEntity.START_SEQ;
private static int id = 1;

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="100000">User</option>
<option value="100001">Admin</option>
<option value="1">User</option>
<option value="2">Admin</option>
</select>
<button type="submit">Select</button>
</form>
Expand Down

0 comments on commit be83188

Please sign in to comment.