Calvin Hughes

+ Follow
since Jul 24, 2011
Calvin likes ...
MySQL Database Flex
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Calvin Hughes

I am in the process of teaching myself Java and JavaEE. While I have been studying various programming books for the last year and a half and feel like I have a pretty good grasp of how to use the language. However as much as I understand how to move files and read and write to a database I seem to be at a loss when trying to figure out how to write programs from scratch. Is this where patterns come in? Is your book easy enough for a beginner like myself to make good use out of it?

On a side note I'm also curious about what kind of situations it would be good to use OSGI with in an application server like Glassfish?

Hey Tim.

Thank you Thank you. Your comment lead me in the right direction to figuring out my problem.

It came down to <from-action> with <h:commandLink action=""> is not the same thing as using a <from-outcome> tag with <h:link outcome=""> in the faces-config.xml file.

I changed my method to not return a string that can be interpreted as a reference to a view and had to change my navigation rule back to using <from-outcome> in faces-config.xml

public String logout(){
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext ectx = ctx.getExternalContext();
return "home";

<redirect />

Thanks again!
12 years ago
Thank you Tim. I fixed the problem you mentioned but it doesn't seem to affect the problem I'm seeing. It is more like my page just isn't redirecting when it should be and I don't know why.

I would make it a regular <h:link> like all the rest of my buttons but for some reason JSF calls the outcome method of my link when the page is created so it automatically logs me out just from viewing the admin page.
12 years ago

I'm still new to JSF so I'm looking for any advice I can get. I have a problem updating my JSF components rendered attribute. Here is my code:



I can login and logout just fine but the problem is that when I logout and get sent back to my index page, I can still see my logout button that shouldn't be rendered anymore. This goes away after clicking through another link so I thought that using redirect should work but to no avail.

Any tips will be much appreciated.
12 years ago
Thank you very much. I can't tell you how much that was annoying me.
12 years ago

I'm just learning the basics of JSF and I have gotten myself confused just working through some simple navigation.

Here's my code:
JSF Page:

<h:link value="Index 1" outcome="#{menuBean.index}" />
<h:commandLink value="Index 2" action="#{menuBean.index}" />


package edu.unmc.codawards.beans;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

public class MenuBean implements Serializable{
private String index = "index"

public String getIndex() {
return index;

Index 1 works just fine but Index 2 gives me a "javax.el.MethodNotFoundException: /WEB-INF/CODAwardsTemplate.xhtml @27,87 action="#{menuBean.index}": Method not found: edu.unmc.codawards.beans.MenuBean@64743887.index()"

If I change my MenuBean getIndex method to just index I can get the action to work with action="#{menuBean.index()}"

While it works, this has me worried since all of the tutorials I am working through seem to treat both the outcome and action attributes the same with no need to include "()"

Surely I'm missing something so incredibly basic but I would appreciate any help I can get

12 years ago
Yeah sorry the picture I posted was for brevity to show the general layout of the tables. Each table other than the year shows more detail and has a different naming scheme. To be honest I think I am over thinking things. I'm still studying up on how to use JPA and JPQL. Other than mapping out the relationships between tables in the entities, working with how the tables data all comes together should be in my queries right? wow I feel like that is a really dumb question.

I'll post some code when I actually have an example to show.
Hey guys,

This is my first post so I hope I am going about this the right way. I am working on my first JPA project ever so this may seem like some very basic questions but please bear with me.

My work has me putting together a database for all of the awards we have given out over the last 40 years to our faculty and students. My database structure looks kind of like the picture I have attached to this post. We have about 850 award instances of the 30 or so awards we give out each year. They have been given to about 500 different people and some people have received an award multiple times or multiple awards.

I understand that my Award Instances table has a many to one relationship with each of the other tables but how do I show that in my entities?? Do I treat my Awards Instances table as one big join table??

I've looked at lots of examples but all of them are usually just 2 tables. I'm not sure how to treat something more complex.

Thanks for any help you guys are willing to give!