我正在阅读Hibernate in Action,作者建议将业务逻辑转移到我们的域模型中(p.306).例如,在经书给出的例子,我们有一个名为三个实体Item,Bid以及User和笔者建议的添加placeBid(User bidder, BigDecimal amount)方法的Item类.
考虑到平时我们(例如,对于业务逻辑的不同层Manager或Service在Spring类),其他的东西控制交易中,等等.这是一个真正的好建议?是不是最好不要向我们的实体添加业务逻辑方法?
提前致谢.
是否有这样的命令time可以显示shell上最后或过去执行的命令的运行时间细节?
我正在尝试localhost:8080使用Social Auth for Java 在我的计算机(at )上运行的玩具应用程序中使用Google OAuth 2身份验证.
但是,当我的应用连接到Google以对用户进行身份验证时,Google会回复此错误页面:

我的应用程序名为"我的爱好应用程序",在开发者控制台中配置如下:

在Google OAuth 2文档中,指定了:
redirect_uri:开发人员控制台中为此项目列出的redirect_uri值之一.
确定响应的发送位置.此参数的值必须与Google Developers Console中为此项目列出的值之一完全匹配(包括http或https方案,大小写和尾随'/').
我有一些问题:
redirect_uri在我的应用中添加多个?google-api socialauth url-redirection google-oauth social-authentication
根据http://www.w3.org/TR/html401/interact/forms.html#h-17.4,输入元素应以单个结尾>而不是结尾/>.虽然大多数浏览器都可以处理以...结尾的输入元素,但/>这样的输入元素是否符合HTML语法规则?换句话说是相同的元件<input ... />和<br />有效的HTML 4?
(这个问题是关于HTML而不是XHTML !!!)
Files.walk(Paths.get("/var/")).count()当作为非特权用户运行时,执行可能会抛出异常,因为内部/var/存在需要遍历root权限的文件夹.
我不是在寻找以root(例如sudo find /var),使用Process等方式执行bash命令的方法.
我只是想确保Files.walk(Paths.get("/var/")).count()不抛出AccessDeniedException:
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0
at sun.reflect.NativeMethodAccessorImpl.invoke
at sun.reflect.DelegatingMethodAccessorImpl.invoke
at java.lang.reflect.Method.invoke
at org.springframework.boot.devtools.restart.RestartLauncher.run
Caused by: java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /var/cache/httpd
at java.nio.file.FileTreeIterator.fetchNextIfNeeded
at java.nio.file.FileTreeIterator.hasNext
at java.util.Iterator.forEachRemaining
at java.util.Spliterators$IteratorSpliterator.forEachRemaining
at java.util.stream.AbstractPipeline.copyInto
at java.util.stream.AbstractPipeline.wrapAndCopyInto
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential
at java.util.stream.AbstractPipeline.evaluate
at java.util.stream.LongPipeline.reduce
at java.util.stream.LongPipeline.sum
at java.util.stream.ReferencePipeline.count
at com.example.DemoApplication.main
... 5 more
Caused by: java.nio.file.AccessDeniedException: /var/cache/httpd
at sun.nio.fs.UnixException.translateToIOException
at sun.nio.fs.UnixException.rethrowAsIOException
at sun.nio.fs.UnixException.rethrowAsIOException
at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream
at java.nio.file.Files.newDirectoryStream
at …Run Code Online (Sandbox Code Playgroud) Jenkins管道项目配置为Jenkinsfile从Git仓库获取它:
如果我更改参数列表,例如,从:
properties([
parameters([
string(name: 'FOO', description: 'Choose foo')
])
])
Run Code Online (Sandbox Code Playgroud)
至:
properties([
parameters([
string(name: 'FOO', description: 'Choose foo'),
string(name: 'BAR', description: 'Choose bar')
])
])
Run Code Online (Sandbox Code Playgroud)
并运行构建,第一次运行不显示新添加的BAR参数:
由于更新的Jenkins文件需要存在BAR参数,这会导致更改后的第一个构建失败,因为没有向用户显示输入此值的输入.
有办法防止这种情况吗?Jenkinsfile在显示参数输入页面之前确保它是最新的?
在我们的项目中,也使用 Kustomize,我们的基本deployment.yaml文件如下所示:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:IMAGE_TAG # <------------------------------
ports:
- containerPort: 80
Run Code Online (Sandbox Code Playgroud)
然后我们用它sed来替换IMAGE_TAG我们想要部署的镜像版本。
是否有更复杂的方法来执行此操作,而不是使用 编辑文本 yaml 文件sed?
我在哪里可以找到样本X HTML 5页面?我主要想知道是否可以将XHTML 5与其他XML语言混合搭配,就像XHTML 1一样.例如,在XHTML 5中有效吗?
<!DOCTYPE html PUBLIC "WHAT SHOULD BE HERE?"
"WHAT SHOULD BE HERE?">
<html xmlns="WHAT SHOULD BE HERE?"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<title><ui:insert name="title">Default title</ui:insert></title>
<link rel="stylesheet" type="text/css" href="./css/main.css"/>
</head>
<body>
<div id="header">
<ui:insert name="header">
<ui:include src="header.xhtml"/>
</ui:insert>
</div>
<div id="left">
<ui:insert name="navigation" >
<ui:include src="navigation.xhtml"/>
</ui:insert>
</div>
<div id="center">
<br />
<span class="titleText"> <ui:insert name="title" /> </span>
<hr />
<ui:insert name="content">
<div>
<ui:include src="content.xhtml"/>
</div>
</ui:insert>
</div>
<div id="right">
<ui:insert name="news">
<ui:include src="news.xhtml"/>
</ui:insert>
</div>
<div …Run Code Online (Sandbox Code Playgroud) 我用Google搜索但找不到答案.
是否有可用于此功能的跨浏览器兼容性矩阵?
如果有人想知道答案,这里是:Mutation Observers vs Mutation Events/Browser Availability.
html ×2
html5 ×2
ansible ×1
bash ×1
dom ×1
google-api ×1
google-oauth ×1
hibernate ×1
html4 ×1
java ×1
javascript ×1
jenkins ×1
jpa ×1
kubernetes ×1
kustomize ×1
linux ×1
macos ×1
nio ×1
root ×1
shell ×1
socialauth ×1
spring ×1
unix ×1