Você está na página 1de 5

Web Technologies (April/May-2012, Set-1) JNTU-Hyderabad

Code No: 09A60505/R09 B.Tech III Year II Semester Examinations

S.1

April/May - 2012 WEB TECHNOLOGIES


( Common to CSE, IT )

Set-1
Solutions
Max. Marks: 75

Time: 3 Hours Answer any FIVE Questions All Questions carry equal marks --1. (a) (b) Explain the purpose of cascading style sheets. (Unit-I, Topic No. 1.6)

Design and create the page(s) for accepting the values of name and marks in a table then displays them in the descending order of the marks. [15] (Unit-I, Topic No. 1.2)

2. 3.

With an example explain how parameters are passed to functions in JavaScript. [15] (Unit-II, Topic No. 2.2) (a) (b) What is Document Object Model (DOM)? Explain the DOM levels. (Unit-III, Topic No. 3.3) Explain the working of XSL. [15] (Unit-III, Topic No. 3.4) Describe the different types of properties used in Java Beans with an example. (Unit-IV, Topic No. 4.6) Explain about introspection. [15] (Unit-IV, Topic No. 4.3)

4.

(a) (b)

5. 6.

Briefly explain about Tomcat web server. [15] (Unit-VI, Topic No. 6.6) (a) (b) What are the limitations of Servlets? How JSP overcomes these problems? (Unit-VI, Topic No. 6.1) Explain the directive and scripting elements of JSP. [15] (Unit-VI, Topic No. 6.2)

7. 8.

Explain error handling and debugging in JSP pages. [15] (Unit-VII, Topic No. 7.3) (a) (b) Explain the process of accessing a database from a JSP page. (Unit-VIII, Topic No. 8.3) Explain struts framework. [15] (Unit-VIII, Topic No. 8.6)

B.Tech. III-Year II-Sem.

( JNTU-Hyderabad )

S.2

Spectrum ALL-IN-ONE Journal for Engineering Students, 2013

SOLUTIONS TO APRIL/MAY-2012, SET-1, QP


Q1. (a) Explain the purpose of cascading style sheets. April/May-12, Set-1, Q1(a) Answer : Purpose of Cascading Style Sheets The main purpose of the CSS is to control the layout of the page. It provides a great appearance to the web pages. It can be of either internal, external or embedded type. The external type of stylesheet allows to make changes only once for all the documents related to it. The stylesheet allows the programmer to keep separate the content of the page from its representation. The stylesheets provide the facility of formatting the web pages using the rules for two kinds of CSS defined by World Wide Web Consortium (W3C). These two different kinds of CSS are: 1. Level 1 CSS and 2. Level 2 CSS 1. Level 1 CSS It consists of 50 properties regarding fonts, color text spacing, alignment, box, margins, background and classification. 2. Level 2 CSS It consists of 70 properties regarding screen-based presentation, media-specific presentation (example: visual browser, Braille devices, handheld devices and printers) positioning of context, table layout, internationalization features etc. (b) Answer : Design and create the page(s) for accepting the values of name and marks in a table then displays them in the descending order of the marks. April/May-12, Set-1, Q1(b)

StudRank.jsp <%@page language = java import = java.sql.* %> <%@page import = java.io.*%> <% Connection c = null; Result r = null; Statement s = null; Class.forName(c.mysql.jdbc.Driver). newInstance ( ); C = Driver Manager.getConnection (jdbc : mysql://localhost : 3306/students, root, system); out.write(Connection has established with mysql !!!); s = c.createStatement( ); if(request.getParameter(action) ! = null) { String Name of Student = request.getParameter(Studname); String Marks of Student = request. getParameter(Studmarks); s.executeUpdate(insert into students_marks(sname, smarks) Values ( + Studname + , + Studmarks + )); r = s.executeQuery(select * from student_marks Order by smarks desc); %> <html> <body> <center>

B.Tech. III-Year II-Sem.

( JNTU-Hyderabad )

Web Technologies (April/May-2012, Set-1) JNTU-Hyderabad


<h2> Students marks List </h2> <table border = 1 cellspacing = 0 cellpadding = 0> <tr> <td> <b> student Name </b> </td> <td> <b> student Marks </b> </td> </tr> <% int num = 1; while (r.next ( ) ) { %> <tr> <td> <% = num % ></td> <td> <% = r.getstring(sname)%> </td> <td> <% = r.getstring(smarks)%> </td> </tr> <% num++; } r.close( ); s.close( ); c.close( ); %> </table> </center> </body> </html> <%}else{%> <html> <head> <title> form registration < /title> <script language = Javascript> function validation (fo) { if(fo. Studname. value. length = = 0) { alert(Please provide the complete data!); fo.Studname.focus( ); return false; }

S.3

B.Tech. III-Year II-Sem.

( JNTU-Hyderabad )

S.4
if(fo.Studmarks. value. length = = 0) { alert(Please provide the complete data!); fo. Studmarks.focus( ); return false; } return true; } </script> </head> <body> <center>

Spectrum ALL-IN-ONE Journal for Engineering Students, 2013

<form action = Stud Rank.jsp method = post name = frm onSubmit = return validation(this)> <input type = hidden value = list name = action> <table border = 4 cell padding = 0 cellspacing = 0> <tr> <td> <table> <tr> <td colspan = 2 align = center> <h2> students name and marks entry form </h2> </td> </tr> <tr> <td colspan = 2 > & nbsp; </td> </tr> <tr> <td> Student Name : </td> <td> <input type = text name = Studname size = 50> </td> </tr> <tr> <td> Student Marks : </td> <td><input type = text name = Studmarks size = 50> </td> </tr> <tr> <td colspan = 2 align = center> <input type = submit value = Submit> </td></tr> </table></td></tr></table></form></center></body> </html> <%}%>

B.Tech. III-Year II-Sem.

( JNTU-Hyderabad )

Web Technologies (April/May-2012, Set-1) JNTU-Hyderabad


Q2. With an example explain how parameters are passed to functions in JavaScript. Answer : For answer refer Unit-II, Q25. Q3. (a) What is Document Object Model (DOM)? Explain the DOM levels.

S.5
April/May-12, Set-1, Q2 M[15]

Answer : For answer refer Unit-III, Q18. (b) Answer : For answer refer Unit-III, Q20. Q4. (a) Explain the working of XSL.

April/May-12, Set-1, Q3(a)

April/May-12, Set-1, Q3(b)

Describe the different types of properties used in Java Beans with an example. April/May-12, Set-1, Q4(a)

Answer : For answer refer April-11, Set-4, Q3(b). (b) Answer : For answer refer Unit-IV, Q8. Q5. Briefly explain about Tomcat web server. Explain about Introspection.

April/May-12, Set-1, Q4(b)

Answer : For answer refer Unit-VI, Q17. Q6. (a)

April/May-12, Set-1, Q5 M[15]

What are the limitations of Servlets? How JSP overcomes these problems? April/May-12, Set-1, Q6(a)

Answer : For answer refer Unit-VI, Q1 (b) Answer : For answer refer Unit-VI, Q3 Q7. Explain error handling and debugging in JSP pages. Explain the directive and scripting elements of JSP.

April/May-12, Set-1, Q6(b)

Answer : For answer refer Unit-VII, Q22, Q23. Q8. (a) Explain the process of accessing a database from a JSP page.

April/May-12, Set-1, Q7 M[15]

Answer : For answer refer Unit-VIII, Q13 (b) Answer : For answer refer Unit-VIII, Q21. Explain struts framework.

April/May-12, Set-1, Q8(a)

April/May-12, Set-1, Q8(b)

B.Tech. III-Year II-Sem.

( JNTU-Hyderabad )