mailconfirm.mail.body=<html><body><h3 style="margin: 0 0 1em;">Hi, {0}!</h3>\
To confirm your email address click on the confirmation link given bellow. If clicking on the link doesn't work, copy and paste the link in a new browser tab. <br /><br />\
<a href="http://www.domain.com/confirm_email.html?action=activate&hash={1}">http://www.domain.com/confirm_email.html?action=activate&hash={1}</a><br /><br />\
Kind regards,<br />\
Your Something
</body></html>
Run Code Online (Sandbox Code Playgroud)
以上是用于下面的代码的特定消息.
String country = "AU";
Object[] args = new Object[] { account.getLogin(), confirm.getHash() };
helper.setText(appContext.getMessage("mailconfirm.mail.body", args,
new Locale(country)), true);
Run Code Online (Sandbox Code Playgroud)
我调试了两个参数,它们都有正确的值.在调试appContext.getMessage线时,我看到{1}param没有填充正确的值,但是{0}.
什么想法可能是错的?我怀疑这可能是某些语言环境问题.
我正在尝试释放我的软件(我之前从未这样做过),到目前为止我已经能够执行mvn release:prepare.当我正在执行release:执行时出现以下错误:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug in:2.7:deploy (default-deploy) on project img2stl: Failed to deploy artifacts: C ould not transfer artifact nl.byterendition:img2stl:jar:0.9 from/to byterenditio n-releases (https://localhost:443/svn/repo/releases): peer not authenticated -> [Help 1]
我在localhost:443设置了一个本地密码保护的svn存储库,所以我将以下内容添加到我的.m2文件夹中的settings.xml
编辑包括Edwin Buck的回答:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>byterendition-releases</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>byterendition-snapshots</id>
<username>username</username>
<password>password</password>
</server>
</servers>
</settings>
Run Code Online (Sandbox Code Playgroud)
这是我的pom的有用部分:
<distributionManagement>
<repository>
<id>byterendition-releases</id>
<url>https://localhost:443/svn/repo/releases</url>
</repository>
<snapshotRepository>
<id>byterendition-snapshots</id>
<url>https://localhost:443/svn/repo/snapshots</url>
</snapshotRepository>
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)
如何让maven访问svn存储库?
好吧,正如Edwin Buck建议我不应该使用localhost,但由于我无法让它工作,否则我想我会尝试使用我用于工作的远程SVN服务器.现在我得到一个不同的错误:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug in:2.7:deploy …
我创建了一个包装类型为"jar"的Maven项目,称为"Y"我已完成"Maven安装",我可以在我的本地存储库中找到它.
然后,我创建了另一个包装类型为"war"的项目,名为"X".在这个项目中,我向"Y"jar添加了一个依赖项,如下所示:
<dependency>
<groupId>my.pck</groupId>
<artifactId>Y</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我的问题是,当我关闭项目"Y"时,我收到此错误:
Project 'X' is missing required Java project: 'Y'
Run Code Online (Sandbox Code Playgroud)
但是,它并没有说"缺失工件"......在所有情况下,当我尝试部署"X"时,我得到了这个:java.lang.ClassNotFoundException:对于项目"Y"中的每个类,并在项目"X"中使用" ...
Spring的ResourceBundleMessageSource使用MessageFormat替换占位符({0})内的信息.
MessageFormat要求'使用两个单引号('')转义单引号()(请参阅:MessageFormat Javadoc).但是,默认情况下,不会解析不包含任何参数的MessageFormat消息,因此不需要对不带参数的消息中的单引号进行转义.
因此,您的翻译人员必须了解编写和维护资源包的两个规则:
'')如果带有单引号的消息也包含至少一个占位符({0});'如果带有单引号的消息不包含占位符,则使用write().编写Spring Resource Boundle时是否有单一规则来处理单引号?
java spring resourcebundle internationalization double-quotes
我刚刚在Netbeans 7.4中启动了标准Maven - > Java Application.默认情况下,它创建了"App"类(具有main方法).我还去了项目的Properties-> Run并将该类设置为Main Class.然后我建立了这个项目.
在项目目录中,我得到了带有几个罐子的"目标"文件夹.它们都不是可执行的.我如何简单地解决问题并在每次构建结束时获取可执行jar?
谢谢.
我在src/main/rescource中有一个名为extra-jars的文件夹,但是如何在构建中包含这些文件夹呢?我希望它们与其余的jar放在lib文件夹中.我尝试将它们包括在内,但那并没有奏效.
我想在Netbeans中为logger编写代码模板:
org.slf4j.LoggerFactory.getLogger(XXXXXX.class).warn("${cursor}");
Run Code Online (Sandbox Code Playgroud)
我找不到语法插入当前类的名称为模板(请参阅XXXXXX上面占位符)的参考.
我正在尝试使用strut taglib在我的jsp页面中输入以下meta标签
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" name="Webmaster" content="Telephone: <s:text name="webmaster.phone" /> , email:<s:text name="webmaster.email" />, address:<s:text name="webmaster.mail" />">
Run Code Online (Sandbox Code Playgroud)
但是警告显示meta标签应该是空元素标签。我该怎么做才能解决这个问题?还有其他方法可以在meta标记中输入网站站长信息吗?
当我试图学习一些框架J2EE时,我正在研究spring框架.
在一些教程中让我困惑的事情是他们将Spring MVC作为spring框架的一部分.但在某些地方,他们提到的就像一个不同的独立框架.有些人甚至比较Spring MVC和Struts(这是我理解的另一个框架).
现在我应该如何将Spring MVC作为一个不同的框架,如Struts或作为Spring的一部分?
在 Maven 项目中创建包时,是否有标准/推荐格式要遵循?我知道目录结构应该遵循被禁止的格式,并且不确定插入我的包的最佳方法是什么。
我的包结构应该是main.java.com.foo.barandtest.java.com.foo.bar还是去掉开头然后有com.foo.barand com.foo.bar.test?
我正在尝试学习Spring Batch,本书提供了示例接口类,但是命名约定让我失望.
public interface ItemProcessor<I,O> {
O process(I item) throws Exception;
Run Code Online (Sandbox Code Playgroud)
}
我以前从未见过类名中的参数.它们是出于实际目的还是只是作为指导?如果类名被更改,以下代码会有何不同?
public interface ItemProcessor {
O process(I item) throws Exception;
Run Code Online (Sandbox Code Playgroud)
}
我正在使用spring security 3.0.在spring-security.xml中,显示登录页面时出现1个问题.Web浏览器中没有加载或丢失CSS的login.jsp.所以请解决这个问题..任何帮助,我感谢你.
我的spring-security.xml代码如下:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/login.html" access="permitAll" />
<intercept-url pattern="/logout" access="permitAll" />
<intercept-url pattern="/accessdenied" access="permitAll" />
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<form-login login-page="/login.html" default-target-url="/firstwelcome.html" />
<logout logout-success-url="/logout" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider>
<password-encoder hash="md5"/>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="
SELECT strUSERNAME, strPASSWORD, CASE blENABLED WHEN 1 THEN 'true' ELSE 'false' END 'ENABLED'
FROM TBLUSERS
WHERE strUSERNAME=?;"
authorities-by-username-query="
SELECT strUSERNAME, strROLENAME
FROM TBLUSERS
WHERE strUSERNAME=?;"
/>
</authentication-provider>
</authentication-manager>
</beans:beans>
Run Code Online (Sandbox Code Playgroud)
我的login.jsp的标题如下
<link rel="stylesheet" type="text/css" …Run Code Online (Sandbox Code Playgroud)