Anyone good at Java, HTML, Servlets, JavaBean, and JSP? NEED HELP - 600RR.net
Off Topic & Flame Thrower All non 600RR related banter goes in here...
Sponsored by: Sharp Turn Motorsports

 
LinkBack Thread Tools
post #1 of 8 (permalink) Old 04-14-2016, 11:49 PM Thread Starter
Training Wheel Hero
 
CBRicky's Avatar
 
Join Date: Feb 2016
Location: Florida
Posts: 82
Thanks: 7
Thanked 9 Times in 8 Posts
Garage
Feedback Score: 0 reviews
Anyone good at Java, HTML, Servlets, JavaBean, and JSP? NEED HELP

I am currently taking a class and I am having a really hard time learning the subject material. I have a huge homework assignment due and I can't figure it out for the life of me. (working on it for over 10 hours)

I need help completing the assignment below:

You are required to create:

-a JavaBean class
o JavaBean class: Create a Java class in a package under the Source Packages folder. This Java class should qualify as a JavaBean class, i.e., meet all the JavaBean requirements. It should have at least 2 Constructors, 4 private data fields, including one boolean type, and their corresponding get and set methods. Note: you CANNOT use the User bean from the book. (2 points)

- a HTML Form that lets users enter class data
o HTML Form: Create an html page that contains a Form that let users enter the data field values for the JavaBean class. The form action should request a Servlet class (using the Servletís URL pattern). (1 point)


- a Servlet class that processes form inputs
o Servlet: Create a Servlet class to handle form inputs. It should get parameters from the form and then use them to create an instance of the JavaBean. It shouldrecord the JavaBean data field values in a .txt file in the WEB-INF folder with one record per line. After that, it should add the JavaBean instance as an attribute to the session and forward the request and response to the JSP. (4 points)


- a JSP that receives processing results from the Servlet and display them back to users. (You can refer to the examples we did in class and in the textbook.)
o JSP: Create a JSP page to display processing results sent by the Servlet. You can use JSP standard tags or JSP Expression Language. (Please refer to the text book and slides for details on JSP standard tags and JSP Expression Language.) (2 points)


*** I'm really good at creating the form but I am completely lost when it comes to the servlet, jsp, and javaBean.


Any help would be greatly appreciated

CBRicky
CBRicky is offline  
Sponsored Links
Advertisement
 
post #2 of 8 (permalink) Old 04-15-2016, 01:52 AM
Training Wheel Hero
 
Join Date: Feb 2016
Location: Old Line State, USA
Posts: 44
Thanks: 3
Thanked 9 Times in 8 Posts
Feedback Score: 0 reviews
whats the name of this class?
Whats your major?

java - What is a javabean? - Stack Overflow
JSP JavaBeans

Hope that helps ^^^^
I never heard of JavaBeans, but i took java recently and HTML a while ago ...

---
"Work Smart, Not Hard"
07 CBR 600RR
amit16 is offline  
post #3 of 8 (permalink) Old 04-15-2016, 06:52 AM
Beer: does the body good
 
mike_666's Avatar
 
Join Date: Jun 2009
Location: Hamilton, Ontario
Posts: 681
Thanks: 32
Thanked 51 Times in 46 Posts
Feedback Score: 4 reviews
When is your assignment due? I would recommend checking out this tutorial. It will walk you through the a very basic example. Once you have it working you can modify it to add the additional HTML format elements. Look at th e servlet introduction for Hello world

http://www.simplecodestuffs.com/serv...ial-beginners/

I'm do Java development for a living. Comment if you get stuck.

Sent from my HTC One M9

Current: 10 1000RR/ABS - Orange/Silver
Previous: 07 CBR125R - Black (Sold), 05 600RR - Metallic Silver/Black (Crash), 14 Grom - Metallic Black (Sold), 09 600RR/ABS - Metallic Black (Sold)

01001001 00100111 01100100 00100000 01010010
01100001 01110100 01101000 01100101 01110010
00100000 01000010 01100101 00100000 01010010
01101001 01100100 01101001 01101110 01100111

Last edited by mike_666; 04-15-2016 at 06:55 AM.
mike_666 is offline  
The Following User Says Thank You to mike_666 For This Useful Post:
CBRicky (04-15-2016)
post #4 of 8 (permalink) Old 04-15-2016, 07:10 AM
Beer: does the body good
 
mike_666's Avatar
 
Join Date: Jun 2009
Location: Hamilton, Ontario
Posts: 681
Thanks: 32
Thanked 51 Times in 46 Posts
Feedback Score: 4 reviews
Think of an example like this. Your jsp with form elements will have input boxes that will all you to enter your mailing address (full name, address, state, postal code) with a submit button. The submit button is going to sent the entered values in the request to the servlet. You will want to get the names of the values of the input boxes And assign them to you Java bean. A Java bean is nothing more then a Java pogo or Java object. This can be a mailing address with those elements as the attributes with getters and setters, yes your constructors to set the elements.

Use that objects and set the values in the results page.

Sent from my HTC One M9

Current: 10 1000RR/ABS - Orange/Silver
Previous: 07 CBR125R - Black (Sold), 05 600RR - Metallic Silver/Black (Crash), 14 Grom - Metallic Black (Sold), 09 600RR/ABS - Metallic Black (Sold)

01001001 00100111 01100100 00100000 01010010
01100001 01110100 01101000 01100101 01110010
00100000 01000010 01100101 00100000 01010010
01101001 01100100 01101001 01101110 01100111
mike_666 is offline  
The Following User Says Thank You to mike_666 For This Useful Post:
CBRicky (04-15-2016)
post #5 of 8 (permalink) Old 04-15-2016, 11:06 AM Thread Starter
Training Wheel Hero
 
CBRicky's Avatar
 
Join Date: Feb 2016
Location: Florida
Posts: 82
Thanks: 7
Thanked 9 Times in 8 Posts
Garage
Feedback Score: 0 reviews
Quote:
Originally Posted by amit16 View Post
whats the name of this class?
Whats your major?

java - What is a javabean? - Stack Overflow
JSP JavaBeans

Hope that helps ^^^^
I never heard of JavaBeans, but i took java recently and HTML a while ago ...
Quote:
Originally Posted by mike_666 View Post
When is your assignment due? I would recommend checking out this tutorial. It will walk you through the a very basic example. Once you have it working you can modify it to add the additional HTML format elements. Look at th e servlet introduction for Hello world

Servlet & JSP Tutorial for beginners|SimpleCodeStuffs

I'm do Java development for a living. Comment if you get stuck.

Sent from my HTC One M9
Quote:
Originally Posted by mike_666 View Post
Think of an example like this. Your jsp with form elements will have input boxes that will all you to enter your mailing address (full name, address, state, postal code) with a submit button. The submit button is going to sent the entered values in the request to the servlet. You will want to get the names of the values of the input boxes And assign them to you Java bean. A Java bean is nothing more then a Java pogo or Java object. This can be a mailing address with those elements as the attributes with getters and setters, yes your constructors to set the elements.

Use that objects and set the values in the results page.

Sent from my HTC One M9
Thank you all for the responses! I am a computer information systems major. I really appreciate the responses.

My assignment is due this Sunday 4/17/16

Sofar the HTML form that I completed is asking for First name, Last name as a text field

Motorcycle Type (Honda, Kawasaki, Suzuki, Yamaha) as a drop down box

Phone number as a text field

and gender as a radio button

CBRicky

Last edited by CBRicky; 04-15-2016 at 11:12 AM.
CBRicky is offline  
post #6 of 8 (permalink) Old 04-15-2016, 11:11 AM Thread Starter
Training Wheel Hero
 
CBRicky's Avatar
 
Join Date: Feb 2016
Location: Florida
Posts: 82
Thanks: 7
Thanked 9 Times in 8 Posts
Garage
Feedback Score: 0 reviews
Quote:
Originally Posted by mike_666 View Post
Think of an example like this. Your jsp with form elements will have input boxes that will all you to enter your mailing address (full name, address, state, postal code) with a submit button. The submit button is going to sent the entered values in the request to the servlet. You will want to get the names of the values of the input boxes And assign them to you Java bean. A Java bean is nothing more then a Java pogo or Java object. This can be a mailing address with those elements as the attributes with getters and setters, yes your constructors to set the elements.

Use that objects and set the values in the results page.

Sent from my HTC One M9
I'm not able because of the assignment requirement to make a JSP with form elements. My form must be a separate HTML form and pass that through the JSP. By the end of my homework assignment I'm suppose to have a JSP, Servlet, Javabean, HTML form.

My professor also wanted us to not mess with the doGet / doPost methods in the Servlet and just use the processRequest method to call the doGet and doPost

CBRicky
CBRicky is offline  
post #7 of 8 (permalink) Old 04-15-2016, 11:13 AM
Beer: does the body good
 
mike_666's Avatar
 
Join Date: Jun 2009
Location: Hamilton, Ontario
Posts: 681
Thanks: 32
Thanked 51 Times in 46 Posts
Feedback Score: 4 reviews
so your bean would look something like this.

package com.somecompany;

public class testclass {
private String firstName;
private String lastName;
private String motorcycleType;
private String telephoneNumber; //or Long if you dont' care about free form text.

public testclass() {
}

public testclass(String firstName, String lastName, String motorcycleType,
String telephoneNumber) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.motorcycleType = motorcycleType;
this.telephoneNumber = telephoneNumber;
}

/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}

/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* @return the motorcycleType
*/
public String getMotorcycleType() {
return motorcycleType;
}
/**
* @param motorcycleType the motorcycleType to set
*/
public void setMotorcycleType(String motorcycleType) {
this.motorcycleType = motorcycleType;
}
/**
* @return the telephoneNumber
*/
public String getTelephoneNumber() {
return telephoneNumber;
}
/**
* @param telephoneNumber the telephoneNumber to set
*/
public void setTelephoneNumber(String telephoneNumber) {
this.telephoneNumber = telephoneNumber;
}

}

Current: 10 1000RR/ABS - Orange/Silver
Previous: 07 CBR125R - Black (Sold), 05 600RR - Metallic Silver/Black (Crash), 14 Grom - Metallic Black (Sold), 09 600RR/ABS - Metallic Black (Sold)

01001001 00100111 01100100 00100000 01010010
01100001 01110100 01101000 01100101 01110010
00100000 01000010 01100101 00100000 01010010
01101001 01100100 01101001 01101110 01100111
mike_666 is offline  
The Following User Says Thank You to mike_666 For This Useful Post:
CBRicky (04-17-2016)
post #8 of 8 (permalink) Old 04-27-2016, 01:33 AM
Training Wheel Hero
 
Join Date: Feb 2016
Location: Old Line State, USA
Posts: 44
Thanks: 3
Thanked 9 Times in 8 Posts
Feedback Score: 0 reviews
sorry to respond so late, but i think this might be helpful in the future.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2016-04-27 at 1.32.21 AM.jpg
Views:	62
Size:	9.3 KB
ID:	178226   Click image for larger version

Name:	Screen Shot 2016-04-27 at 1.32.42 AM.jpg
Views:	46
Size:	10.0 KB
ID:	178234  

---
"Work Smart, Not Hard"
07 CBR 600RR
amit16 is offline  
Sponsored Links
Advertisement
 
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the 600RR.net forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page



Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome