我的webapp中有这个工作代码:
<h:button value="Edit user..." outcome="/public/user" >
<f:param name="userName" value="#{authBean.authUser}"/>
</h:button>
Run Code Online (Sandbox Code Playgroud)
它能做什么:
我需要的:
这是我能得到的最接近的:
<p:commandButton value="Edit user..." action="/public/user?faces-redirect=true" ajax="false" immediate="true" >
<f:param name="userName" value="#{authBean.authUser}"/>
</p:commandButton>
Run Code Online (Sandbox Code Playgroud)
它发送一个POST,通过GET重定向到新URL.但是参数在此过程中丢失.
另一个想法:
<p:linkButton value="Edit user..." href="http://localhost:8080/contextpath/faces/public/user.xhtml">
<f:param name="userName" value="#{authBean.authUser}"/>
</p:linkButton>
Run Code Online (Sandbox Code Playgroud)
GET请求被中止(???根据Firebug)并且当前页面再次被POST.
这样做的正确方法是什么?
更新:这是有效的(在空白页面上,没有p:dataTable):
<p:linkButton value="Edit user..." href="http://localhost:8080/contextpath/faces/public/user.xhtml?userName=myusername">
Run Code Online (Sandbox Code Playgroud)
但这不是:
<p:linkButton value="Edit user..." href="http://localhost:8080/contextpath/faces/public/user.xhtml?userName=myusername&secondParam=otherValue">
Run Code Online (Sandbox Code Playgroud)
后者导致:
500:javax.servlet.ServletException:Error Parsing /sample0.xhtml:Error Traced [line:14]对实体"secondParam"的引用必须以';'结尾 分隔符.
UPDATE2:&应该被转义:
<p:linkButton value="Edit user..." href="http://localhost:8080/contextpath/faces/public/user.xhtml?userName=myusername&secondParam=otherValue">
Run Code Online (Sandbox Code Playgroud)
它看起来不错......但我仍然得到GET中止和POST重新发送:
alt text http://img64.imageshack.us/img64/1017/primefaceslinkbutton.jpg
这是我一直在尝试的完整空白页面:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> …Run Code Online (Sandbox Code Playgroud) 下面这段代码试图帮助这个.
代码永远循环并检查是否有任何待处理的请求要处理.如果有,则创建一个新线程来处理请求并将其提交给执行程序.完成所有线程后,它会休眠60秒并再次检查待处理的请求.
public static void main(String a[]){
//variables init code omitted
ExecutorService service = Executors.newFixedThreadPool(15);
ExecutorCompletionService<Long> comp = new ExecutorCompletionService<Long>(service);
while(true){
List<AppRequest> pending = service.findPendingRequests();
int noPending = pending.size();
if (noPending > 0) {
for (AppRequest req : pending) {
Callable<Long> worker = new RequestThread(something, req);
comp.submit(worker);
}
}
for (int i = 0; i < noPending; i++) {
try {
Future<Long> f = comp.take();
long name;
try {
name = f.get();
LOGGER.debug(name + " got completed");
} catch (ExecutionException …Run Code Online (Sandbox Code Playgroud) 我曾尝试使用globalCompositeOperation在一个循环传递不同的字符串(source-atop,source-over等)在相同的2D背景,但我注意到,火狐让我画只有很少的形状,而歌剧院只有最后.
现在,我的问题是,我是否可以globalCompositeOperation在当前情境中仅使用一个?
我不仅需要"创建表"语句,还需要插入.我应该传递给mysqldump的标志是什么?
另外 - 数据库相对较大(2-2.5G).显然,我希望备份尽可能快.任何可能有帮助的标志?
谢谢
如果我有方法
def some_method p = {}
string = <<-MY_TERMINATOR
Example text blah blah
lorem ipsum something or another
MY_TERMINATOR
end
Run Code Online (Sandbox Code Playgroud)
如何从heredoc中访问变量p [:name]?
我将使用Struts,Spring和Hibernate开发一个Web应用程序.但我不知道他们中的任何一个.即使我对JSP知之甚少,也不了解Servlet.所以我的问题是该怎么办?我必须学习所有这些东西.但我没有太多时间.通常要学习一些东西,我会阅读有关该主题的书籍或使用教程.现在我需要有关所有这些的好教程和书籍的链接.或者我需要有关如何学习这些东西的建议.首先要学习哪些以及如何学习?
我想将大量数据分发到不同的C#应用程序.例如,我的表包含数百万条记录.我想指定App1处理前3百万条记录,另外C#应用程序App2处理300万条,依此类推.表行将根据要求删除并添加.现在我想写一个SQL查询,它将处理前300万条记录.现在,如果从app1中删除了5条记录,则app1必须从app3获取接下来的5条记录,从app3获取app2.因此,每个应用程序中的数据始终保持不变.
我在SQL查询中使用了限制,但是我没有得到所需的输出.如何为此编写SQL查询以及如何设计C#应用程序.
替代文字http://img834.imageshack.us/img834/2905/browserproblem.png
我可以禁用它以及如何禁用它?
我开始使用谷歌appengine在Windows平台上构建python应用程序
我们调试和运行我的应用程序的步骤是什么
我有一张名为'出勤'的表格,用于记录学生在课程中的出勤时间.此表有4列,例如'id','course_id','attendance_time'和'student_name'.此表中的少数记录的示例是:
23 100 1/1/2010 10:00:00汤姆
24 100 1/1/2010 10:20:00鲍勃
25 187 1/2/2010 08:01:01丽莎
.....
我想创建每门课程最新出勤时间的摘要.我在下面创建了一个查询:
SELECT course_id, max(attendance_time) FROM attendance GROUP BY course_id
Run Code Online (Sandbox Code Playgroud)
结果将是这样的
100 1/1/2010 10:20:00
187 1/2/2010 08:01:01
现在,我想要做的就是在上面的结果中添加'id'列.怎么做?
我不能只是将命令改为这样的东西
SELECT id, course_id, max(attendance_time) FROM attendance GROUP BY id, course_id
Run Code Online (Sandbox Code Playgroud)
因为它会返回所有记录,就像没有使用聚合函数一样.请帮我.