File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Displaying FacesMessage when a RemoteException or SOAPException occurs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Displaying FacesMessage when a RemoteException or SOAPException occurs" Watch "Displaying FacesMessage when a RemoteException or SOAPException occurs" New topic
Author

Displaying FacesMessage when a RemoteException or SOAPException occurs

Daniel Conner
Ranch Hand

Joined: Jan 25, 2007
Posts: 47
With a web app I am working on, I need to Display a FacesMessage when a RemoteException or SOAPException occurs. I believe that the syntax is correct. I know I am getting a RemoteExcpetion and a SOAPException thrown because of the output I get to the console. I just am not sure why the FacesMessage is not being displayed. This is the code for the jsp:

<f:facet name="messages">
<af:message id="msg" />
</f:facet>

This is the relevant java code:

catch(RemoteException re) {
System.out.println("RemoteException error: " + re);
FacesMessage message = new FacesMessage("Error connecting to the server");
context.addMessage(null, message);
}
catch(SOAPException se) {

FacesMessage message = new FacesMessage("Error connecting to the server");
context.addMessage(null, message);
System.out.println("SOAPException error" + se);
}
Ravindra Rawat
Ranch Hand

Joined: Dec 09, 2004
Posts: 34
Add the following after adding the message.


context.renderResponse();
// This will stop further processing in JSF lifecycle.


Regards
Ravindra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying FacesMessage when a RemoteException or SOAPException occurs