potoyang / spring-in-action-v5-translate Goto Github PK
View Code? Open in Web Editor NEWSpring 实战第五版中文翻译
License: MIT License
Spring 实战第五版中文翻译
License: MIT License
PotoYang , hi,
感谢你们的翻译工作. 我注意到许多语句缺少主语. 虽然可以理解, 但是我觉得有失严谨.例如
随着 Taco Cloud 应用程序的增长,将使用 Java 代码、图像、样式表、测试以及其他可帮助完成项目的附带材料来填充此准系统的项目结构。
Hi Poto,
Greetings and hope you are having a nice day.
The Chinese digital version of this book is wonderful, especially for the code part. That's very beautiful indeed, and thank you pretty much.
I am sending you this email is just a query that if you have any update on the book.
All the best.
Best Regards,
Robin
问下原版英文电子书在哪里看?同时您这个翻译速度是什么样的?
Get Star
“一旦准备好了原料列表,接下来的几行 showDesignForm() 将根据原料类型过滤该列表。然后将成分类型列表作为属性添加到传递到 showDesignForm() 的模型对象。模型是一个对象,它在控制器和负责呈现数据的视图之间传输数据。最后,放置在模型属性中的数据被复制到 servlet 响应属性中,视图可以在其中找到它们。showDesignForm() 方法最后返回 “design”,这是将用于向浏览器呈现模型的视图的逻辑名称。”
这段中的“模型”对应的原文是“Model”,它是一个类,不应该翻译成中文,翻译后失去了原文含义。
14.4.2 文章中的两张图片均无法显示
我一直按照文档进行编码,但我在第 2.1.2 创建控制器类
中遇到问题,无法继续下一步。
程序清单 2.2 Spring 控制器类的开始,代码如下:
package tacos.web;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import lombok.extern.slf4j.Slf4j;
import tacos.Taco;
import tacos.Ingredient;
import tacos.Ingredient.Type;
@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),
new Ingredient("CARN", "Carnitas", Type.PROTEIN),
new Ingredient("TMTO", "Diced Tomatoes", Type.VEGGIES),
new Ingredient("LETC", "Lettuce", Type.VEGGIES),
new Ingredient("CHED", "Cheddar", Type.CHEESE),
new Ingredient("JACK", "Monterrey Jack", Type.CHEESE),
new Ingredient("SLSA", "Salsa", Type.SAUCE),
new Ingredient("SRCR", "Sour Cream", Type.SAUCE)
);
Type[] types = Ingredient.Type.values();
for (Type type : types) {
model.addAttribute(type.toString().toLowerCase(),
filterByType(ingredients, type));
}
// Taco 在哪里定义的?
model.addAttribute("design", new Taco());
return "design";
}
// provided by 'aexiaosong'
private List<Ingredient> filterByType(List<Ingredient> ingredients, Type type) {
return ingredients.stream().filter(x -> x.getType().equals(type)).collect(Collectors.toList());
}
}
在这之前,我没有看到任何地方定义了 Taco 类型,是遗漏了吗,还是我做错了什么?
缺少了一个filterByType函数,我在别的书中看见是有写这个函数的,希望可以加上以便他人学习。
private List<Ingredient> filterByType(List<Ingredient> ingredients, Type type) {
return ingredients.stream().filter(x -> x.getType().equals(type)).collect(Collectors.toList());
}
小心被告
程序清单 2.4,参数不是Design类而是Taco类
For anyone who intresting in v6 translation, pls fork
https://github.com/LeonLi0102/spring-in-action-v6-translate.git
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.