Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Why my POJO is not working in my doPost servlet?

  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Why my POJO is not working in my doPost servlet?

    I am trying to add POJO onto my existing doPost servlet cos I think this is the acceptable standard and want to try things out.

    So, what I did was to emulate after a POJO sample I found on the web.

    My jsp :
     <td>Full Name</td>
                        <td><input type="text" id="FullName" name="FullName"></td>
    And the
    n I also created a MembersBean
    public class MembersBean implements Serializable{
        private String fullName;
     
    public void setFullName(String fullName) {
            this.fullName = fullName;
        }
    And finally at my doPost Servlet I add in the POJO portion but Netbean actually shows an error. So, I'm not sure what went wrong.


    Here's what I did:

     String strName = request.getParameter("FullName");
     
    MembersBean member = new MembersBean();
                 member.setstrName(FullName); (and this line Netbean flash an error :(((
    Did I do something wrong?


  2. #2
    Member angstrem's Avatar
    Join Date
    Mar 2013
    Location
    Ukraine
    Posts
    200
    My Mood
    Happy
    Thanks
    9
    Thanked 31 Times in 29 Posts

    Default Re: Why my POJO is not working in my doPost servlet?

    Your method in MembersBean actually has different signature...

  3. #3
    Member
    Join Date
    Jul 2011
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Why my POJO is not working in my doPost servlet?

    Quote Originally Posted by angstrem View Post
    Your method in MembersBean actually has different signature...

    Thank you angstream, after ammend my line as below, there's no more error (for the time being).


    MembersBean member = new MembersBean();
    member.setFullName(strName);

Similar Threads

  1. Why POJO class implements Serializable Interface ?
    By noorul11 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 28th, 2013, 07:34 AM
  2. Servlet is not working in IE
    By bhagirathi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2012, 01:45 AM
  3. Google Chart from database Servlet not working
    By bekimdisha in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 14th, 2012, 07:08 AM
  4. Replies: 0
    Last Post: March 11th, 2012, 04:57 PM
  5. POJO Jenerator
    By JohnBoy in forum Web Frameworks
    Replies: 6
    Last Post: December 12th, 2010, 03:17 PM