本文整理汇总了Java中net.sourceforge.stripes.action.Before类的典型用法代码示例。如果您正苦于以下问题:Java Before类的具体用法?Java Before怎么用?Java Before使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Before类属于net.sourceforge.stripes.action包,在下文中一共展示了Before类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: list
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(stages = LifecycleStage.EventHandling)
public void list(){
if (this.getVanencompetition()!=null){
this.poules = Stripersist.getEntityManager().createQuery("FROM Poule where vanencompetition = :v").setParameter("v",this.getVanencompetition()).getResultList();
if (this.type!=null || (this.poule!=null && this.poule.getType()!=null)){
CompetitionType ct =null;
if (this.type!=null){
ct= CompetitionType.valueOf(this.type);
}else{
ct = this.poule.getType();
}
this.participantsWithoutPoule = Stripersist.getEntityManager()
.createQuery("FROM Participant where poule is null and vanencompetition = :v and type = :t order by karateka.belt,karateka.birthdate")
.setParameter("v", this.getVanencompetition()).setParameter("t", ct).getResultList();
}else{
this.participantsWithoutPoule = Stripersist.getEntityManager()
.createQuery("FROM Participant where poule is null and vanencompetition = :v order by karateka.belt,karateka.birthdate")
.setParameter("v", this.getVanencompetition()).getResultList();
}
}
}
开发者ID:rbraam,项目名称:vanenapp,代码行数:22,代码来源:PouleActionBean.java
示例2: loadFromDb
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(on = { "show" })
public void loadFromDb() {
User user = userDao.get((String) getContext().getRequest().getSession().getAttribute("userid"));
company = user.getMainJavaScript();
companyName = user.getUsername();
output = user.getLastError();
lastRun = user.getLastPrivateRun();
fullRun = user.getPermission() > 0;
openSource = user.getOpenSource() > 0;
testRun = WebContainerProperties.INSTANCE.getSystemDisabledDate().after(new Date());
String userAgent = getContext().getRequest().getHeader("User-Agent").toLowerCase();
boolean isMobile = userAgent.matches("(?i).*(ipad|iphone|android).*");
editorHeight = isMobile ? (countLines(company) + 30) * 16 : 500;
}
开发者ID:oglimmer,项目名称:cyc,代码行数:17,代码来源:PortalActionBean.java
示例3: prepare
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Override
@Before
public Resolution prepare() {
originalPath = "/";
File rootDir = pagesDir;
Page rootPage;
try {
rootPage = DispatcherLogic.getPage(rootDir);
} catch (Exception e) {
throw new Error("Couldn't load root page", e);
}
pageInstance = new PageInstance(null, rootDir, rootPage, SafeModeAction.class);
dispatch = new Dispatch(pageInstance);
return null;
}
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:16,代码来源:RootConfigurationAction.java
示例4: prepare
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void prepare() {
if(getCrudConfiguration() != null && getCrudConfiguration().getActualDatabase() != null) {
session = persistence.getSession(getCrudConfiguration().getDatabase());
selectionProviderSupport = createSelectionProviderSupport();
selectionProviderSupport.setup();
}
}
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:9,代码来源:CrudAction.java
示例5: prepare
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void prepare() {
if (crudConfiguration != null && crudConfiguration.getActualDatabase() != null) {
selectionProviderSupport = createSelectionProviderSupport();
selectionProviderSupport.setup();
}
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:8,代码来源:CrudAction.java
示例6: populateTypelessMap
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Before(stages=LifecycleStage.BindingAndValidation)
public void populateTypelessMap() {
this.typelessMap = new HashMap();
this.typelessMap.put(1, new TestBean());
this.typelessMap.put(2l, new TestBean());
this.typelessMap.put("foo", new TestBean());
}
开发者ID:scarcher2,项目名称:stripes,代码行数:9,代码来源:MapBindingTests.java
示例7: beforeWithReturnAndParameter
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
/** Parameters are not allowed. */
@SuppressWarnings("unused")
@Before
public String beforeWithReturnAndParameter(String var) {
hasCalledBeforeWithReturnAndParameter++;
return null;
}
开发者ID:scarcher2,项目名称:stripes,代码行数:8,代码来源:BeforeAfterMethodInterceptorTests.java
示例8: beforeAfterWithParameter
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
/** Not invoked because parameters are not kosher. */
@SuppressWarnings("unused")
@Before @After
public String beforeAfterWithParameter(String var) {
hasCalledBeforeAfterWithParameter++;
return null;
}
开发者ID:scarcher2,项目名称:stripes,代码行数:8,代码来源:BeforeAfterMethodInterceptorTests.java
示例9: beforeAfterSpecificStage
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
/** Invoked only at those stages listed. */
@SuppressWarnings("unused")
@Before(stages=LifecycleStage.BindingAndValidation)
@After(stages=LifecycleStage.CustomValidation)
public void beforeAfterSpecificStage() {
hasCalledBeforeAfterSpecificStage++;
}
开发者ID:scarcher2,项目名称:stripes,代码行数:8,代码来源:BeforeAfterMethodInterceptorTests.java
示例10: load
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(stages = LifecycleStage.BindingAndValidation)
public void load() {
user=(User) context.getRequest().getUserPrincipal();
Organisation o = user.getOrganisation();
Date now = new Date();
if (getUser().checkRole(Role.SUPERADMIN.name())){
setVanencompetitions((List<Vanencompetition>) Stripersist.getEntityManager().createQuery("From Vanencompetition where date >= :d ORDER BY date")
.setParameter("d",now).getResultList());
}else if (o!=null){
setVanencompetitions((List<Vanencompetition>) Stripersist.getEntityManager().createQuery("From Vanencompetition where date >= :d and organisation = :o ORDER BY date")
.setParameter("d",now).setParameter("o", o).getResultList());
}
}
开发者ID:rbraam,项目名称:vanenapp,代码行数:14,代码来源:VanencompetitionActionBean.java
示例11: beforeHandlerResolution
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(stages = { LifecycleStage.HandlerResolution })
public void beforeHandlerResolution() {
fbAppId = WebContainerProperties.INSTANCE.getFbAppId();
googleClientId = WebContainerProperties.INSTANCE.getGoogleClientId();
if (fbAppId.isEmpty() && googleClientId.isEmpty()) {
showCycLogin = true;
}
WinnerResult result = WinnerHistoryCalculation.INSTANCE.calc();
threeDayWinner = result.getThreeDayWinner();
threeDayWinnerTimeRange = result.getThreeDayWinnerTimeRange().toString();
registerDisabled = WebContainerProperties.INSTANCE.getSystemDisabledDate().before(new Date());
systemMessage = WebContainerProperties.INSTANCE.getSystemMessage();
}
开发者ID:oglimmer,项目名称:cyc,代码行数:16,代码来源:LandingActionBean.java
示例12: encodeCaptchaTokenCrypted
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(stages = { LifecycleStage.ResolutionExecution })
public void encodeCaptchaTokenCrypted() {
try {
if (WebContainerProperties.INSTANCE.isCaptchaEnabled()) {
captchaTokenCryptedUrl = URLEncoder.encode(captchaTokenCrypted, "UTF-8");
}
} catch (UnsupportedEncodingException e) {
log.error("Failed to encode captchaTokenCrypted", e);
}
}
开发者ID:oglimmer,项目名称:cyc,代码行数:11,代码来源:RegisterActionBean.java
示例13: loadRunHistory
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void loadRunHistory() {
// get last three days
WinnerResult result = WinnerHistoryCalculation.INSTANCE.calc();
runHistory = result.getGameWinnersList();
timeRange = result.getThreeDayWinnerTimeRange().toString();
}
开发者ID:oglimmer,项目名称:cyc,代码行数:8,代码来源:RunHistoryActionBean.java
示例14: retrieveVersion
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void retrieveVersion() {
if (longVersionCache == null) {
VersionFromManifest vfm = new VersionFromManifest();
vfm.initFromFile(getContext().getServletContext().getRealPath("/META-INF/MANIFEST.MF"));
longVersionCache = vfm.getLongVersion();
}
longVersion = longVersionCache;
getContext().getRequest().setAttribute("API_Version", API_VERSION);
}
开发者ID:oglimmer,项目名称:cyc,代码行数:13,代码来源:BaseAction.java
示例15: loadFromDb
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(on = { "show" })
public void loadFromDb() {
List<User> userList = userDao.findByUsername(getContext().getRequest().getParameter("username").toLowerCase());
if (userList.size() == 1) {
User user = userList.get(0);
if (user.getOpenSource() > 0) {
companyCode = user.getMainJavaScript();
companyName = user.getUsername();
}
}
}
开发者ID:oglimmer,项目名称:cyc,代码行数:12,代码来源:ShowCodeActionBean.java
示例16: getNextRunFromGameEngine
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void getNextRunFromGameEngine() {
HttpSession httpSession = getContext().getRequest().getSession(false);
if (httpSession != null) {
String userId = (String) httpSession.getAttribute("userid");
if (userId != null) {
User user = userDao.get(userId);
username = user.getUsername();
}
}
String gameRunId = getContext().getRequest().getParameter("gameRunId");
GameRun gr = null;
if (gameRunId == null || gameRunId.isEmpty()) {
List<GameRun> listGameRuns = dao.findAllGameRun(1);
if (!listGameRuns.isEmpty()) {
gr = listGameRuns.get(0);
}
} else {
try {
gr = dao.get(gameRunId);
} catch (org.ektorp.DocumentNotFoundException e) {
// happens a lot via bots/crawlers
}
}
if (gr != null) {
gr.getResult().sortByTotalAssetsDesc();
result = gr.getResult();
startTime = gr.getStartTime();
endTime = gr.getEndTime();
for (String p : userDao.findByOpenSource(gr.getParticipants())) {
showCode.put(p, true);
}
}
}
开发者ID:oglimmer,项目名称:cyc,代码行数:36,代码来源:GameRunDetailsActionBean.java
示例17: getNextRunFromGameEngine
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before(stages = { LifecycleStage.EventHandling })
public void getNextRunFromGameEngine() {
Date nextRunDate = GameScheduler.INSTANCE.getNextRun();
DateFormat dateTimeDf = DateFormat.getDateTimeInstance();
setNextRun(dateTimeDf.format(nextRunDate));
WinnerResult result = WinnerHistoryCalculation.INSTANCE.calc();
threeDayWinner = result.getThreeDayWinner();
threeDayWinnerTimeRange = result.getThreeDayWinnerTimeRange().toString();
lastWinner = result.getLastWinner();
}
开发者ID:oglimmer,项目名称:cyc,代码行数:12,代码来源:PortalActionBean.java
示例18: prepare
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
@Before
public void prepare() {
connectionProviderName = context.getRequest().getParameter("connectionProviderName");
}
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:5,代码来源:ApplicationWizard.java
示例19: addHandlerResolutionAttribute
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
/**
* Add an attribute that name matches stage.
*/
@Before(stages=LifecycleStage.HandlerResolution)
public void addHandlerResolutionAttribute() {
context.getRequest().setAttribute("HandlerResolution", "HandlerResolutionAttribute");
context.getRequest().getSession().setAttribute("HandlerResolution", "HandlerResolutionAttribute");
}
开发者ID:StripesFramework,项目名称:stripes-stuff,代码行数:9,代码来源:RequestTestActionBean.java
示例20: addBindingAndValidationAttribute
import net.sourceforge.stripes.action.Before; //导入依赖的package包/类
/**
* Add an attribute that name matches stage.
*/
@Before(stages=LifecycleStage.BindingAndValidation)
public void addBindingAndValidationAttribute() {
context.getRequest().setAttribute("BindingAndValidation", "BindingAndValidationAttribute");
context.getRequest().getSession().setAttribute("BindingAndValidation", "BindingAndValidationAttribute");
}
开发者ID:StripesFramework,项目名称:stripes-stuff,代码行数:9,代码来源:RequestTestActionBean.java
注:本文中的net.sourceforge.stripes.action.Before类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论