Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 17th, 2007, 11:21 AM
Registered User
 
Join Date: Nov 2007
Location: paris, paris, France.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Jsp,bean

Hello

i have to create a form with combobox ,after that the chosen option have to regist in database,and after that it has to display on web -side. if some one have the same profil. them name show on the web-side.

after that all the people have to list up in
 histogram, i mean how many have take the test in procent

im not god in english. hope someone can help me

1.Form
<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>
<H3></H3>

<FORM METHOD="POST" action="test1.jsp">
<P> Name<BR>
<INPUT TYPE="TEXT" NAME="name" SIZE="20">




<P> What you like best <BR>
<INPUT TYPE="RADIO" NAME="fruit" VALUES="grapes" > Grapes
<INPUT TYPE="RADIO" NAME="fruit" VALUES="cherry" > cherry
<INPUT TYPE="RADIO" NAME="fruit" VALUES="banana" >banana



<P> your best tv-serial <BR>
<INPUT TYPE="RADIO" NAME="tv-serial" VALUES="Lost">Lost
<INPUT TYPE="RADIO" NAME="tv-serial" VALUES="prison break">prison
<INPUT TYPE="RADIO"NAME="tv-serial VALUES="Supernatural">


<P> Wich color like you <BR>
<INPUT TYPE="RADIO" NAME="color" VALUES="black" >black
<INPUT TYPE="RADIO" NAME="color" VALUES="green >green
<INPUT TYPE="RADIO" NAME="color" VALUES="red" >red

<P>Animals<BR>
<INPUT TYPE="RAD NAME="Animals" VALUES="frog">frog
<INPUT TYPE="RAD NAME="Animals" VALUES="dog">dog
<INPUT TYPE="RAD NAME="Animals" VALUES="cat">cat


<P>
<INPUT TYPE="SUBMIT" VALUE="Next">
<INPUT TYPE="RESET" VALUE="Reset">
</FORM>
</BODY>
</HTML>



2.beans


<%@ page import="com.java2s.*"%>

<jsp:useBean id="Profile" scope="session" class="Profile"
type=""/>

<jsp:setProperty name="Profile" property="*"/>

<html>
<head>
<title></title>
</head>
<body>

</body>
</html>



3.class


package com.java2s.tags;

import java.iu.*;
import sql.*;

class.forName("org.gjt.mm.mysal.Driver").newInstan ce();

connection =DriverManager.getConnection("jdbc:mysql://localhost/test");

Statement commando= createStatemenr();


public class Profil


{
privat String name;

Private String fruit;

Private String Animals;

Private String TV-serial;

Private String color;



public String getName()

{
return name;


}


public String getFruit()


{
return fruit;


}


public String getAnimals()



{
return Animals;


}


public String getTv-serial()


{
return Tv-serial;


}


public String getColor()


{
return color;


}



public void setName()


{
this.name=name;
Commando.executeUpdate()


}



public void setNFruit()


{
this.fruit=fruit;
Commando.executeUpdate()
}



public void setAnimals()


{
this.animals=animals;
Commando.executeUpdate()
}





public void setTv-serial()


{
this.tv-serial=tv-serial;
Commando.executeUpdate()



}



public void setColor()


{
this.color=color;

Commando.executeUpdate()


}























Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stateless bean iralala EJB 0 September 24th, 2008 10:55 PM
connecting DB with JSP using Java Bean Q4Java Java Databases 1 May 7th, 2007 03:44 AM
Calling bean from jsp page madhavaram123 JSP Basics 6 May 10th, 2006 09:15 PM
Retrieve Data from Java Bean to JSP page Nirav Joshi JSP Basics 1 August 24th, 2005 07:45 AM
bean problem sandi JSP Basics 3 April 5th, 2005 01:22 PM



All times are GMT -4. The time now is 11:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.