Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Michael Brooks

Greenhorn
+ Follow
since May 11, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Brooks

Anne & Zak

I was just wondering why there is no mention of "flexbox"... at least in the index?

Thanks,

I have a JSF web application which includes a bean which
navigates to a new page by passing the web page as a return value.
The page loads as expected. However, the page displays an empty
table. In the facelet definition of the table
is value=cdibean.getAllXXX() which populates the table.
I added log messages in this method. I was assuming that since
I put a @PostConstruct annotation on the method, when the web page
was loading the method would be called prior to presentation;
however, the web page loads and the getAllXXX method is never
executed. No log messages in log. What am I missing?
10 years ago
JSF
Do you know where there is a documentend example web app of at least some of these layers that includes package names.
10 years ago
JSF
Thanks for a great explanation. How do you define your model in the backing bean level 2 without using the entity beans in level 6?
10 years ago
JSF
Thank you that was very helpful. I do not know if I am mixing templates; but it seems to me like most texts talk about Presentation <--> Business Logic <--> Persistence. I was thinking that the Persistence layer and the model were pretty much one in the same. Your description makes it sound more like Backing Bean <---> Model <---> Business Logic. I guess I am being way to linear here. I guess it could be that the backing bean updates the model (after verification) and the backing bean calls action methods in the business logic which access the model for data and then any changes made in the model are sent back to the presentation layer for display. If I am getting closer, where does a DAO fit in if at all? Is it part of the business logic used to access the model? Thanks again. Not to make you write a book, but does domain driven architecture then focus on whether a given bit of logic is more entity related or business related? Thanks again again.
10 years ago
JSF
If I have a JSF registration form containing 20 fields and an associated backing bean, does separation of concerns dictate that in my backing bean, I define 20 non-object oriented variables that are populated from the web page using EL and then passing those to the business layer which would then pass them to a constructor in the java entity.
10 years ago
JSF
If I have a JSF backing bean that imports a domain object and uses EL to populate instance variables, is this a violation of separation of concerns and do I need to wait until the business logic or later to import the domain object
10 years ago
JSF
resolved
10 years ago
JSF
I noticed that the term "backing bean" is not in the content of the Java EE 6 Tutorial produced by Oracle. If backing beans are obsolete what has replaced them? Thanks.
10 years ago
JSF
THANKS for the quick response.

How did THAT happen?



Sorry, I did not mention that I am using a facelets template and in that template, I have:
<h:outputStylesheet library="css" name="styles.css"/>
I am also using Primefaces 3.0.M2

The code I quoted above came out of mozilla firebug when I tried to run and debug my web app.

To be precise, the URL gets routed to FacesServlet when it matches your pattern (*.faces). Which wouldn't happen if the URL ended with (.xhtml). The query string part of the URL is ignored.



My web.xml routes.xhtml to the FacesServlet rather than .faces due to the servlet mapping below ( I think)

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
10 years ago
JSF
Because I was having trouble locating my css file, the copied one from a tutorial and it worked.
In the war file, under the resources directory, there is a css\common-style.css.

The web.xml has the following entries:

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

And the outputStylesheet gets converted to the following:
<link href="/JavaServerFaces/faces/javax.faces.resource/common-style.css?ln=css" rel="stylesheet" type="text/css">
And like I said, this worked.


So I went back and looked at my previous code and in my war file
I have a MyWebApp\resources\css\styles.css.

In my web.xml, I have the following entries:

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

My outputStylesheet got converted to:
<link href="/MyWebApp/javax.faces.resource/styles.css.xhtml?ln=css" rel="stylesheet" type="text/css">

I understand that the first one is using prefix mapping with "faces" and I am using suffix mapping with ".xhtml"
but both are using jsf 2.1 and glassfish 3.1 and using firebug, the first one finds the css file while the second does not.

How do I decode the "javax.faces.resource" part of the URL? Doesn't the .xhtml get inserted onto my styles.css because I sent my web page thru the Faces Servlet?
10 years ago
JSF
Lets say I have a web project which uses Maven, EJB, JSF, JPA. It appears to me that when I go into Netbeans or Eclipse to create the new project, the associated wizard wants me to pick ONE, such as JPA Project, Maven project, or EJB project. How do I decide which one is the best place for me to start? Thanks in advance.