我正在使用Spring In Action书籍学习Spring,我从书中获得了可以正常使用的代码:
@Slf4j
@Controller
@RequestMapping("/design")
public class DesignTacoController {
@GetMapping
public String showDesignForm(Model model) {
List<Ingredient> ingredients = Arrays.asList(
new Ingredient("FLTO", "Flour Tortilla", Type.WRAP),
new Ingredient("COTO", "Corn Tortilla", Type.WRAP),
new Ingredient("GRBF", "Ground Beef", Type.PROTEIN),
);
Type[] types = Ingredient.Type.values();
for (Type type : types) {
model.addAttribute(type.toString().toLowerCase(),
filterByType(ingredients, type));
}
model.addAttribute("design", new Taco());
return "design";
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我在IDEA中键入它时,它说无法解决方法filterByType,但是书中没有这样的问题,也没有对此问题的任何评论。我是春季新手,尝试过很多Google,但找不到有关此问题的任何信息及其来源。您能帮我解决这个问题吗,一个不能因此而继续前进。 IDEA的屏幕截图
I have simple vuetify image tag which has to load image file from project directory, but it never works
<v-img src="@/assets/img/logo.png"></v-img>
Run Code Online (Sandbox Code Playgroud)
Vue cannot load image neither with relative path, nor with absolute. src with @ and require() also don`t work. When i try to require() image, compiler fails and says
Module not found: Error: Can't resolve './assets/logo.png' in 'D:\Projects\ExpertRestRELEASE\src\main\resources\static\js\pages'
Run Code Online (Sandbox Code Playgroud)
It seems like a webpack problem, but i don`t have any idea how to solve it
Project structure:
webpack.config.js
const path …Run Code Online (Sandbox Code Playgroud)