JavaBeans beginner needs help

Hi all,
i am new to javabeans and JSP, i have some problem to retrieve value from beans, any help will be appreciate.
my index.jsp has a from

userName
     realName    <input type="text" name="realName" />
        <br>
        <input type="submit" value="Log In" />
    </form>

which POST to update.jsp,
update.jsp retrieves userName

<jsp:useBean id=“simple” class=“bean.UserBean”>
<jsp:setProperty name=“simple” property=“*”/>
</jsp:useBean>


User <jsp:getProperty name=“simple” property=“userName” />

i am OK at this point. But if i want to go to next.jsp which display realName, i got null.
next.jsp :

<jsp:useBean id=“simple” class=“bean.UserBean”>

</jsp:useBean>
<body>
    <h1>Hello <jsp:getProperty name="simple" property="realName" /></h1>
</body>

UserBean :

public class UserBean implements java.io.Serializable {

private String userName;
private String realName;


/** No-arg constructor (takes no arguments). */
public UserBean() {
    
}

/**
 * Property <username>name</username> (note capitalization) readable/writable.
 */
public String getuserName() {
    return this.userName;
}

/**
 * Setter for property <username>name</username>.
 * @param name
 */
public void setuserName(String userName) {
    this.userName = userName;
}

/**
 * Property <realname>name</realname> (note capitalization) readable/writable.
 */
public String getRealName() {
    return this.realName;
}

/**
 * Setter for property <realname>name</realname>.
 * @param name
 */

public void setRealName(String realName) {
this.realName = realName;
}
}

I am really new to JavaBeans, any help please!

I really don’t know anything about JavaBeans or JSP but does realName ever get a value other than null?

Hi!

I really think you are on the wrong forum with your problems. This is meant for Vaadin (which is supposed to be used instead of JSP) related discussions.

I’m sure with Vaadin, all your issues would be solved :slight_smile:

cheers,
matti