小编Ran*_*ang的帖子

如果JSF页面受j_security_check保护,则不会在ajax请求上抛出ViewExpiredException

我有一个不受保护的JSF页面j_security_check.我执行以下步骤:

  1. 在浏览器中打开JSF页面.
  2. 重启服务器.
  3. 单击JSF页面上的命令按钮以启动ajax调用.

Firebug显示a ViewExpiredException正如预期的那样被提升.

帖子:

javax.faces.ViewState=8887124636062606698:-1513851009188353364
Run Code Online (Sandbox Code Playgroud)

响应:

<partial-response>
<error>
<error-name>class javax.faces.application.ViewExpiredException</error-name>
<error-message>viewId:/viewer.xhtml - View /viewer.xhtml could not be restored.</error-message>
</error>
</partial-response>
Run Code Online (Sandbox Code Playgroud)

但是,一旦我将页面配置为受保护j_security_check并执行上面列出的相同步骤,奇怪的是(对我而言)ViewExpiredException不再引发.相反,响应只是一种新的视图状态.

帖子:

javax.faces.ViewState=-4873187770744721574:8069938124611303615
Run Code Online (Sandbox Code Playgroud)

响应:

<partial-response>
<changes>
<update id="javax.faces.ViewState">234065619769382809:-4498953143834600826</update>
</changes>
</partial-response>
Run Code Online (Sandbox Code Playgroud)

有人可以帮我解决这个问题吗?我希望它引发异常,以便我可以处理该异常并显示错误页面.现在它只是响应一个新的ViewState,我的页面卡住了没有任何视觉反馈.

ajax j-security-check jsf-2 viewexpiredexception

6
推荐指数
1
解决办法
8051
查看次数

Oracle存储过程是否是线程安全的?

伪代码:

  1. 开始存储过程

  2. 承诺

  3. 检查第a行//第1步的值列1

  4. 更新第a行第2行的第1列

  5. 承诺

  6. 结束存储过程

这个sp线程安全吗?

编辑:

Declare
  tag_rec prep_tag%ROWTYPE;
begin

  COMMIT; 

  SELECT * INTO tag_rec 
  FROM PREP_TAG 
  WHERE project = 'a' and categoryId = 'b'; 

  if tag_rec.locked = 'No' then

    UPDATE prep_tag 
    SET locked = 'Yes' 
    WHERE TAG_NUMBER = tag_rec.TAG_NUMBER;

  end if;

  COMMIT; 

end;
Run Code Online (Sandbox Code Playgroud)

这个sp线程安全吗?是否有可能线程A检查了tag_rec.locked ='否',那么它即将更新它.但在它之前,线程B偷偷进入并且还看到tag_rec.locked ='不'?

oracle concurrency thread-safety

4
推荐指数
1
解决办法
5251
查看次数

无法在RichFaces 4中使用sortBy工作

我正在关注这个例子:http: //mkblog.exadel.com/2008/11/richfaces-built-in-sorting/

它表示箭头应该出现在标题旁边,用户可以单击它进行排序.

但我不能让箭头出现.你帮忙谢谢.

我使用的代码:

newwonder.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core"
   xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
<h:head>
<title>Requirement Workflow</title>



</h:head>
<h:body>

<rich:dataTable value="#{newWondersBean.sevenNewWonders}" var="wonder">
  <rich:column sortBy="#{wonder.name}">
     <f:facet name="header">Name</f:facet>
    <h:outputText value="#{wonder.name}" />
 </rich:column>
  <rich:column sortBy="#{wonder.location}">
     <f:facet name="header">Location</f:facet>
     <h:outputText value="#{wonder.location}" />
  </rich:column>
  <rich:column>
     <f:facet name="header">Image</f:facet>
 <h:graphicImage url="#{wonder.imageUrl}" />
  </rich:column>
   </rich:dataTable>

    </h:body>
    </html>
Run Code Online (Sandbox Code Playgroud)

NewWondersBean.java

        package wonder;

        import java.util.ArrayList;
        import javax.annotation.PostConstruct;
        import javax.faces.bean.ManagedBean;
        import javax.faces.bean.ViewScoped;

        @ManagedBean
        @ViewScoped
        public class NewWondersBean {

           private ArrayList <Wonder> sevenNewWonders = …
Run Code Online (Sandbox Code Playgroud)

jsf richfaces

4
推荐指数
1
解决办法
3633
查看次数