File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Update a Registration page using JSF and MySQL Database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Update a Registration page using JSF and MySQL Database." Watch "Update a Registration page using JSF and MySQL Database." New topic

Update a Registration page using JSF and MySQL Database.

gg mathew

Joined: Aug 20, 2013
Posts: 1
I'm developing a web application using JSF 2.2 and MySQL in Nebeans 7.2 . I'm new to the concept of JSF. I've finished creating the registration page and a login page. What i now want is on a customer home page there is a link to update their details (i.e. details of their registration page). The following code is the update registration page.xhtml

This is the faces-config.xml

This is my managed bean

how will I be able to update the fields in the registration table? How will I be able to extract the <hutputText value="#{login.username}"/> over to the managed bean Please help.....
K. Tsang

Joined: Sep 13, 2007
Posts: 3130

You don't use the login bean. Instead you should use another bean for the update of the registration page.

From your page you already are using "". So which bean are you referring to "employeeupd"?

I don't recommend cluttering 2 pages of attributes into a single bean.

About the username, you can put into the session scope and in the registration update page, fetch it from the session instead of the bean.

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

You'll get better support when you strip out non-essentials from your examples. Anything that won't fit on one screen is more than it's worth my time to read unless I'm being paid for it. Plus, one of the first steps to solving any problem is to simplify it.

Because it's more than my bleary early-morning eyes can read, I can't comment on what you are specifically asking. But I will say this: J2EE comes with a built-in security system. It's integrated into the J2EE APIs, it's always available, and it was debugged over a decade ago. Which is more than I can say for user-designed login services. Over that same 10 years or so, I can't say I've ever seen a really secure user-designed login, even in the financial systems I've worked with. In your particular case, even if you don't make any of the usual mistakes that even non-hackers can quickly punch through, I think an SQL injection would make soggy paper-maché out of your security in no time at all.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Update a Registration page using JSF and MySQL Database.
It's not a secret anymore!