Andy Holm

Ranch Hand
+ Follow
since Jul 03, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andy Holm

Having separate classes defeats what I am trying to accomplish. I am trying to combine all elements into a single DTO that can be passed around the business layer of an application without having to know the structure of the XML source. Is there any way to map specific field values of a single bean to different levels of an XML document. For instance, can JavaBean.id be mapped to XML tag MESSAGE/HEADER/ID directly without creating separate classes or inner classes to maintain the XML structure?
10 years ago
I have XML like the following:



I have a Java Bean like the following:



I would like to parse all of the values into one Java class using JAXB. How do I do that without having to create inner classes for the header and body portions of the XML?

10 years ago
What? I don't think we are on the same page, Tim.

This is a bean validation validator that uses the Hibernate bean validation annotation APIs. It has no access to the view tree (nor should it). There are examples of how this can be attached to a class so it shouldn't be a problem (http://stackoverflow.com/questions/1972933/cross-field-validation-with-hibernate-validator-jsr-303). Unfortunately, I can't get it to work anywhere other than on a field or method. It isn't called on a constructor for me either.

If it helps, I am using Apache Tomcat 6 and have downloaded hibernate-validator-4.1.0.jar to patch it to support annotations in EE 6. More information on what I did is shown here under Bean Validation (http://weblogs.java.net/blog/cayhorstmann/archive/2009/12/29/jsf-20-and-tomcat).

If this needs to be moved to a different part of the forum than the JSF section, feel free to move it.
11 years ago
JSF
This class level bean validation call is not being called.






It is being called like this:



The only way I can get it to be called is when I place it on a field. Any ideas what is going on?
11 years ago
JSF
Annotations on several of my beans are not getting called in JSF 2.0. One of my bean's annotations, however, are getting called. Any idea why that may be?

Here's a snippet of the bean that has an annotation being correct called. This bean is called when a page with a datatable loads.




Here is an example of a bean whose annotations are never called. It is a POJO bean rather than a backing bean as above. The bean is populated when a separate backing bean's method is called from a command button.

11 years ago
JSF
I tried using a JSP page for my error page but got the same blank page when the business logic threw an error and the login filter was turned on. Any other ideas to try? I am using Apache Tomcat 6 if that matters.
11 years ago
JSF
I am using a login filter with Facelets and JSF 2.0 that is giving me a blank page when an error is generated by business logic. When I take the filter off, the error page is shown properly. It is happening on a request (rather than a forward). It worked in JSF 1.2 with JSPs. Any ideas what I might be doing wrong?

Here's the filter mapping from my web.xml.




Here's my error-page definitions in my web.xml:



My actual error page is called /pages/error.xhtml. The error is happening on a call to chain.doFilter() in the Filter. Is there a good way to see what page the filter might be trying to load on the error? Any other tips to debug?


11 years ago
JSF
No one has any idea? What more information could I include to help point to the problem?
11 years ago
JSF
What's the equivalent of this in Facelets?

11 years ago
JSF
A method annotated with @PostConstruct on my managed bean is not being called in JSF 2.0.

Here is a snippet of my managed bean:



Here's a snippet from my web.xml:



Here's my faces-config.xml



Here's a list of the jars I am using:

antlr-2.7.6.jar
commons-collections-3.1.jar
commons-el-1.0.jar
dom4j-1.6.1.jar
el-impl-2.2.0.jar
hibernate3.jar
javassist-3.9.0.GA.jar
jconn3.jar
jsf-api.jar
jsf-impl.jar
jta-1.1.jar
log4j-1.2.16.jar
slf4j-api-1.5.11.jar
slf4j-simple-1.5.11.jar
tomahawk-1.1.9.jar


Any ideas?
11 years ago
JSF
So to make sure I am understanding you, are you saying that the following entry will never work? I've seen this mapping listed in JSF books as valid, but it doesn't seem to be working for me.



Instead you are saying I should use:



If there is any way to get the /pages/* url-pattern servlet mapping to work, please provide a complete example of what I need to change in my web.xml file. Thanks for your help.
11 years ago
JSF
I added the extra leading slash so the welcome-file-list now looks like:




When I hit the URL http://localhost:8080/testapp, it now finds the resource, but it doesn't recognize it as a web page that it should render in the browser. Instead, it asks if I want to save or open the resource. Any ideas on how to get the page to load in a browser by default? I thought the servlet mapping and javax.faces.DEFAULT_SUFFIX would take care of that but apparently not.

11 years ago
JSF
I am trying to get my application to map all files under /pages/* to JSF and facelets. However, I get a '/register.xhtml Not Found in ExternalContext as a Resource' error when I use the following web.xml with the URL http://localhost:8080/testapp. Any ideas on what might be wrong? Strangely, I can access the file as pages/register.jsf when I change the Faces Servlet mapped url-pattern to *.jsf.





Physical File Structure:



11 years ago
JSF
Is there a way to pass multiple property values based on the <html:radio> button that is selected? The following didn't seem to work...

11 years ago
No luck.
11 years ago