Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2007, 11:21 AM
Registered User
 
Join Date: Nov 2007
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()


}




























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





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