[JBoss Seam] - Passing messages using JBoss Seam managed exception handling
by zzzz8
I'm having some issues displaying Faces messages... Please tell me what I'm doing wrong:
Here's a snippet of my code. I'm not sure if I'm supposed to use facesMessages or just call the constructor for the exception class, so I tried both:
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Error!");
|
| throw new ApplicationException("Error!");
|
Here's the class definition for the ApplicationException class:
package test;
|
| public class ApplicationException extends Exception {
| public ApplicationException() {
| super();
| }
|
| public ApplicationException(final String inputExceptionText) {
| super(inputExceptionText);
| }
| }
Here's my exceptions.xml file (a snippet):
<exception class="test.ApplicationException">
| <redirect view-id="/pages/confirmation/applicationException.xhtml">
| </redirect>
| <end-conversation />
| </exception>
Here's the snippet of the xhtml file:
<ui:composition>
|
| <h:messages showDetail="true" />
|
| <h:form>
| <h:commandButton value="#{messages['GoBack']}" action="go_Home" />
| </h:form>
| </ui:composition>
| |
| | The page does get redirected to /pages/confirmation/applicationException.xhtml, so at least the redirection part does work. However, no error message is displayed... The button does get displayed, so the page contents are getting rendered. What am I doing wrong (i.e. why isn't the error message shown)? Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992404#3992404
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992404
19 years, 4 months
[JBoss jBPM] - Re: Get finished tasks
by zhongboqing
1, you can add the query in the file "org\jbpm\db\hibernate.queries.hbm.xml" ,like
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance as ti
where ti.actorId = :actorId
and ti.isOpen = true and ti.end is not null
]]>
2, you can add the method findFinishedTaskInstances int the java file "org\jbpm\db\TaskMgmtSession.java"
/**
* get the finished tasllist for a given actor.
*/
public List findFinishedTaskInstances(String actorId) {
List result = null;
try {
Query query = session.getNamedQuery("TaskMgmtSession.findFinishedTaskInstancesByActorId");
query.setString("actorId", actorId);
result = query.list();
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new JbpmException("couldn't get task instances list for actor '"+actorId+"'", e);
}
return result;
}
3, rebuild the jpdl
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992402#3992402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992402
19 years, 4 months