我有例如主题test.如何在Primefaces中使用Java代码设置此主题?我不想使用上下文参数primefaces.THEME,我不想使用<p:themeSwitcher>.
我正在使用password-parameter(如下所示)自定义包含密码的请求参数的名称.如何用remember-me(默认_spring_security_remember_me)做同样的事情?
<security:form-login password-parameter="j_password_input" ... />
Run Code Online (Sandbox Code Playgroud) 我需要在数据源的每条记录后强制分页。我试过了<break type="Page">,但不起作用。怎么做 ?
我有一个处理点击链接的控制器。在处理程序方法中,我必须做一些事情(在 db 上)并在新窗口中打开点击的 url(类似于链接中的_blank属性)。我使用“重定向:url”,但它当然在同一窗口中重定向。有任何想法吗 ?
@RequestMapping(value = "/open.html")
public String open(@RequestParam(value="id") Integer id) {
Link link = linkDAO.get(id);
linkDAO.click(id);
return "redirect:"+link.getAddress();
}
Run Code Online (Sandbox Code Playgroud) 我在Spring上下文中有简单的Velocity配置(根据官方的Spring文档)并且工作正常.如何使用Apache FOP配置/集成它并生成pdf文档?我会感激一些例子.
<!-- velocity -->
<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>
</bean>
<bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="cache" value="true"/>
<property name="prefix" value=""/>
<property name="suffix" value=".vm"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
测试控制器:
@Controller
@RequestMapping("/doc")
public class DocumentController {
@RequestMapping("/test")
public ModelAndView velocityTest() {
List<String> xmens = new ArrayList<String>();
xmens.add("Professor X");
xmens.add("Cyclops");
xmens.add("Iceman");
xmens.add("Archangel");
xmens.add("Beast");
xmens.add("Phoenix");
Map<String, List<String>> model = new HashMap<String, List<String>>();
model.put("xmens", xmens);
return new ModelAndView("testdoc", model);
}
}
Run Code Online (Sandbox Code Playgroud)
/WEB-INF/velocity/test.vm
<html>
<body>
<ul>
#foreach ($xmen in $xmens)
<li>$xmen</li>
#end
</ul>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我必须将一些SQL从PostgreSQL迁移到SQL Server(2005+).在PostgreSQL我有:
select count(id) as count, date
from table
group by date
order by count
limit 10 offset 25
Run Code Online (Sandbox Code Playgroud)
现在我需要相同的SQL,但对于SQL Server.我是这样做的,但得到错误:Invalid column name 'count'.如何解决?
select * from (
select row_number() over (order by count) as row, count(id) as count, date
from table
group by date
) a where a.row >= 25 and a.row < 35
Run Code Online (Sandbox Code Playgroud)