Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6534097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:12:36+00:00 2026-05-25T10:12:36+00:00

I have programmed a little application in which you can register and edit your

  • 0

I have programmed a little application in which you can register and edit your data. For the authenticity I used a bean class called Authenticity. This class contains an object of Customer (which is a database entity) and methods to login and to logout.

Now I´ve created a page for editing the user: A form with many inputTexts which have the value of authenticity.curUser./(properties). It look like this:

      <h:form>
        <h:panelGrid columns="2" cellpadding="4px" width="600">
            <h:outputText value="firstname:" />
            <h:inputText value="#{authenticity.curUser.firstname}"/>

            <h:outputText value="lastname:"/>
            <h:inputText value="#{authenticity.curUser.lastname}" />

            <h:outputText value="street:"/>
            <h:inputText value="#{authenticity.curUser.street}" />

            <h:outputText value="housebumber"/>
            <h:inputText value="#{authenticity.curUser.housenumber}" />

            <h:outputText value="Zip:"/>
            <h:inputText value="#{authenticity.curUser.zip}" />

            <h:outputText value="City:"/>
            <h:inputText value="#{authenticity.curUser.city}" />

            <h:outputText value="Land"/>
            <h:inputText value="#{authenticity.curUser.country}" />

            <h:outputText value="email:"/>
            <h:inputText value="#{authenticity.curUser.email}" />

            <h:outputText value="password:"/>
            <h:inputSecret value="#{authenticity.curUser.password}" />
            <h:commandButton action="#{authenticity.editUser}" value="Edit" />
        </h:panelGrid> 
    </h:form>

My question now is whether there are better solutions for this problem. Should a AuthenticityBean be actually able to edit the user? Or should I create a extra bean?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:12:36+00:00Added an answer on May 25, 2026 at 10:12 am

    I would use a completely separate view scoped bean which holds a brand new copy of the entity representing the logged-in user. Only when the form is successfully edited and saved, then the currently logged-in user can be replaced (the form bean can just access it as a @ManagedProperty).

    If you were reusing the same entity in the form; imagine that you’re ajax-updating some fields and then cancels/closes the form. The currently logged-in user would then still have the “Wrong” field values in the remnant of the session. This is not correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once I have programmed GUI with Java and have used Form Layouts. Form layout
I have recently programmed a console application and I've experienced a lot of pain
I have a webservice programmed in coldfusion which I'm attempting to consume using c#.net.
I have multiple IPs on a NIC. I've programmed a console application to connect
The original developer programmed the following JavaScript, which is a little amateurish in my
I have just taken over maintenance of a large web application which is over
I have programmed an emulator, but I have some doubts about how to organizate
I have been using oracle database throughout database courses, and I have programmed there
I have never programmed a gadget for Vista or Seven, but I would like
In languages like Java, you can declare a class without a modifier so it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.