Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Java Beans query

Options
  • 27-04-2006 7:00pm
    #1
    Registered Users Posts: 7,677 ✭✭✭


    I have a jsp page that has a few text boxes, 1 drop down list and 1 text area.

    I am passing the information into a Java Bean.

    My problem is that my drop down and text area are not been propulated into my Java Bean but the text boxes are fine.

    Can anyone help please
    Jsp
    
    <div id="contentMiddleRightContact">
           <input class="Border" type="text" name="txtCommentPersonName" size="10" maxlength="20" />	
           <br/>     
           <br/>
           <input class="Border" type="text" name="txtCommentEmailAddress" size="10" maxlength="20"/>	
           <br/>
           <br/>
           <input class="Border" type="text" name="txtCommentOrderNumber" size="10" maxlength="20"/>	
           <br/>
           <br/>
           <select class="Border" name="CommentCDorDVD">
            <option value="PleaseSelect">Please Select a Store</option>
            <option value="CD">CD</option>
            <option value="DVD">DVD</option>
           </select>
           <br/>
           <br/>
           <textarea class="Border" rows="5" cols="20" name="CommentPersonComment">
           </textarea>
    
    
    Java
    
    public class Comment {
        
        /** Creates a new instance of Comment */
        public Comment() {
        }
        private String txtCommentPersonName;
        private String txtCommentEmailAddress;
        private String CommentCDorDVD;
        private String CommentPersonComment;
        private int txtCommentOrderNumber;
    
        public String getTxtCommentPersonName() {
            return txtCommentPersonName;
        }
    
        public void setTxtCommentPersonName(String txtCommentPersonName) {
            this.txtCommentPersonName = txtCommentPersonName;
        }
    
        public String getTxtCommentEmailAddress() {
            return txtCommentEmailAddress;
        }
    
        public void setTxtCommentEmailAddress(String txtCommentEmailAddress) {
            this.txtCommentEmailAddress = txtCommentEmailAddress;
        }
    
        public String getCommentCDorDVD() {
            return CommentCDorDVD;
        }
    
        public void setCommentCDorDVD(String CommentCDorDVD) {
            this.CommentCDorDVD = CommentCDorDVD;
        }
    
        public String getCommentPersonComment() {
            return CommentPersonComment;
        }
    
        public void setCommentPersonComment(String CommentPersonComment) {
            this.CommentPersonComment = CommentPersonComment;
        }
    
        public int getTxtCommentOrderNumber() {
            return txtCommentOrderNumber;
        }
    
        public void setTxtCommentOrderNumber(int txtCommentOrderNumber) {
            this.txtCommentOrderNumber = txtCommentOrderNumber;
        }
    }
    


Comments

  • Registered Users Posts: 1,275 ✭✭✭bpmurray


    How are you linking these together? Just creating a bean doesn't link it to a JSP.


  • Registered Users Posts: 7,677 ✭✭✭Trampas


    Sorry I have this line of code in another jsp that updates the bean
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="login.*"%>
    
    <jsp:useBean id="comment" scope="page" class="login.Comment" />
    <jsp:setProperty name="comment" property="*" />
    


Advertisement