0

JSP code:

<form method="POST" action="editing.jsp">
    <div class="line">
        <span class="Stk">Current Password:</span><input type="password" name='pass' />
    </div>

    <div class="line">
        <span class="Stk">New<br>Password:</span><input type="password" name='neopass' />
    </div>

    <div class="line">
        <span class="Stk">Confirm Password:</span><input type="password" name='passcon' />
    </div>
    <br>

    <div class="line">
        <input type="submit" value="Change Password"/>
    </div>
 </form>

.java code:

public class myUser {

    private String pass = null;
    private String neopass = null;
    private String passcon = null;

    public void myUser(){

    }

    public String getPass(){
        return this.pass;
    }

    public void setPass(final String pass){     
        this.pass = pass;
    }

    public String getPasscon(){
        return this.passcon;
    }

    public void setPasscon(final String passcon){
        this.passcon = passcon;
    }

    public String getneoPass(){
        return this.neopass;
    }

    public void setneoPass(final String neopass){
        this.neopass = neopass;
    }
}

I try to make a form so as I can change the password in my app ! The problem is that even though I think that I have done all right , something goes wrong an it doesn't work ! When I'm printing the values that I set in the form (through Beans.'nameofmethod' (e.g. Bean.getneoPass())) the values I had put in pass and passcon inputs appear normally, but the value in neopass input appears to be null all the time !

1 Answer 1

2

Your method for neopass should be getNeopass() setNeopass() to match your neopass form item. (not setneoPass - wrong caps)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you ! This small detail makes the difference !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.