I have a jsp page with two text boxes and a submit button. On receiving the input value from the form, the value of the second textbox named "Zodiac" is coming in zero.
This is my jasp page
& Lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transcription // N" "http://www.w3.org/TR/html4/loose.dtd"> & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Link rel = "stylesheet" type = "text / css" media = "screen" href = "../../ css / bootstrap.css" /> & Lt; Title & gt; Credit / debit fund & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt;% string context_path = request.getContextPath (); String navbar_path = context_path + "/ pages / navbar.jsp"; & Gt%; & Lt;% @ include file = "../ navbar.jsp"% & gt; & Lt; Div class = "panel panel-priority" & gt; & Lt; Div class = "panel-title" & gt; Credit / debit fund & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "panel-panel-default" & gt; & Lt; Div class = "panel-title" & gt; & Lt; H3 class = "panel-title" & gt; & Lt; / H3 & gt; & Lt; / Div & gt; & Lt; Div class = "panel-body" & gt; & Lt; C: if test = "$ {accountStatus! = Null}" & gt; & Lt; Div class = "btn-primary"> & Lt; Div id = "status" class = "label primary" & gt; $ {AccountStatus} & lt; / Div & gt; & Lt; / Div & gt; & Lt; / C: If & gt; & Lt; Form class = "form-horizontal" role = "form" method = "POST" id = "accountFormBean" commandname = "accountFormBean" verb = "/ ira_bank / ExternalUsers / credit_debit" & gt; & Lt; Div class = "form-group" & gt; & Lt; Label class = "radio-inline call-sm-4-control-label" & gt; & Lt; Input type = "radio" name = "credit debit" id = "credit debit" value = "credit" & gt; Credit & lt; / Labels & gt; & Lt; Label class = "radio-inline call-sm-4-control-label" & gt; & Lt; Input type = "radio" name = "credit debit" id = "credit debit" value = "debit" & gt; Debit & lt; / Label & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Label = "inputPassword3" class = "col-sm-2-control-label" & gt; From / to & lt; / Label & gt; & Lt; Div class = "col-sm-7 col-md-7" & gt; & Lt; Input type = "text" name = "account number" class = "form-control" id = "account number" placeholder = "to / account number" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Label = "inputamount" class = "col-sm-2-control-label" & gt; Quantity & lt; / Label & gt; & Lt; Div class = "col-sm-7 col-md-7" & gt; & Lt; Input type = "text" name = "zodiac" class = "form-control" id = "zodiac" placeholder = "zodiac" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" & gt; & Lt; Div class = "cola-s-f-offset-2 co-sm-7 co-md-offset-2 call-md-7" & gt; & Lt; Button type = "submit" class = "btn btn-default" & gt; Submit & lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script src = "../../ js / jquery-1.10.2.js" & gt; & Lt; / Script & gt; & Lt; Script src = "../../ js / bootstrap.js" & gt; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;
And this is the formin from where I am getting the value -
public class AccountFormBean {private string amount; Private string account number; Private string credit debit; Public Zero Set CountNumber (String Account Number) {this.accountNumber = accountNumber; } Public string getAccountNumber () {return account number; } Public Zero Settleance (string amount) {this.amount = amount; } Public String Dividend () {Return amount; } Public Zero Set Credit Debit (String Credit Debit) {this.CreditDebit = CreditDebit; } Public string getCreditDebit () {return credit debit; }}
The value of account number is recovering but it is coming in the form of zero for the amount.
for your AccountFormBean
field in the getbalance ()
and setbones (string amount),
code>. To map the incoming data to the beam field is the user and setter name of the framework. getAmount ()
and should be setAmount (string amount)
Comments
Post a Comment