我有一个法语和英语网站.我希望用户在单击标题中的链接时能够动态切换语言.非常直截了当.
我遵循了Ruby on Rails 3指南,我有这个:
class ApplicationController < ActionController::Base
before_filter :set_locale
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
protect_from_forgery
def default_url_options(options={})
logger.debug "default_url_options is passed options: #{options.inspect}\n"
{ :locale => I18n.locale }
end
end
Run Code Online (Sandbox Code Playgroud)
我的路线看起来像这样:
scope "(:locale)", :locale => /en|fr/ do
match 'home' => 'home#index'
match 'home/ajax_twitter' => 'home#ajax_twitter'
match 'equipe' => 'equipe#index'
match 'equipe/sylvain' => 'equipe#sylvain'
match 'equipe/benoit' => 'equipe#benoit'
match 'equipe/stephane' => 'equipe#stephane'
match 'equipe/suemarie' => 'equipe#suemarie'
match 'equipe/regis' => 'equipe#regis'
match 'equipe/fred' => 'equipe#fred'
match 'equipe/callback' …
Run Code Online (Sandbox Code Playgroud) 我们使用aspectJ来获取现有应用程序的一些指标.在eclipse中使用AJDT进行构建和编织时,一切都很有效.但在整合环境中.我们使用ant脚本来构建和部署应用程序.
问题发生在ExceptionHandler上我确实我们的方面不会抛出异常并破坏应用程序
@Aspect
public class ExceptionHandlerAspect {
/**
* Pointcut
*/
@Pointcut("within(com.xxx.yyy.aop.aspect.*..*)")
public void allMethodInAspectPackage() {}
/**
* Pointcut
*/
@Pointcut("!within(com.xxx.yyy.aop.aspect.ExceptionHandlerAspect)")
public void notInExceptionHandlerAspectClass() {}
/**
* Pointcut
*/
@Pointcut("call(* *(..))")
public void allClassAndMethod() {}
/**
@Around("allClassAndMethod() && allMethodInAspectPackage() && notInExceptionHandlerAspectClass()")
public Object logException(ProceedingJoinPoint joinPoint) throws Throwable{
Object ret = null;
try {
ret = joinPoint.proceed();
}catch (Throwable exception) {
if (joinPoint.getSignature().getDeclaringTypeName().equalsIgnoreCase("org.aspectj.lang.ProceedingJoinPoint")) {
throw exception;
}
this.logException.info("Exception in " + joinPoint.getSignature().getDeclaringTypeName(),exception);
}finally {
return ret;
}
}
}
Run Code Online (Sandbox Code Playgroud)
基本上,我想拦截我的方面包中的每个调用,除了在ExceptionHandler本身.
ant …
我们考虑将broadleaf用于需要改造其B2B网站的客户之一.阔叶的一切看起来都非常好,但一个主要的挑战是这个客户在SAP中拥有他所有的产品,订购,促销等.
有没有人曾经集成或覆盖broadleaf来调用/持久化SAP中的实体而不是普通的关系数据库?
谢谢你的帮助
我正在使用gradle(2.8)来构建,测试我们的Spring java(1.8)应用程序
我上周安装了OSX Sierra,但本周的某个时候,我的gradle清洁测试需要7-10分钟而不是15秒!
建筑物挂在这条线上......
Building 55% > :sandbox-core:compileJava > Resolving dependencies ':sandbox-core:compile' > Resolving dependencies 'detachedConfiguration3' > Resolving dependencies 'detachedConfiguration4'
Run Code Online (Sandbox Code Playgroud)
每隔一段时间将Resolving dependencies'deleachedConfigurationXXX'递增1!
一旦那些detachedConfiguration完成,测试运行正常..
但是花了7-10分钟.
这让我疯了!