我有一些日食问题.
如果我anyMap()
在源代码中使用类似的东西,然后按,则CTRL + SHIFT + O
导入列表中不会进行任何更新.
如果我import static org.mockito.Matchers.*
在我的导入中写出类似的东西,anyMap()
那么就知道了.
如果按,然后CTRL + SHIFT + O
因为我必须导入一些其他类,import static org.mockito.Matchers.*
将被替换为import static org.mockito.Matchers.anyMap
如果我想使用那么anyList()
,我必须import static org.mockito.Matchers.*
再次手工编写导入.
我知道这个主题可以修改Eclipse组织导入(ctrl + shift + o)命令对静态导入的处理吗?并且解决方案工作正常,但是还有可能因此eclipse自动知道我想要使用的静态类吗?
我正在使用Gitlab和Sonarqube以及Sonarqube插件SVG徽章.
为了在gitlab上表示Sonarqube状态,我在我的README.md
文件中有类似的东西:
[](https://sonar.domain.com/component_measures/metric/coverage/list?id=de.domain:projectname)
Run Code Online (Sandbox Code Playgroud)
这很完美.我的徽章显示,链接正常,一切都很好.
有没有办法建立像:
[](https://sonar.domain.com/component_measures/metric/coverage/list?id={MYDOMAIN}:{THIS})
Run Code Online (Sandbox Code Playgroud)
我想提供一个框架,每个开发人员都可以复制并粘贴到他们的README.md
文件中,变量会自动填充到README中,类似于.gitlab-ci.yml
[](https://sonar.domain.com/component_measures/metric/coverage/list?id={MYDOMAIN}:$CI_PROJECT_NAME)
Run Code Online (Sandbox Code Playgroud)
有人有想法吗?
i have a litte JavaEE project, and i have to secure it with the OWASP ESAPI
i integrated the ESAPI like this in Maven:
<!-- ESAPI Version 2.0.1 -->
<dependency>
<groupId>org.owasp.esapi</groupId>
<artifactId>esapi</artifactId>
<version>2.0.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
So after this i can use the ESAPI classes for programming.
i also included the .esapi
folder in the server start:
-Dorg.owasp.esapi.resources=/home/joergi/.esapi/
Run Code Online (Sandbox Code Playgroud)
I also copied the ESAPI.properties
and the validation.properties
into
src/main/resources
Run Code Online (Sandbox Code Playgroud)
(I'm not sure if it works, but i get no error while starting the …
由于某些安全原因,我决定jsessionid
在URL中禁用会话跟踪.在我将web.xml更改为下面的文件之前,我第一次访问jsessionid
网址中的页面时,在点击第一个链接后,它再也没有出现过.
我的web.xml
样子
<session-config>
<session-timeout>10</session-timeout>
<cookie-config>
<secure>true</secure>
</cookie-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
Run Code Online (Sandbox Code Playgroud)
现在我有了jsessionid
URL,如果我点击页面上的另一个链接,它永远不会消失.每次点击都会改变.
如果我尝试调用JSF操作,我得到一个javax.faces.application.ViewExpiredException
但托管bean是@SessionScoped
.
这是我的依赖树:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Java EE 6 webapp project
[INFO] task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] de.project:demoapp:war:1.0-SNAPSHOT
[INFO] +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:provided (version managed from 1.0.0.Beta1)
[INFO] | \- javax.inject:javax.inject:jar:1:provided
[INFO] +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:provided …
Run Code Online (Sandbox Code Playgroud) 我想使用ui-Utils模块:scrollfix以<div>
100px开头,如果我向下滚动,它应该固定在0px.
<div ui-scrollfix="+100">test</div>
Run Code Online (Sandbox Code Playgroud)
在scrolllfix演示站点上有一个提示框,其中说:
请记住,此指令仅向元素添加ui-scrollfix类.您可以添加相应的CSS规则,但是如果您愿意,还可以添加其他规则.
即使在那里有演示页面它也没有真正起作用......或者我期待有些不对劲.
我在JBoss AS 7上使用jsf2.0和java ee6
我有一个看起来像这样的LoginController.java:
@ManagedBean(name = "loginController")
@SessionScoped
public class LoginController implements Serializable{
private static final long serialVersionUID = 1119172305268193508L;
@Inject
private UserProvider userProvider;
@PostConstruct
public void initNewUser() {
user = new User();
}
private User user;
private String accountName;
private String password;
public String ownLogin() throws Exception {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance()
.getExternalContext().getRequest();
if (accountName != null) {
try {
if (exists(accountName)) {
user = userProvider.findUserByAccountName(accountName);
if (verifyPassword(user, password)) {
userProvider.saveChangedUser(user);
// OWASP SAYS: after login, destroy …
Run Code Online (Sandbox Code Playgroud) 我有一个问题,如果我使用键CTRL+ SHIFT+ 在Eclipse中自动格式化XHTML文件(JSF 1.2)f,输出看起来非常糟糕,并且不再可读.
我的格式化代码:
<span class="label viertel alignright">
<h:outputLabel for="itLine5" value="E-Mail:" />
</span>
Run Code Online (Sandbox Code Playgroud)
变成这样:
<span class="label viertel alignright"> <h:outputLabel
for="itLine5" value="E-Mail:" /> </span>
Run Code Online (Sandbox Code Playgroud)
在这个小例子中,它仍然可读 - 但在较长的代码中它只是混乱!
如何确保我的XHTML代码以可读的方式格式化?
我使用这个版本的Eclipse Helios:
我使用这些JBoss工具:
我有h:inputTextarea
一些人a4j:support
按需更新模型
<h:inputTextarea rows="15" id="taFreetext" value="#{customInput.value}"
required="true"
onkeyup="textAndLinesCount(#{rich:element('taFreetext')},document.getElementById('msgCounterLines'),20, 64);">
<a4j:support ajaxSingle="true" event="onchange" />
</h:inputTextarea>
Run Code Online (Sandbox Code Playgroud)
我的问题是,当我按下一个键时,不仅我的上下文中的模型被更新,而且实体也会自动刷新!
在page.xml
该文件中有冲洗模式到手动
<begin-conversation join="true" flush-mode="manual"/>
Run Code Online (Sandbox Code Playgroud)
我在Seam框架论坛中阅读了这篇文章:AJAX和更新模型的问题,但这并没有真正帮助.我也有一些action
在我a4j:support
,使一个entityManager.refresh()
写在后,但随后的模型和实体仍然在旧的国家...
期待一些好的提示,谢谢!
(我使用JSF 1.2,RichFaces 3.3.3)
我有一个简单的控制器(代码)
@RestController
@RequestMapping("/profiles" , produces = [MediaType.APPLICATION_JSON_VALUE])
class Controller(@Autowired val restClient: RestClient) {
@GetMapping("/simple-get")
fun simpleGetCall(): List<Profile> {
restClient.callClientGet()
return listOf(
Profile("firstname1", "lastname1"),
Profile("firstname2", "lastname2"))
}
}
Run Code Online (Sandbox Code Playgroud)
控制器正在调用 RestClient 进行客户端调用(代码)
@Service
class RestClient(@Autowired val restTemplate: RestTemplate) {
fun callClientGet(){
try {
restTemplate.getForEntity(
"/profiles/simple-get",
Number::class.java
)
}catch(exception: Exception){
throw MyClientCallException("this is an exception")
}
}
}
Run Code Online (Sandbox Code Playgroud)
MyClientCallException 看起来像这样(代码)
class MyClientCallException(message: String) :
ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, message)
Run Code Online (Sandbox Code Playgroud)
我的班级中有 3 个功能测试(代码)我使用org.springframework.test.web.client.MockRestServiceServer
作为服务器
@Test
fun `when calling …
Run Code Online (Sandbox Code Playgroud) 我们正在使用tomcat 7运行arquillian ...
我的同事使用MAC测试工作正常,但在我的linux计算机上(我们都有8gb内存),它很容易:
FATAL: Error waiting for multi-thread deployment of WAR files to complete
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
Run Code Online (Sandbox Code Playgroud)
当我开始测试时,我在堆栈中看到这一行:
14:05:56.482 INFO - 使用以下命令启动Tomcat:[java,-Dcom.sun.management.jmxremote.port = 8089,-Dcom.sun.management.jmxremote.ssl = false,-Dcom.sun.management.jmxremote.authenticate = false,-Xmx512m,-XX:MaxPermSize = 128m,-classpath,/ home/user/apache-tomcat-testing/bin/bootstrap.jar:/ home/user/apache-tomcat-testing/bin/tomcat-juli. jar,-Djava.endorsed.dirs =/home/user/apache-tomcat-testing/endorsed,-Dcatalina.base =/home/user/apache-tomcat-testing,-Dcatalina.home =/home/user/apache- tomcat-testing,-Dava.io.tmpdir =/home/user/apache-tomcat-testing/temp,org.apache.catalina.startup.Bootstrap,-config,/ home/user/apache-tomcat-testing/conf/server.xml,start]
我尝试过编辑bin/catalina.sh
与
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms2048m -Xmx2048m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+DisableExplicitGC"
Run Code Online (Sandbox Code Playgroud)
但它仍然xmx=512m
在堆栈中.
我还添加pom.xml
了<argLine>-Xms2048m -Xmx2048m</argLine>
for failsafe-maven-plugin
和for maven-surefire-plugin
仍然相同的错误...
在arquillian测试中更改xmx的正确位置在哪里?
谢谢!
eclipse ×2
java-ee ×2
jsf-1.2 ×2
security ×2
ajax4jsf ×1
angular-ui ×1
badge ×1
css ×1
esapi ×1
gitlab ×1
gitlab-ci ×1
heap-memory ×1
import ×1
java ×1
java-ee-6 ×1
jboss7.x ×1
jsessionid ×1
jsf-2 ×1
json ×1
jsonparser ×1
kotlin ×1
linux ×1
login ×1
maven ×1
owasp ×1
readme ×1
richfaces ×1
session ×1
sonarqube ×1
testing ×1
tomcat7 ×1
web.xml ×1
xhtml ×1