Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
7. CREATION OF DYNAMIC CONTENT IN WEB APPLICATION USING JSP.
HOMEPAGE:--- (task_jsp.html)
<html> <head> <title>Student Percentage Calculator</title> </head> <body> <center> <h2>Welcome to III Yr I-sem Percentage Calculator</h2> <form method="POST" action="[Link] <table> <tr> <td> UserName </td > <td> <input type="text" name="username"/> </td> </tr> <tr> <td> Password </td > <td> <input type="password" name="password"/> </td> </tr> <p>Enter Marks</p><br/> <tr> <td>DAA</td> <td><input type="text" name="mark1"/></td> </tr> <tr> <td>DBMS</td> <td><input type="text" name="mark2"/></td> </tr> </table> <input type="submit" name="submit" value="calculate"/> </form> </center> </body> </html>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link]:<%@ page import="[Link]" %> <jsp:useBean id="marksbean" scope="page" class="[Link]"> <jsp:setProperty name="marksbean" property="username" value='<%=[Link]("username") %>'/> <jsp:setProperty name="marksbean" property="mark1"/> <jsp:setProperty name="marksbean" property="mark2"/> </jsp:useBean> <html> <head> <title>Percentage</title> </head> <body> <p>Welcome: <jsp:getProperty name="marksbean" property="username"/> </p> <p>Your marks are :<br/> DAA:<jsp:getProperty name="marksbean" property="mark1"/><br/> DBMS:<jsp:getProperty name="marksbean" property="mark2"/> </p><br/> <p>Your Percentage is <%= [Link]() %> </p><br /> <p>Comments on your percentage is <%= [Link]() %> </p> </body> </html>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link]
<?xml version="1.0" encoding="ISO-8859-1"?> <!--<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "[Link] --> <web-app> </web-app>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link]:package user; import [Link].*; public class MarksBean { String username=""; String mark1="",mark2=""; int tot; public MarksBean() { } public void setUsername(String userName) { [Link]=userName; } public String getUsername() { return [Link]; } public void setMark1(String mark1) { this.mark1=mark1; } public String getMark1() { return mark1; } public void setMark2(String mark2) { this.mark2=mark2; } public String getMark2() { return mark2; } public int getCalculateper()throws IOException { tot=(([Link](mark1))+([Link](mark2)))/2;
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
return tot; } public String getComments() { if(tot>=75) return "You passed with distinction"; else if(tot>=60 && tot<75) return "You passed in first class"; else return " You passed in second class"; } }
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link] OF DYNAMIC CONTENT IN WEB APPLICATION USING [Link]
Project Name:- reddy File Name:- myp
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[Link] <script runat="server"> </script> <html xmlns="[Link] <head id="Head1" runat="server"> <title>Details</title> </head> <center> <h1>Enter Marks Details</h1> </center> <body> <form id="form1" runat="server"> <center> <div> <br /><br /><br /> <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label> <asp:TextBox ID="Name" runat="server"></asp:TextBox> <br /> <asp:Label ID="Label2" runat="server" Text="DBMS"></asp:Label> <asp:TextBox ID="DBMS" runat="server"></asp:TextBox> <br /> <asp:Label ID="Label3" runat="server" Text="DAA"></asp:Label> <asp:TextBox ID="DAA" runat="server"></asp:TextBox> <br /><br /> <asp:Button ID="Submit" runat="server" Text="Submit" /> <br /><br /> </div> </center> </form>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
<center> <% if(IsPostBack) { [Link]("Welcome " +[Link]+ " !!!\n"); var total = [Link].ToInt32([Link]) + [Link].ToInt32([Link]); [Link]("Your Total is " + total); } %> </center> </body> </html>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link] DATA STORE SUPPORT FOR WEB SITE USING JDBC. [Link]:<html> <head> <title>Login</title> </head> <h1> <center>Enter Details</center> </h1> <body> <form action="[Link] <center> <table> <tr> <td>Name</td> <td><input type="text" name="name"></td> </tr> <tr> <td>Address</td> <td><input type="text" name="address"></td> </tr> </table> </center> <br/> <center> <input type="submit" name="submit" value="Submit"/> </form> </center> </body> </html>
Stanley College of Engineering & Technology for Women
Chapel Road, Hyderabad
Roll No:
1 6 0 6 1 0 7 3 3 1 1 2 Exp No: ____ _
Date:
___________
Page No: ____________________
Faculty: ___________
[Link]:<%@page import="[Link].*"%> <% String name=[Link]("name"); String address=[Link]("address"); try { [Link]("[Link]"); Connection con=[Link]("jdbc:oracle:thin:@localhost:1521:XE","system","sriya"); Statement st=[Link](); int i=[Link]("insert into data1 values ('"+name+"','"+address+"')"); [Link](); [Link]("<html><head><title>Successfull</title></head>"); [Link]("<h1><center>Successful</center></h1><body><center><p>Data Inserted Succesfully</p></center>"); [Link]("</body></html>"); } catch(Exception e) { [Link](e); } %>