• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

GKPAD.COM

ONLINE HINDI EDUCATION PORTAL

  • Home
  • Blog
  • Sarkari Result
  • University Books
  • University Papers
  • University Syllabus
  • About Us

IGNOU BCS-053 Solved Question Paper PDF Download

The IGNOU BCS-053 Solved Question Paper PDF Download page is designed to help students access high-quality exam resources in one place. Here, you can find ignou solved question paper IGNOU Previous Year Question paper solved PDF that covers all important questions with detailed answers. This page provides IGNOU all Previous year Question Papers in one PDF format, making it easier for students to prepare effectively.

  • IGNOU BCS-053 Solved Question Paper in Hindi
  • IGNOU BCS-053 Solved Question Paper in English
  • IGNOU Previous Year Solved Question Papers (All Courses)

Whether you are looking for IGNOU Previous Year Question paper solved in English or ignou previous year question paper solved in hindi, this page offers both options to suit your learning needs. These solved papers help you understand exam patterns, improve answer writing skills, and boost confidence for upcoming exams.

IGNOU BCS-053 Solved Question Paper PDF

IGNOU Previous Year Solved Question Papers

This section provides IGNOU BCS-053 Solved Question Paper PDF in both Hindi and English. These ignou solved question paper IGNOU Previous Year Question paper solved PDF include detailed answers to help you understand exam patterns and improve your preparation. You can also access IGNOU all Previous year Question Papers in one PDF for quick and effective revision before exams.


IGNOU BCS-053 Previous Year Solved Question Paper in Hindi

Q1. (a) नीचे दिखाए अनुसार वेबपेज बनाने के लिए HTML कोड लिखें: 5 Password : [input] Course Code: [BCS-053 v] (b) CSS का क्या उपयोग है? एक उदाहरण की सहायता से समझाइए। 3 (c) JSP के पेज डायरेक्टिव एलिमेंट को सिंटैक्स के साथ समझाइए। 2 (d) HTML सोर्स कोड में एम्बेडेड getElementById() मेथड के उपयोग को समझाइए। 2 (e) JDBC क्या है? डेटाबेस की स्टूडेंट टेबल में एक रिकॉर्ड डालने के लिए एक JSP प्रोग्राम लिखें। यदि कोई हो, तो उपयुक्त धारणा बनाएं और बताएं। 5 (f) कुकी क्या है? ‘txtcookie’ नाम की एक नई कुकी बनाने के लिए कमांड लिखें। इस कुकी का जीवनकाल 5 मिनट तक सेट करने के लिए एक कमांड भी लिखें। 3

Ans. (a) नीचे दिए गए वेबपेज को बनाने के लिए HTML कोड इस प्रकार है:

यह कोड एक पासवर्ड इनपुट फ़ील्ड और एक ड्रॉप-डाउन मेनू के साथ एक फॉर्म बनाता है। “`html

Student Form

Student Information

Password :

Course Code:

BCS-053

BCS-054

BCS-055

“` (b) CSS का पूरा नाम कैस्केडिंग स्टाइल शीट्स (Cascading Style Sheets) है। इसका मुख्य उपयोग HTML या XML जैसे मार्कअप भाषा में लिखे गए दस्तावेज़ की प्रस्तुति (presentation) और स्टाइलिंग को परिभाषित करना है। CSS कंटेंट (HTML) को प्रेजेंटेशन (CSS) से अलग करता है।

इसके उपयोग निम्नलिखित हैं:

  • यह वेब पेजों के लेआउट, रंग, फ़ॉन्ट और स्पेसिंग को नियंत्रित करता है।
  • यह एक स्टाइल शीट को कई वेब पेजों पर लागू करने की अनुमति देता है, जिससे रखरखाव आसान हो जाता है।
  • यह विभिन्न डिवाइसों (डेस्कटॉप, टैबलेट, मोबाइल) के लिए रेस्पॉन्सिव डिज़ाइन बनाने में मदद करता है।

उदाहरण: मान लीजिए हमारे पास निम्नलिखित HTML है: “`html Welcome to IGNOU

This is a web programming course. “` हम निम्नलिखित CSS का उपयोग करके इसकी स्टाइल बदल सकते हैं: “`css h1 { color: blue; text-align: center; } p { font-family: Arial, sans-serif; font-size: 16px; } “` यह CSS `h1` एलिमेंट के टेक्स्ट को नीला और केंद्र में संरेखित करेगा, और `p` एलिमेंट के फ़ॉन्ट को Arial और आकार को 16 पिक्सेल पर सेट करेगा। (c) JSP में, पेज डायरेक्टिव (`<%@ page … %>`) पूरे JSP पेज पर लागू होने वाले निर्देशों को परिभाषित करता है। यह JSP कंटेनर को बताता है कि पेज का अनुवाद और निष्पादन कैसे करें।

सिंटैक्स: `<%@ page attribute1=”value1″ attribute2=”value2″ … %>`

मुख्य एट्रिब्यूट्स:

  • import : जावा क्लास को इम्पोर्ट करने के लिए। जैसे: `import=”java.util.Date”`।
  • contentType : रिस्पांस के MIME प्रकार और करैक्टर एन्कोडिंग को सेट करने के लिए। जैसे: `contentType=”text/html; charset=UTF-8″`।
  • session : पेज को HTTP सेशन में भाग लेने की अनुमति देने के लिए (`true` या `false`)।
  • errorPage : यदि इस पेज पर कोई अपवाद (exception) होता ہے तो किस पेज पर रीडायरेक्ट करना है।

(d) `getElementById()` जावास्क्रिप्ट में `document` ऑब्जेक्ट का एक मेथड है। इसका उपयोग HTML डॉक्यूमेंट में किसी विशेष एलिमेंट को उसके अद्वितीय `id` एट्रिब्यूट के माध्यम से एक्सेस करने के लिए किया जाता है।

जब इस मेथड को एक `id` मान के साथ कॉल किया जाता है, तो यह पूरे डॉक्यूमेंट ऑब्जेक्ट मॉडल (DOM) में उस `id` वाले एलिमेंट को खोजता है और उस एलिमेंट के ऑब्जेक्ट को लौटाता है। यदि कोई एलिमेंट नहीं मिलता है, तो यह `null` लौटाता है।

उदाहरण: “`html Hello World! “` इस उदाहरण में, जावास्क्रिप्ट `p` टैग को उसके `id` “demo” से ढूंढता है और उसके टेक्स्ट को बदल देता है। (e) JDBC का पूरा नाम जावा डेटाबेस कनेक्टिविटी (Java Database Connectivity) है। यह एक जावा एपीआई (API) है जो परिभाषित करता है कि एक जावा एप्लिकेशन डेटाबेस तक कैसे पहुंच सकता है। यह रिलेशनल डेटाबेस से डेटा क्वेरी करने और अपडेट करने के लिए मेथड प्रदान करता है। JDBC ड्राइवर का उपयोग करके, जावा विभिन्न प्रकार के डेटाबेस (जैसे MySQL, Oracle, PostgreSQL) से जुड़ सकता है।

धारणाएं:

  • डेटाबेस का नाम: `my_db`
  • टेबल का नाम: `student`
  • टेबल के कॉलम: `enrollment_no` (VARCHAR), `name` (VARCHAR), `course_code` (VARCHAR)
  • MySQL JDBC ड्राइवर क्लास पाथ में मौजूद है।
  • डेटाबेस चल रहा है और `jdbc:mysql://localhost:3306/my_db` पर उपलब्ध है।

रिकॉर्ड डालने के लिए JSP प्रोग्राम: “`jsp <%@ page import=”java.sql.*” %>

Insert Record

<% // रिकॉर्ड करने के लिए डेटा String enr_no = “123456789”; String studentName = “Ravi Kumar”; String course = “BCS-053”; Connection conn = null; PreparedStatement pstmt = null; try { // 1. JDBC ड्राइवर लोड करें Class.forName(“com.mysql.cj.jdbc.Driver”); // 2. कनेक्शन स्थापित करें conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/my_db”, “root”, “password”); // 3. SQL INSERT स्टेटमेंट बनाएं String sql = “INSERT INTO student (enrollment_no, name, course_code) VALUES (?, ?, ?)”; pstmt = conn.prepareStatement(sql); // 4. पैरामीटर सेट करें pstmt.setString(1, enr_no); pstmt.setString(2, studentName); pstmt.setString(3, course); // 5. स्टेटमेंट निष्पादित करें int rowsAffected = pstmt.executeUpdate(); if (rowsAffected > 0) { out.println(” Record inserted successfully! “); } else { out.println(” Failed to insert record. “); } } catch (Exception e) { e.printStackTrace(new java.io.PrintWriter(out)); } finally { // 6. संसाधन बंद करें if (pstmt != null) try { pstmt.close(); } catch (SQLException ignore) {} if (conn != null) try { conn.close(); } catch (SQLException ignore) {} } %>

“` (f) एक कुकी (Cookie) डेटा का एक छोटा टुकड़ा है जिसे एक वेबसाइट उपयोगकर्ता के वेब ब्राउज़र के माध्यम से उपयोगकर्ता के कंप्यूटर पर संग्रहीत करती है। इसका उपयोग सेशन प्रबंधन, वैयक्तिकरण (personalization) और उपयोगकर्ता ट्रैकिंग के लिए किया जाता है। जब उपयोगकर्ता उसी वेबसाइट पर वापस जाता है, तो ब्राउज़र कुकी को सर्वर पर वापस भेजता है।

‘txtcookie’ नाम की एक नई कुकी बनाने के लिए कमांड (JSP/Servlet में):

यह कमांड एक कुकी ऑब्जेक्ट बनाता है जिसका नाम ‘txtcookie’ और मान ‘someValue’ है। “`java Cookie newCookie = new Cookie(“txtcookie”, “someValue”); “` इस कुकी का जीवनकाल 5 मिनट तक सेट करने के लिए कमांड:

`setMaxAge()` मेथड सेकंड में समय लेता है, इसलिए 5 मिनट के लिए हमें 5 * 60 = 300 सेकंड सेट करना होगा। “`java newCookie.setMaxAge(5 * 60); “` अंत में, इस कुकी को उपयोगकर्ता के ब्राउज़र पर भेजने के लिए, इसे `response` ऑब्जेक्ट में जोड़ा जाना चाहिए: “`java response.addCookie(newCookie); “`

Q2. (a) WML क्या है? एक छात्र का विवरण प्रदर्शित करने के लिए WML प्रोग्राम डिज़ाइन करें, जिसमें एनरोलमेंट नंबर, नाम, प्रोग्राम कोड और कोर्स कोड जैसे एट्रिब्यूट्स हों। 5 (b) एक आरेख की सहायता से JSP जीवन चक्र की व्याख्या करें। 5

Ans. (a) WML का पूरा नाम वायरलेस मार्कअप लैंग्वेज (Wireless Markup Language) है। यह एक XML-आधारित मार्कअप भाषा है जिसका उपयोग ऐसे वेब पेज बनाने के लिए किया जाता है जिन्हें WAP (वायरलेस एप्लिकेशन प्रोटोकॉल) ब्राउज़र पर प्रदर्शित किया जा सकता है, जैसे कि पुराने फीचर फोन पर।

WML की संरचना डेक (Decks) और कार्ड (Cards) पर आधारित है। एक डेक एक पूर्ण WML दस्तावेज़ है, और एक कार्ड उपयोगकर्ता के लिए इंटरैक्शन की एक एकल इकाई है (एक स्क्रीन के बराबर)। उपयोगकर्ता एक ही डेक के भीतर विभिन्न कार्डों के बीच नेविगेट कर सकता है, जिससे सर्वर पर बार-बार अनुरोध करने की आवश्यकता कम हो जाती है।

छात्र विवरण प्रदर्शित करने के लिए WML प्रोग्राम:

यह प्रोग्राम एक कार्ड के साथ एक डेक बनाता है जो छात्र के विवरण को शीर्षक और पैराग्राफ में दिखाता है। “`xml “http://www.wapforum.org/DTD/wml_1.1.xml”>

Student Information:

Enrolment Number: 210123456

Name: Anjali Sharma

Program Code: BCA

Course Code: BCS-053

“` इस कोड को `.wml` एक्सटेंशन के साथ सहेजा जाएगा और WAP ब्राउज़र या एमुलेटर में देखा जा सकता है। (b) JSP (जावा सर्वर पेज) जीवन चक्र उन चरणों का वर्णन करता है जिनसे एक JSP पेज अपनी रचना से लेकर विनाश तक गुजरता है। JSP कंटेनर (जैसे अपाचे टॉमकैट) इन चरणों का प्रबंधन करता है। JSP जीवन चक्र में निम्नलिखित चरण होते हैं:

  1. अनुवाद (Translation): जब किसी JSP पेज के लिए पहला अनुरोध आता है, तो JSP कंटेनर `.jsp` फ़ाइल को एक जावा सर्वलेट स्रोत फ़ाइल ( `.java` फ़ाइल) में अनुवादित करता है।
  2. संकलन (Compilation): कंटेनर फिर उत्पन्न सर्वलेट स्रोत फ़ाइल को जावा बाइटकोड ( `.class` फ़ाइल) में संकलित करता है।
  3. लोडिंग (Class Loading): संकलित `.class` फ़ाइल को कंटेनर द्वारा मेमोरी में लोड किया जाता है।
  4. इंस्टेंशिएशन (Instantiation): कंटेनर सर्वलेट क्लास का एक उदाहरण (ऑब्जेक्ट) बनाता है।
  5. आरंभीकरण (Initialization): कंटेनर सर्वलेट इंस्टेंस पर `jspInit()` मेथड को कॉल करता है। यह मेथड पूरे जीवनकाल में केवल एक बार कॉल किया जाता है। इसका उपयोग डेटाबेस कनेक्शन या अन्य एकमुश्त सेटअप कार्यों को आरंभ करने के लिए किया जा सकता है।
  6. अनुरोध प्रसंस्करण (Request Processing): प्रत्येक क्लाइंट अनुरोध के लिए, कंटेनर सर्वलेट पर `_jspService()` मेथड को कॉल करता है। यह मेथड अनुरोध को संसाधित करता है और क्लाइंट को प्रतिक्रिया उत्पन्न करता है। यह चरण जीवन चक्र का मुख्य भाग है और कई बार निष्पादित होता है।
  7. विनाश (Destruction): जब JSP पेज को सेवा से हटा दिया जाता है (जैसे जब वेब एप्लिकेशन बंद हो जाता है), तो कंटेनर `jspDestroy()` मेथड को कॉल करता है। यह मेथड जीवनकाल में केवल एक बार कॉल किया जाता है और इसका उपयोग संसाधनों, जैसे डेटाबेस कनेक्शन, को जारी करने के लिए किया जाता है।

JSP जीवन चक्र का आरेख:

[JSP Page (.jsp)] –> Translation –> [Servlet Source (.java)] –> Compilation –> [Servlet Class (.class)] –> Loading & Instantiation –> [Servlet Instance] –(एक बार)–> Initialization (`jspInit()`) –> Request Processing (`_jspService()`) <– [Client Request] –> [Response to Client] –(लूप)–> (अगले अनुरोध के लिए `_jspService()` पर वापस) –> Destruction (`jspDestroy()`) –(जब एप्लिकेशन बंद होता है)

Q3. (a) वेब एप्लिकेशन की 3-स्तरीय वास्तुकला में प्रत्येक स्तर की भूमिका की व्याख्या करें। 3 (b) वर्तमान तिथि और समय प्रिंट करने के लिए एक JSP प्रोग्राम लिखें। 3 (c) निम्नलिखित के बीच अंतर करें: 4 (i) <jsp : include> और <jsp : forward> (ii) Get और Post मेथड

Ans. (a) 3-स्तरीय वास्तुकला (3-Tier Architecture) एक सॉफ्टवेयर एप्लिकेशन आर्किटेक्चर है जो एप्लिकेशन को तीन तार्किक और भौतिक कंप्यूटिंग स्तरों में विभाजित करता है: प्रेजेंटेशन टियर, लॉजिक टियर और डेटा टियर।

  1. प्रेजेंटेशन टियर (Presentation Tier): यह शीर्ष-स्तरीय टियर है और उपयोगकर्ता के साथ सीधे इंटरैक्ट करता है। इसकी मुख्य भूमिका उपयोगकर्ता को जानकारी प्रदर्शित करना और उपयोगकर्ता से इनपुट एकत्र करना है। वेब अनुप्रयोगों में, यह आमतौर पर एक वेब ब्राउज़र होता है जो HTML, CSS और जावास्क्रिप्ट को प्रस्तुत करता है। यह टियर उपयोगकर्ता इंटरफ़ेस (UI) के लिए जिम्मेदार है।
  2. लॉजिक टियर (Logic Tier / Application Tier): यह मध्य टियर है। यह प्रेजेंटेशन टियर से प्राप्त अनुरोधों को संसाधित करता है, व्यावसायिक तर्क (business logic) को लागू करता है, और डेटा टियर के साथ संचार करके आवश्यक डेटा प्राप्त या संग्रहीत करता है। यह एप्लिकेशन का “मस्तिष्क” है। वेब अनुप्रयोगों में, यह एक वेब सर्वर पर चलने वाले JSP, सर्वलेट्स, या अन्य सर्वर-साइड प्रौद्योगिकियों द्वारा कार्यान्वित किया जाता है।
  3. डेटा टियर (Data Tier): यह टियर डेटा के भंडारण और प्रबंधन के लिए जिम्मेदार है। इसमें डेटाबेस सर्वर होता है जो डेटा को संग्रहीत, पुनर्प्राप्त और अद्यतन करता है। लॉजिक टियर इस टियर को डेटा के लिए क्वेरी भेजता है। इस टियर का मुख्य लाभ यह है कि डेटा को एप्लिकेशन और प्रेजेंटेशन लॉजिक से स्वतंत्र रूप से प्रबंधित किया जा सकता है। उदाहरण: MySQL, Oracle, MongoDB सर्वर।

(b) वर्तमान तिथि और समय को प्रिंट करने के लिए JSP प्रोग्राम बहुत सरल है। हम `java.util.Date` क्लास का उपयोग कर सकते हैं और इसे JSP एक्सप्रेशन टैग `<%= … %>` का उपयोग करके सीधे आउटपुट कर सकते हैं।

JSP प्रोग्राम: “`jsp <%@ page import=”java.util.Date, java.text.SimpleDateFormat” %>

Current Date and Time

JSP Current Date and Time

Using java.util.Date: <%= new Date() %>

<%– बेहतर फॉर्मेटिंग के लिए SimpleDateFormat का उपयोग करना –%> Formatted Date and Time: <% Date currentDate = new Date(); SimpleDateFormat formatter = new SimpleDateFormat(“dd-MM-yyyy HH:mm:ss a”); String formattedDate = formatter.format(currentDate); out.println(formattedDate); %>

“` पहला उदाहरण `Date` ऑब्जेक्ट का डिफ़ॉल्ट स्ट्रिंग प्रतिनिधित्व प्रिंट करता है। दूसरा उदाहरण `SimpleDateFormat` का उपयोग करके दिनांक और समय को एक विशिष्ट, पठनीय प्रारूप (`dd-MM-yyyy HH:mm:ss a`) में प्रदर्शित करता है। (c) (i)

  • प्रवाह नियंत्रण (Control Flow):
    • <jsp:include>: यह किसी अन्य संसाधन (जैसे JSP, HTML) की सामग्री को वर्तमान JSP पेज में शामिल करता है। शामिल संसाधन के निष्पादन के बाद, नियंत्रण वापस मूल JSP पेज पर लौट आता है, जो अपना निष्पादन जारी रखता है।
    • <jsp:forward>: यह अनुरोध को एक JSP पेज से दूसरे संसाधन पर पूरी तरह से अग्रेषित (forward) करता है। नियंत्रण मूल JSP पेज पर वापस नहीं लौटता है।
  • प्रतिक्रिया (Response):
    • <jsp:include>: मूल JSP और शामिल JSP दोनों मिलकर अंतिम प्रतिक्रिया उत्पन्न करते हैं।
    • <jsp:forward>: केवल अग्रेषित संसाधन ही प्रतिक्रिया उत्पन्न करने के लिए जिम्मेदार होता है। मूल JSP का कोई भी आउटपुट जो बफर में होता है, अग्रेषित करने से पहले साफ़ कर दिया जाता है।
  • उपयोग का मामला (Use Case):
    • <jsp:include>: पुन: प्रयोज्य पेज घटकों, जैसे हेडर, फुटर या नेविगेशन बार, को शामिल करने के लिए उपयोग किया जाता है।
    • <jsp:forward>: अनुरोध को किसी अन्य पेज पर संसाधित करने के लिए निर्देशित करने के लिए उपयोग किया जाता है, जैसे लॉगिन के बाद उपयोगकर्ता को डैशबोर्ड पर भेजना।

(ii) GET और POST मेथड में अंतर

  • डेटा भेजना:
    • GET: फॉर्म डेटा को URL में नाम/मान जोड़े के रूप में संलग्न करता है। (जैसे: `…/page.jsp?name=amit&age=25`)।
    • POST: फॉर्म डेटा को HTTP अनुरोध के बॉडी के भीतर भेजता है।
  • डेटा सीमा:
    • GET: भेजे जा सकने वाले डेटा की मात्रा सीमित है (URL की लंबाई सीमा के कारण, आमतौर पर लगभग 2048 वर्ण)।
    • POST: डेटा भेजने की कोई सीमा नहीं है।
  • सुरक्षा:
    • GET: कम सुरक्षित है क्योंकि डेटा URL में दिखाई देता है, और यह ब्राउज़र इतिहास और सर्वर लॉग में संग्रहीत हो जाता है। संवेदनशील डेटा के लिए इसका उपयोग नहीं किया जाना चाहिए।
    • POST: अधिक सुरक्षित है क्योंकि डेटा URL में दिखाई नहीं देता है।
  • बुकमार्क और इडेम्पोटेंस (Idempotency):
    • GET: अनुरोधों को बुकमार्क किया जा सकता है। यह इडेम्पोटेंट है, जिसका अर्थ है कि एक ही अनुरोध को कई बार करने से कोई अलग प्रभाव नहीं पड़ेगा।
    • POST: अनुरोधों को बुकमार्क नहीं किया जा सकता है। यह इडेम्पोटेंट नहीं है; एक ही अनुरोध को फिर से सबमिट करने से डुप्लिकेट रिकॉर्ड बन सकते हैं।

Q4. (a) JSP में सेशन मैनेजमेंट क्या है? विभिन्न सेशन ट्रैकिंग विधियों की व्याख्या करें। 5 (b) HTML के संदर्भ में डॉक्यूमेंट ऑब्जेक्ट मॉडल का क्या अर्थ है? जावास्क्रिप्ट और HTML का उपयोग करके एक प्रोग्राम लिखें जो एक पैराग्राफ टेक्स्ट को ‘IGNOU’ से ‘Welcome in IGNOU’ में बदलता है। 5

Ans. (a) JSP में सेशन मैनेजमेंट (Session Management) एक वेब एप्लिकेशन के साथ उपयोगकर्ता के इंटरैक्शन को कई HTTP अनुरोधों में बनाए रखने की प्रक्रिया है। चूंकि HTTP एक स्टेटलेस प्रोटोकॉल है, प्रत्येक अनुरोध स्वतंत्र होता है। सेशन मैनेजमेंट सर्वर को उपयोगकर्ता की पहचान, उसकी गतिविधियों (जैसे शॉपिंग कार्ट में आइटम), और अन्य जानकारी को याद रखने की अनुमति देता है जब उपयोगकर्ता साइट के विभिन्न पेजों पर नेविगेट करता है।

विभिन्न सेशन ट्रैकिंग विधियाँ (Session Tracking Methods):

  1. कुकीज़ (Cookies): यह सबसे आम तरीका है। सर्वर उपयोगकर्ता के ब्राउज़र को एक छोटी टेक्स्ट फ़ाइल (कुकी) भेजता है जिसमें एक अद्वितीय सेशन आईडी होती है। ब्राउज़र इस कुकी को संग्रहीत करता है और प्रत्येक बाद के अनुरोध के साथ सर्वर को वापस भेजता है। सर्वर इस आईडी का उपयोग उपयोगकर्ता के सेशन डेटा को पुनर्प्राप्त करने के लिए करता है।
  2. URL पुनर्लेखन (URL Rewriting): यदि उपयोगकर्ता का ब्राउज़र कुकीज़ को अक्षम कर देता है, तो सेशन आईडी को वेबसाइट के प्रत्येक URL के अंत में मैन्युअल रूप से जोड़ा जा सकता है। उदाहरण: `page.jsp;jsessionid=12345ABCDE`। यह विधि कम सुरक्षित है और URL को जटिल बना देती है।
  3. छिपे हुए फॉर्म फ़ील्ड (Hidden Form Fields): सेशन आईडी को एक HTML फॉर्म में एक छिपे हुए इनपुट फ़ील्ड (` `) का उपयोग करके संग्रहीत किया जा सकता है। जब उपयोगकर्ता फॉर्म जमा करता है, तो सेशन आईडी सर्वर को भेजी जाती है। यह विधि केवल उन पेजों के अनुक्रम के लिए काम करती है जो फॉर्म सबमिशन पर निर्भर करते हैं।
  4. HTTPSession ऑब्जेक्ट: यह JSP/Servlet API द्वारा प्रदान की गई एक उच्च-स्तरीय, सर्वर-साइड विधि है। JSP कंटेनर स्वचालित रूप से एक `HttpSession` ऑब्जेक्ट बनाता है और प्रत्येक उपयोगकर्ता के लिए इसे प्रबंधित करता है। डेवलपर `session.setAttribute()` और `session.getAttribute()` मेथड का उपयोग करके इस ऑब्जेक्ट में डेटा स्टोर और पुनर्प्राप्त कर सकता है। आंतरिक रूप से, कंटेनर सेशन को ट्रैक करने के लिए कुकीज़ (डिफ़ॉल्ट रूप से) या URL पुनर्लेखन का उपयोग करता है। यह JSP में सेशन प्रबंधन का सबसे पसंदीदा और आसान तरीका है।

(b) डॉक्यूमेंट ऑब्जेक्ट मॉडल (DOM) HTML, XHTML, या XML दस्तावेज़ों के लिए एक प्रोग्रामिंग इंटरफ़ेस है। यह एक दस्तावेज़ की तार्किक संरचना को एक ट्री (tree) के रूप में प्रस्तुत करता है। इस ट्री में प्रत्येक नोड (node) दस्तावेज़ के एक हिस्से का प्रतिनिधित्व करता है, जैसे कि एक एलिमेंट, एक एट्रिब्यूट, या टेक्स्ट।

HTML के संदर्भ में, DOM ब्राउज़र को एक वेब पेज को ऑब्जेक्ट्स के एक पदानुक्रम के रूप में देखने की अनुमति देता है। जावास्क्रिप्ट जैसी स्क्रिप्टिंग भाषाएं इस मॉडल का उपयोग किसी दस्तावेज़ की सामग्री, संरचना और शैली को गतिशील रूप से एक्सेस करने और हेरफेर करने के लिए कर सकती हैं। उदाहरण के लिए, जावास्क्रिप्ट DOM का उपयोग करके एक एलिमेंट का रंग बदल सकता है, एक नया एलिमेंट जोड़ सकता है, या किसी एलिमेंट की सामग्री को संशोधित कर सकता है।

जावास्क्रिप्ट और HTML का उपयोग करके प्रोग्राम:

यह प्रोग्राम एक पैराग्राफ और एक बटन बनाता है। जब बटन पर क्लिक किया जाता है, तो एक जावास्क्रिप्ट फ़ंक्शन पैराग्राफ के टेक्स्ट को बदल देता है। “`html

DOM Manipulation Example

DOM Example

IGNOU

Change Text

“` इस कोड में:

  • `

    IGNOU

    ` वह एलिमेंट है जिसे हम बदलना चाहते हैं।

  • `
  • `changeText()` फ़ंक्शन `document.getElementById()` का उपयोग करके पैराग्राफ को ढूंढता है और फिर उसके टेक्स्ट को बदलने के लिए `.innerHTML` प्रॉपर्टी का उपयोग करता है।

Q5. निम्नलिखित में से किन्हीं चार की व्याख्या उदाहरण/आरेख की सहायता से करें, यदि आवश्यक हो: 4×2.5 = 10 (a) WML घटक (b) XML स्कीमा (c) JDBC-ODBC ब्रिज (d) डिप्लॉयमेंट डिस्क्रिप्टर (e) <detail> और <summary> टैग का उपयोग

Ans. (a) WML (वायरलेस मार्कअप लैंग्वेज) घटक

WML दस्तावेज़ों को बनाने के लिए कई मुख्य घटकों का उपयोग करता है, जो WAP-सक्षम उपकरणों के लिए डिज़ाइन किए गए हैं।

  • डेक (Deck): एक WML दस्तावेज़ का मूल तत्व ` ` होता है, जिसे डेक कहा जाता है। एक डेक में एक या अधिक कार्ड होते हैं। सर्वर से एक ही अनुरोध में पूरा डेक डिवाइस पर डाउनलोड हो जाता है।
  • कार्ड (Card): एक कार्ड (` `) उपयोगकर्ता के लिए बातचीत की एक एकल इकाई है, जो एक स्क्रीन पर प्रदर्शित होने वाली जानकारी के समान है। उपयोगकर्ता सर्वर से दोबारा संपर्क किए बिना एक ही डेक के भीतर कार्डों के बीच नेविगेट कर सकता है। “`xml

    This is the first card.

    This is the second card.

    “`

  • इवेंट्स (Events): ये क्रियाओं को ट्रिगर करते हैं। सामान्य इवेंट्स में `onenterforward` (जब उपयोगकर्ता कार्ड में प्रवेश करता है) और `ontimer` (एक निश्चित समय के बाद) शामिल हैं।
  • टास्क (Tasks): ये वे क्रियाएं हैं जो किसी इवेंट के होने पर की जाती हैं। उदाहरण के लिए, ` ` किसी अन्य कार्ड या URL पर नेविगेट करता है, ` ` पिछले कार्ड पर जाता है, और ` ` चरों को अपडेट करता है।

(b) XML स्कीमा (XML Schema)

XML स्कीमा, जिसे अक्सर XSD (XML स्कीमा परिभाषा) कहा जाता है, एक XML दस्तावेज़ की संरचना और सामग्री को परिभाषित करने का एक तरीका है। यह DTD (डॉक्यूमेंट टाइप डेफिनिशन) का एक अधिक शक्तिशाली और लचीला विकल्प है।

उद्देश्य:

  • यह परिभाषित करता है कि XML दस्तावेज़ में कौन से एलिमेंट और एट्रिब्यूट दिखाई दे सकते हैं।
  • यह एलिमेंट्स का क्रम, उनकी संख्या और उनके डेटा प्रकार (जैसे स्ट्रिंग, इंटीजर, डेट) को निर्दिष्ट करता है।
  • यह XML दस्तावेज़ की वैधता को सत्यापित करने के लिए एक “ब्लूप्रिंट” के रूप में कार्य करता है।

उदाहरण: मान लीजिए हमारे पास यह XML है: “`xml

Amit

101

“` इसके लिए एक सरल XSD इस प्रकार होगा: “`xml

“` यह स्कीमा निर्दिष्ट करता है कि ` ` एलिमेंट में एक ` ` (स्ट्रिंग) और उसके बाद एक ` ` (इंटीजर) होना चाहिए। (c) JDBC-ODBC ब्रिज

JDBC-ODBC ब्रिज एक टाइप 1 JDBC ड्राइवर है जो JDBC API कॉल को ODBC (ओपन डेटाबेस कनेक्टिविटी) कॉल में अनुवादित करता है। यह जावा अनुप्रयोगों को किसी भी ऐसे डेटाबेस से कनेक्ट करने की अनुमति देता है जिसके लिए ODBC ड्राइवर उपलब्ध है।

कार्यप्रणाली का आरेख:

`[जावा एप्लिकेशन] -> [JDBC API] -> [JDBC-ODBC ब्रिज ड्राइवर] -> [ODBC ड्राइवर] -> [डेटाबेस]`

उपयोग: यह तब उपयोगी था जब सभी डेटाबेस के लिए शुद्ध जावा JDBC ड्राइवर उपलब्ध नहीं थे। डेवलपर्स किसी भी डेटाबेस से जुड़ने के लिए मौजूदा ODBC ड्राइवरों का लाभ उठा सकते थे।

नुकसान और वर्तमान स्थिति:

यह प्रदर्शन में धीमा है क्योंकि इसमें JDBC से ODBC में अनुवाद की एक अतिरिक्त परत होती है।

क्लाइंट मशीन पर ODBC ड्राइवर की स्थापना और कॉन्फ़िगरेशन की आवश्यकता होती है।

इसे Java SE 8 से हटा दिया गया है और अब इसे अप्रचलित माना जाता है। आधुनिक अनुप्रयोगों को सीधे डेटाबेस विक्रेता द्वारा प्रदान किए गए टाइप 4 (शुद्ध जावा) ड्राइवरों का उपयोग करना चाहिए।

(d) डिप्लॉयमेंट डिस्क्रिप्टर (Deployment Descriptor)

डिप्लॉयमेंट डिस्क्रिप्टर एक जावा वेब एप्लिकेशन के लिए एक कॉन्फ़िगरेशन फ़ाइल है, जिसका नाम `web.xml` है। यह एप्लिकेशन के `WEB-INF/` डायरेक्टरी में स्थित होती है।

उद्देश्य: यह सर्वलेट कंटेनर (जैसे टॉमकैट) को बताता है कि वेब एप्लिकेशन को कैसे तैनात और कॉन्फ़िगर करना है। यह एप्लिकेशन के विभिन्न घटकों और सेटिंग्स को परिभाषित करता है।

`web.xml` में परिभाषित मुख्य तत्व:

सर्वलेट घोषणाएँ और मैपिंग: ` ` और ` ` टैग का उपयोग करके सर्वलेट को कॉन्फ़िगर करना।

स्वागत फ़ाइलें (Welcome Files): ` ` जो एप्लिकेशन के रूट URL पर अनुरोध करने पर दिखाई जाने वाली डिफ़ॉल्ट फ़ाइल को निर्दिष्ट करता है।

सेशन कॉन्फ़िगरेशन: ` ` का उपयोग करके सेशन टाइमआउट सेट करना।

त्रुटि पृष्ठ (Error Pages): ` ` जो विशिष्ट HTTP त्रुटियों या अपवादों के लिए कस्टम त्रुटि पृष्ठों को मैप करता है।

फ़िल्टर (Filters): ` ` और ` ` का उपयोग करके अनुरोधों और प्रतिक्रियाओं को इंटरसेप्ट करने के लिए फ़िल्टर को कॉन्फ़िगर करना।

Servlet 3.0 और बाद के संस्करणों में, एनोटेशन (जैसे `@WebServlet`) का उपयोग `web.xml` की आवश्यकता को कम कर सकता है, लेकिन यह अभी भी जटिल कॉन्फ़िगरेशन के लिए उपयोग किया जाता है। (e)

ये HTML5 में पेश किए गए सिमेंटिक टैग हैं जिनका उपयोग एक “डिस्क्लोजर विजेट” या “अकॉर्डियन” बनाने के लिए किया जाता है, जहाँ उपयोगकर्ता सामग्री को दिखा या छिपा सकता है।

` ` टैग: यह विजेट के लिए कंटेनर है। इस टैग के अंदर की सामग्री (जो ` ` टैग के बाहर है) डिफ़ॉल्ट रूप से छिपी होती है।

` ` टैग: यह ` ` विजेट के लिए एक दृश्यमान शीर्षक प्रदान करता है। जब उपयोगकर्ता इस शीर्षक पर क्लिक करता है, तो ` ` टैग की शेष सामग्री की दृश्यता टॉगल हो जाती है (दिखाई/छिप जाती है)।

यह अक्सर FAQ (अक्सर पूछे जाने वाले प्रश्न) सेक्शन बनाने के लिए उपयोग किया जाता है।

उदाहरण: “`html

What is Web Programming?

Web Programming refers to the writing, markup and coding involved in Web development, which includes Web content, Web client and server scripting and network security.

What are the core technologies?

HTML

CSS

JavaScript

“` इस उदाहरण में, उपयोगकर्ता प्रश्नों (` ` टेक्स्ट) पर क्लिक करके उत्तरों (` ` या ` `) को देख या छिपा सकता है। `open` एट्रिब्यूट का उपयोग करके एक ` ` एलिमेंट को डिफ़ॉल्ट रूप से खुला बनाया जा सकता है: ` … `।

IGNOU BCS-053 Previous Year Solved Question Paper in English

Q1. (a) Write HTML code to create a webpage as shown below : 5 Password : [input] Course Code: [BCS-053 v] (b) What is the use of CSS ? Explain with the help of an example. 3 (c) Explain the page directive element of JSP with syntax. 2 (d) Explain the use of getElementByld( ) method embedded in HTML source code. 2 (e) What is JDBC ? Write a JSP program to insert a record in the student table of database. Make and state suitable assumption, if any. 5 (f) What is a cookie ? Write command to create a new cookie having a name ‘txtcookie’. Also write a command to set the life of this cookie to 5 minutes. 3

Ans. (a) The HTML code to create the webpage with a password field and a dropdown menu is as follows: This code creates a form with a label “Password” followed by a password input field, and a label “Course Code” followed by a select (dropdown) list where “BCS-053” is pre-selected. “`html Student Form

Student Information

“`

(b) CSS stands for Cascading Style Sheets . Its primary use is to describe the presentation and styling of a document written in a markup language like HTML. CSS separates the content (HTML) from the presentation (CSS). Key uses of CSS include:

  • Controlling the layout, colors, fonts, and spacing of web pages.
  • Allowing a single stylesheet to be applied to multiple web pages, making maintenance easier and more efficient.
  • Enabling responsive design, which adapts the page layout to different devices (desktops, tablets, phones).


Example:

Consider the following HTML:

“`html

Welcome to IGNOU

This is a web programming course.

“`

We can style this HTML using the following CSS:

“`css

h1 {

color: blue;

text-align: center;

}

p {

font-family: Arial, sans-serif;

font-size: 16px;

}

“`

This CSS will change the color of the `

` element to blue and center-align it. It will also set the font of the `

` element to Arial and its size to 16 pixels.

(c) In JSP, the page directive (`<%@ page … %>`) defines attributes that apply to the entire JSP page. It provides instructions to the JSP container on how to translate and execute the page. Syntax: `<%@ page attribute1=”value1″ attribute2=”value2″ … %>` Common Attributes:

  • import : To import Java classes. E.g., `import=”java.util.Date”`.
  • contentType : To set the MIME type and character encoding of the response. E.g., `contentType=”text/html; charset=UTF-8″`.
  • session : To specify whether the page participates in an HTTP session (`true` or `false`).
  • errorPage : Specifies a page to which the request is redirected if an unhandled exception occurs.

(d) The `getElementById()` method is a method of the `document` object in JavaScript. Its purpose is to access a specific HTML element in the document by its unique `id` attribute. When this method is called with an ID value, it searches the entire Document Object Model (DOM) tree for the element with that specific ID and returns the element object. If no element with the given ID is found, it returns `null`. Example: “`html

Hello World!

“` In this example, JavaScript finds the `p` tag by its ID “demo” and changes its inner text.

(e) JDBC stands for Java Database Connectivity . It is a Java API that defines how a client can access a database. It provides methods for querying and updating data in a database, and is primarily oriented towards relational databases. Using a JDBC driver, a Java application can connect to various databases like MySQL, Oracle, PostgreSQL, etc. Assumptions:

  • Database name: `my_db`
  • Table name: `student`
  • Table columns: `enrollment_no` (VARCHAR), `name` (VARCHAR), `course_code` (VARCHAR)
  • The MySQL JDBC driver is present in the classpath.
  • The database is running and accessible at `jdbc:mysql://localhost:3306/my_db`.


JSP Program to insert a record:

“`jsp

<%@ page import=”java.sql.*” %>

<br /> Insert Record<br />

<%

// Data to be inserted

String enr_no = “123456789”;

String studentName = “Ravi Kumar”;

String course = “BCS-053”;

Connection conn = null; PreparedStatement pstmt = null;

try { // 1. Load the JDBC driver Class.forName(“com.mysql.cj.jdbc.Driver”);

// 2. Establish the connection conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/my_db”, “root”, “password”);

// 3. Create the SQL INSERT statement String sql = “INSERT INTO student (enrollment_no, name, course_code) VALUES (?, ?, ?)”; pstmt = conn.prepareStatement(sql);

// 4. Set the parameters pstmt.setString(1, enr_no); pstmt.setString(2, studentName); pstmt.setString(3, course);

// 5. Execute the statement int rowsAffected = pstmt.executeUpdate();

if (rowsAffected > 0) { out.println(”

Record inserted successfully!

“);

} else {

out.println(”

Failed to insert record.

“);

}

} catch (Exception e) { e.printStackTrace(new java.io.PrintWriter(out)); } finally { // 6. Close the resources if (pstmt != null) try { pstmt.close(); } catch (SQLException ignore) {} if (conn != null) try { conn.close(); } catch (SQLException ignore) {} } %> “`

(f) A Cookie is a small piece of data that a server sends to the user’s web browser. The browser may store it and send it back with later requests to the same server. It is used for session management, personalization, and user tracking. Command to create a new cookie named ‘txtcookie’ (in JSP/Servlet): This command creates a Cookie object with the name ‘txtcookie’ and a corresponding value. “`java Cookie newCookie = new Cookie(“txtcookie”, “someValue”); “` Command to set the life of this cookie to 5 minutes: The `setMaxAge()` method takes the time in seconds. For 5 minutes, we set it to 5 * 60 = 300 seconds. “`java newCookie.setMaxAge(5 * 60); “` Finally, to send this cookie to the user’s browser, it must be added to the `response` object: “`java response.addCookie(newCookie); “`

Q2. (a) What is WML ? Design WML program to display the details of a student having attributes as enrolment number, name, program code and course code. 5 (b) Explain the JSP life with the help of a diagram. 5

Ans. (a) WML stands for Wireless Markup Language . It is an XML-based markup language used for creating web pages that can be displayed on a WAP (Wireless Application Protocol) browser, typically found on older feature phones and early smartphones. WML’s structure is based on Decks and Cards . A Deck is a complete WML document, and a Card is a single unit of interaction for the user (equivalent to one screen of information). A user can navigate between different cards within the same deck, which reduces the need for multiple requests to the server. WML Program to Display Student Details: This program creates a single deck with one card that shows the student’s details in a title and a paragraph. “`xml “http://www.wapforum.org/DTD/wml_1.1.xml”>

Student Information: Enrolment Number: 210123456 Name: Anjali Sharma Program Code: BCA Course Code: BCS-053

“`

This code would be saved with a `.wml` extension and viewed in a WAP browser or emulator.

(b) The JSP (JavaServer Pages) life cycle describes the process a JSP page goes through from its creation to its destruction. The JSP container (like Apache Tomcat) manages these phases. The life cycle consists of the following steps:

  1. Translation: When the first request for a JSP page arrives, the JSP container translates the `.jsp` file into a Java Servlet source file (a `.java` file).
  2. Compilation: The container then compiles the generated servlet source file into Java bytecode (a `.class` file).
  3. Loading (Class Loading): The compiled `.class` file is loaded into memory by the container.
  4. Instantiation: The container creates an instance (object) of the servlet class.
  5. Initialization: The container calls the `jspInit()` method on the servlet instance. This method is called only once during the entire lifecycle. It is used to initialize database connections or other one-time setup tasks.
  6. Request Processing: For each client request, the container invokes the `_jspService()` method on the servlet. This method processes the request and generates a response for the client. This is the main phase of the lifecycle and is executed multiple times.
  7. Destruction: When the JSP page is removed from service (e.g., when the web application is shut down), the container calls the `jspDestroy()` method. This method is called only once and is used to release resources, such as database connections.


Diagram of the JSP Life Cycle:

[JSP Page (.jsp)] –>

Translation

–> [Servlet Source (.java)] –>

Compilation

–> [Servlet Class (.class)] –>

Loading & Instantiation

–> [Servlet Instance] –(once)–>

Initialization (`jspInit()`)

–>

Request Processing (`_jspService()`)

<– [Client Request] –> [Response to Client] –(loops)–> (back to `_jspService()` for next request) –>

Destruction (`jspDestroy()`)

–(when app is shut down)

Q3. (a) Explain the role of each tier in 3-tier architecture of web application. 3 (b) Write a JSP program to print the current date and time. 3 (c) Differentiate between the following: 4 (i) <jsp : include> and <jsp : forward> (i) Get and post method

Ans. (a) The 3-Tier Architecture is a software application architecture that partitions an application into three logical and physical computing tiers: the presentation tier, the logic tier, and the data tier.

  1. Presentation Tier: This is the topmost level of the application and interacts directly with the user. Its main role is to display information to the user and collect input from the user. In web applications, this is typically a web browser rendering HTML, CSS, and JavaScript. This tier is responsible for the User Interface (UI).
  2. Logic Tier (or Application/Business Tier): This is the middle tier. It processes requests from the presentation tier, applies business logic, and communicates with the data tier to fetch or store the necessary data. It is the “brains” of the application. In web applications, this is implemented by JSP, Servlets, or other server-side technologies running on a web server.
  3. Data Tier: This tier is responsible for the storage and management of data. It consists of a database server that stores, retrieves, and updates data. The logic tier sends queries for data to this tier. The key benefit of this tier is that data can be managed independently of the application and presentation logic. Examples: MySQL, Oracle, MongoDB servers.

(b) A JSP program to print the current date and time is very straightforward. We can use the `java.util.Date` class and output it directly using a JSP expression tag `<%= … %>`. JSP Program: “`jsp <%@ page import=”java.util.Date, java.text.SimpleDateFormat” %> Current Date and Time

JSP Current Date and Time

Using java.util.Date: <%= new Date() %>

<%– Using SimpleDateFormat for better formatting –%> Formatted Date and Time: <% Date currentDate = new Date(); SimpleDateFormat formatter = new SimpleDateFormat(“dd-MM-yyyy HH:mm:ss a”); String formattedDate = formatter.format(currentDate); out.println(formattedDate); %>

“`

The first example prints the default string representation of the `Date` object. The second example uses `SimpleDateFormat` to display the date and time in a specific, readable format (`dd-MM-yyyy HH:mm:ss a`).

(c) (i) Difference between <jsp : include> and <jsp : forward>

  • Control Flow:
    • <jsp:include>: It includes the content of another resource (like a JSP, HTML) into the current JSP page. After the included resource has finished execution, the control returns to the original JSP page, which continues its execution.
    • <jsp:forward>: It forwards the request completely from one JSP page to another resource. The control never returns to the original JSP page.
  • Response:
    • <jsp:include>: Both the original JSP and the included JSP contribute to generating the final response.
    • <jsp:forward>: Only the forwarded resource is responsible for generating the response. Any output from the original JSP that is in the buffer is cleared before forwarding.
  • Use Case:
    • <jsp:include>: Used for including reusable page components, such as headers, footers, or navigation bars.
    • <jsp:forward>: Used to direct the request to another page for processing, such as sending a user to a dashboard after a successful login.

(ii) Difference between GET and POST method

  • Data Submission:
    • GET: Appends form data to the URL in name/value pairs (e.g., `…/page.jsp?name=amit&age=25`).
    • POST: Sends form data within the body of the HTTP request.
  • Data Limit:
    • GET: Has a limit on the amount of data that can be sent (due to URL length limitations, typically around 2048 characters).
    • POST: Has no limit on the amount of data to be sent.
  • Security:
    • GET: Is less secure because the data is visible in the URL, and it gets stored in browser history and server logs. It should not be used for sensitive data.
    • POST: Is more secure because the data is not visible in the URL.
  • Bookmarking and Idempotency:
    • GET: Requests can be bookmarked. It is idempotent, meaning making the same request multiple times will have no different effect.
    • POST: Requests cannot be bookmarked. It is not idempotent; resubmitting the same request might have side effects, like creating duplicate records.

Q4. (a) What is session management in JSP ? Explain the different session tracking methods. 5 (b) What is meant by Document Object Model in the context of HTML ? Write a program using JavaScript and HTML that changes a paragraph text from ‘IGNOU’ to ‘Welcome in IGNOU’. 5

Ans. (a) Session Management in JSP is the process of maintaining a user’s interaction with a web application across multiple HTTP requests. Since HTTP is a stateless protocol, each request is independent. Session management allows the server to remember a user’s identity, their activities (like items in a shopping cart), and other information as the user navigates through different pages of a site. Different Session Tracking Methods:

  1. Cookies: This is the most common method. The server sends a small text file (the cookie) containing a unique session ID to the user’s browser. The browser stores this cookie and sends it back to the server with every subsequent request. The server uses this ID to retrieve the user’s session data.
  2. URL Rewriting: If the user’s browser has cookies disabled, the session ID can be appended manually to the end of every URL on the website. For example: `page.jsp;jsessionid=12345ABCDE`. This method is less secure and makes URLs complex.
  3. Hidden Form Fields: The session ID can be stored in a hidden input field (` `) within an HTML form. When the user submits the form, the session ID is sent to the server. This method only works for a sequence of pages that rely on form submissions.
  4. HttpSession Object: This is a high-level, server-side method provided by the JSP/Servlet API. The JSP container automatically creates and manages an `HttpSession` object for each user. The developer can store and retrieve data from this object using `session.setAttribute()` and `session.getAttribute()` methods. Internally, the container uses cookies (by default) or URL rewriting to track the session. This is the most preferred and easiest way of managing sessions in JSP.

(b) The Document Object Model (DOM) is a programming interface for HTML, XHTML, or XML documents. It represents the logical structure of a document as a tree. Each node in this tree represents a part of the document, such as an element, an attribute, or text. In the context of HTML, the DOM allows a web page to be treated as a hierarchy of objects by the browser. Scripting languages like JavaScript can use this model to dynamically access and manipulate the content, structure, and style of a document. For example, JavaScript can use the DOM to change the color of an element, add a new element, or modify the content of an element. Program using JavaScript and HTML: This program creates a paragraph and a button. When the button is clicked, a JavaScript function changes the text of the paragraph. “`html DOM Manipulation Example

DOM Example

IGNOU

“` In this code:

  • `

    IGNOU

    ` is the target element we want to change.

  • `
  • The `changeText()` function finds the paragraph using `document.getElementById()` and then uses the `.innerHTML` property to change its text.

Q5. Explain any four of the following with the help of an example/diagram, if needed : 4×2.5=10 (a) WML components (b) XML scheme (c) JDBC-ODBC Bridge (d) Deployment descriptor (e) Uses of <detail> and <summary> tags

Ans. (a) WML Components WML (Wireless Markup Language) uses several core components to structure documents designed for WAP-enabled devices.

  • Deck: The root element of a WML document is ` `, which is known as a deck. A deck contains one or more cards. The entire deck is downloaded to the device in a single request.
  • Card: A card (` `) is a single unit of interaction for the user, similar to a screen of information. A user can navigate between cards within the same deck without contacting the server again. “`xml

    This is the first card.

    This is the second card.

    “`

  • Events: These trigger actions. Common events include `onenterforward` (when a user enters a card) and `ontimer` (after a specified time).
  • Tasks: These are the actions performed when an event occurs. For example, ` ` navigates to another card or URL, ` ` goes to the previous card, and ` ` updates variables.

(b) XML Schema An XML Schema, often referred to as XSD (XML Schema Definition) , is a language for defining the structure and content of an XML document. It is a more powerful and flexible alternative to DTD (Document Type Definition). Purpose:

  • It defines which elements and attributes can appear in an XML document.
  • It specifies the order of elements, their number of occurrences, and their data types (e.g., string, integer, date).
  • It acts as a “blueprint” for validating the correctness of an XML document.


Example:

For the following XML:

“`xml


Amit

101

“`

A simple XSD would be:

“`xml

“`

This schema specifies that a `

` element must contain a `

` (string) followed by a `

` (integer).

(c) JDBC-ODBC Bridge The JDBC-ODBC Bridge is a Type 1 JDBC driver that translates JDBC API calls into ODBC (Open Database Connectivity) calls. It allows Java applications to connect to any database for which an ODBC driver is available. Working Diagram: `[Java Application] -> [JDBC API] -> [JDBC-ODBC Bridge Driver] -> [ODBC Driver] -> [Database]` Use: It was useful when pure Java JDBC drivers were not available for all databases. Developers could leverage existing ODBC drivers to connect to any database. Disadvantages & Current Status:

  • It suffers from performance overhead due to the extra layer of translation from JDBC to ODBC.
  • It requires installation and configuration of the ODBC driver on the client machine.
  • It was removed from Java SE 8 and is now considered obsolete. Modern applications should use Type 4 (pure Java) drivers provided directly by the database vendor.

(d) Deployment Descriptor The deployment descriptor is a configuration file for a Java web application, named `web.xml` . It is located in the `WEB-INF/` directory of the application. Purpose: It tells the Servlet Container (like Tomcat) how to deploy and configure the web application. It defines the various components and settings of the application. Key elements defined in `web.xml`:

  • Servlet declarations and mappings: Configuring servlets using ` ` and ` ` tags.
  • Welcome Files: ` ` specifies the default file to be shown when the application’s root URL is requested.
  • Session Configuration: Setting session timeout using ` `.
  • Error Pages: ` ` maps custom error pages for specific HTTP errors or exceptions.
  • Filters: Configuring filters to intercept requests and responses using ` ` and ` `.

In Servlet 3.0 and later, annotations (e.g., `@WebServlet`) can reduce the need for `web.xml`, but it is still used for complex configurations.

(e) Uses of <details> and <summary> tags These are semantic HTML5 tags used to create a “disclosure widget” or “accordion,” where a user can show or hide content on demand.

  • `
    ` tag: This is the container for the widget. The content inside this tag (other than the `

    `) is hidden by default.
  • `
    ` tag:

    This provides a visible heading for the `

    ` widget. When the user clicks this heading, the visibility of the rest of the `

    ` content is toggled (shown/hidden).

This is often used for creating FAQ (Frequently Asked Questions) sections.


Example:

“`html

What is Web Programming?

Web Programming refers to the writing, markup and coding involved in Web development, which includes Web content, Web client and server scripting and network security.

What are the core technologies?
  • HTML
  • CSS
  • JavaScript

“`

In this example, the user can click on the questions (the `

` text) to reveal or hide the answers (the `

` or `

    `). A `

    ` element can be made open by default using the `open` attribute: `

    …

    `.


Download IGNOU previous Year Question paper download PDFs for BCS-053 to improve your preparation. These ignou solved question paper IGNOU Previous Year Question paper solved PDF in Hindi and English help you understand the exam pattern and score better.

  • IGNOU Previous Year Solved Question Papers (All Courses)

Thanks!

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • More
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Telegram (Opens in new window) Telegram
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

लेटेस्ट अपडेट पायें

Telegram Telegram Channel Join Now
Facebook FaceBook Page Follow Us
YouTube Youtube Channel Subscribe
WhatsApp WhatsApp Channel Join Now

Search

Recent Posts

  • MSU Baroda Study Materials Free Download
  • Bhavnagar University Study Materials Free Download
  • Kachchh University Study Materials Free Download
  • BMTU Study Materials Free Download
  • SGGU Study Materials Free Download

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,611 other subscribers

Categories

  • 10th model paper (3)
  • bed books (3)
  • Bihar Board Model Paper (7)
  • Bihar Jobs (1)
  • cg board model paper (1)
  • DELED Books (1)
  • English Posts (1)
  • Essay (1)
  • Exam Prep (9)
  • G.K quiz in hindi (7)
  • General Knowledge in hindi (सामान्य ज्ञान) (24)
  • gk 2018 in hindi (12)
  • GK 2020 (2)
  • GK HINDI 2019 (9)
  • gk pdf download (16)
  • High school science notes in Hindi (3)
  • IERT (3)
  • MODEL PAPER (30)
  • Motivational quotes in hindi (1)
  • mp board model paper (4)
  • My Thoughts (Thoughts by Sachin Yadav) (1)
  • Navy (2)
  • NCERT Books in hindi free download (1)
  • Police (2)
  • Polytechnic (6)
  • Pratiyogita Darpan 2019 (2)
  • RBSE Model Papers (2)
  • School Books (1)
  • SSC GENERAL KNOWLEDGE (7)
  • StudyTrac (69)
  • Uncategorized (54)
  • University Books (106)
  • University Question Papers (153)
  • University Study Materials (89)
  • University Syllabus (144)
  • UP Board Books (5)
  • up board model paper (10)
  • Up board model papers (16)
  • UPSC Notes (3)
  • Uttar Pradesh Jobs (2)
  • रेलवे (7)
  • सामान्य हिन्दी (3)

Footer

University Books

University Study Materials (Books and Notes) in PDF Format in Hindi and English languages.

Click here to download.

University Question Papers

University Previous Year Question Papers and Sample Papers in PDF Format for all Courses.

Click here to download.

University Syllabus

Universities Syllabus in PDF Format in the English and Hindi languages for all courses.

Click here to download.

Copyright © 2026 ·GKPAD by S.K Yadav | Disclaimer