• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Update a Registration page using JSF and MySQL Database.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 <h:outputText value="#{login.username}"/> over to the managed bean employeeupd.java? Please help.....
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "employeeupd.xxx". 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.
 
Saloon Keeper
Posts: 21252
137
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!