<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2003732912185691712</id><updated>2024-07-22T16:38:40.813+05:30</updated><category term="Java"/><category term="JavaScript"/><category term="Class"/><category term="MySQL"/><category term="Object"/><category term="Query"/><category term="501"/><category term="Abstract Class"/><category term="Ajax"/><category term="Ant"/><category term="Apache"/><category term="Bootstrap"/><category term="Build"/><category term="CONNECT"/><category term="CSS"/><category term="Client"/><category term="Client-Side"/><category term="Console"/><category term="DELETE"/><category term="Database"/><category term="Eclipse"/><category term="Error Handling"/><category term="Errors"/><category term="FTP"/><category term="Form Validation"/><category term="GET"/><category term="HEAD"/><category term="HTML"/><category term="HTTP Status Code"/><category term="Hello World"/><category term="Image Map"/><category term="Instance Variables"/><category term="Interface"/><category term="Join"/><category term="Method"/><category term="Methods"/><category term="Not Implemented"/><category term="OPTIONS"/><category term="Optimize"/><category term="Output"/><category term="Overloading"/><category term="Overriding"/><category term="POST"/><category term="PUT"/><category term="Page Redirection"/><category term="Performance"/><category term="Periodic"/><category term="Print"/><category term="Program"/><category term="TRACE"/><category term="Task"/><category term="Timer"/><category term="Types"/><category term="Web Development"/><category term="Web Page"/><category term="XML"/><category term="command"/><category term="compile"/><category term="element"/><category term="jQuery"/><category term="run"/><category term="server"/><title type='text'>Technical notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-6156323496881185035</id><published>2024-07-22T16:37:00.005+05:30</published><updated>2024-07-22T16:37:59.175+05:30</updated><title type='text'>Best Practices for Secure Coding: A Guide for Developers</title><content type='html'>
    &lt;div&gt;
        &lt;p&gt;In today’s digital age, writing secure code is essential to protect software from hackers and keep user data safe. This guide outlines best practices for secure coding, helping developers build robust and secure applications.&lt;/p&gt;
        
        &lt;h2&gt;Why Secure Coding Matters&lt;/h2&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;b&gt;Protecting User Data:&lt;/b&gt; Secure coding keeps user information private and safe from unauthorized access.&lt;/li&gt;
            &lt;li&gt;&lt;b&gt;Preventing Cyberattacks:&lt;/b&gt; Good coding practices reduce the risk of attacks like SQL injection, cross-site scripting (XSS), and buffer overflows.&lt;/li&gt;
            &lt;li&gt;&lt;b&gt;Ensuring Compliance:&lt;/b&gt; Following secure coding standards helps meet legal requirements and industry standards.&lt;/li&gt;
            &lt;li&gt;&lt;b&gt;Maintaining Reputation:&lt;/b&gt; Security breaches can harm your product&#39;s reputation. Secure coding maintains user trust and confidence.&lt;/li&gt;
        &lt;/ul&gt;

        &lt;h2&gt;Best Practices for Secure Coding&lt;/h2&gt;

        &lt;h3&gt;1. Validate User Inputs&lt;/h3&gt;
        &lt;p&gt;Always check and clean user inputs to prevent malicious data from causing harm.&lt;/p&gt;
        &lt;pre&gt;&lt;code&gt;&amp;lt;input type=&quot;text&quot; pattern=&quot;[A-Za-z0-9]+&quot; title=&quot;Only alphanumeric characters are allowed&quot;&amp;gt;&lt;/code&gt;&lt;/pre&gt;

        &lt;h3&gt;2. Use Parameterized Queries&lt;/h3&gt;
        &lt;p&gt;Avoid SQL injection by using parameterized queries instead of embedding user inputs directly into SQL statements.&lt;/p&gt;
        &lt;pre&gt;&lt;code&gt;// Example in Java using PreparedStatement
String query = &quot;SELECT * FROM users WHERE username = ?&quot;;
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setString(1, username);
ResultSet rs = pstmt.executeQuery();
&lt;/code&gt;&lt;/pre&gt;

        &lt;h3&gt;3. Implement Strong Authentication and Authorization&lt;/h3&gt;
        &lt;p&gt;Ensure users are who they say they are and control their access to different parts of your application.&lt;/p&gt;
        &lt;pre&gt;&lt;code&gt;// Example of role-based access control in Node.js
function authorize(role) {
    return (req, res, next) =&amp;gt; {
        if (req.user &amp;amp;&amp;amp; req.user.role === role) {
            next();
        } else {
            res.status(403).send(&#39;Forbidden&#39;);
        }
    };
}
&lt;/code&gt;&lt;/pre&gt;

        &lt;h3&gt;4. Use HTTPS&lt;/h3&gt;
        &lt;p&gt;Encrypt data sent over the internet using HTTPS to protect it from being intercepted.&lt;/p&gt;

        &lt;h3&gt;5. Manage Sessions Securely&lt;/h3&gt;
        &lt;p&gt;Use secure cookies, set appropriate session timeouts, and invalidate sessions upon logout.&lt;/p&gt;
        &lt;pre&gt;&lt;code&gt;// Example of setting secure cookies in Express.js
app.use(session({
    secret: &#39;your-secret-key&#39;,
    resave: false,
    saveUninitialized: true,
    cookie: { secure: true, httpOnly: true }
}));
&lt;/code&gt;&lt;/pre&gt;

        &lt;h3&gt;6. Keep Dependencies Updated&lt;/h3&gt;
        &lt;p&gt;Regularly update libraries and dependencies to fix known security issues. Use tools like &lt;code&gt;npm audit&lt;/code&gt; to check for vulnerabilities.&lt;/p&gt;

        &lt;h3&gt;7. Secure Error Handling&lt;/h3&gt;
        &lt;p&gt;Don’t expose sensitive information in error messages. Log errors for debugging but show generic messages to users.&lt;/p&gt;

        &lt;h2&gt;Conclusion&lt;/h2&gt;
        &lt;p&gt;Secure coding is a crucial part of software development. By following these best practices, developers can build safer, more reliable applications that protect user data and maintain trust.&lt;/p&gt;
    &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/6156323496881185035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2024/07/best-practices-for-secure-coding-guide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6156323496881185035'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6156323496881185035'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2024/07/best-practices-for-secure-coding-guide.html' title='Best Practices for Secure Coding: A Guide for Developers'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-7482074473295057119</id><published>2020-08-19T13:31:00.010+05:30</published><updated>2024-07-12T16:15:02.786+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Join"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Optimize"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance"/><category scheme="http://www.blogger.com/atom/ns#" term="Query"/><title type='text'>Optimizing MySQL Queries: A Deep Dive into Indexing and STRAIGHT_JOIN</title><content type='html'>&lt;p&gt;When working with MySQL, optimizing query performance is crucial. Before finalizing my queries, I always use MySQL Workbench to explain the query plan, ensuring optimal performance. However, I’ve noticed that performance can vary, especially with queries involving joins on multiple tables. Indexing my tables often helps, but sometimes even with appropriate indexes, the expected performance boost isn’t there.&lt;/p&gt;&lt;p&gt;Recently, I encountered a query that wasn’t performing well despite adding the right index. MySQL Workbench revealed that MySQL wasn’t using the new index. After some experimentation, I found that using &lt;code&gt;FORCE INDEX&lt;/code&gt; made MySQL utilize the index. However, forcing MySQL to use an index didn’t feel like the best solution. I wanted MySQL to optimize the query automatically.&lt;/p&gt;&lt;h3&gt;Discovering STRAIGHT_JOIN&lt;/h3&gt;&lt;p&gt;During my research, I came across &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt;. Adding this to my query immediately made MySQL use the index without any force. This led me to explore the differences between &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; and &lt;code&gt;INNER JOIN&lt;/code&gt;.&lt;/p&gt;&lt;h3&gt;How STRAIGHT_JOIN Works&lt;/h3&gt;&lt;p&gt;&lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; is similar to an &lt;code&gt;INNER JOIN&lt;/code&gt; in that it returns matching records from the joined tables. The key difference is that &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; enforces the join order of the tables. Unlike &lt;code&gt;INNER JOIN&lt;/code&gt;, which allows MySQL to choose the join order, &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; reads the left table first, then the right table. Generally, the table with the smaller result set should be on the left. However, out of habit, we often put the larger table on the left.&lt;/p&gt;&lt;h3&gt;Optimizing Query Plans&lt;/h3&gt;&lt;p&gt;Just placing the correct table on the left isn’t always sufficient. The MySQL optimizer sometimes picks a suboptimal query plan, ignoring the appropriate index. This doesn’t mean we should always use &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; over &lt;code&gt;INNER JOIN&lt;/code&gt;.&lt;/p&gt;&lt;h3&gt;Best Practices for Query Optimization&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Use EXPLAIN&lt;/strong&gt;: Always use &lt;code&gt;EXPLAIN&lt;/code&gt; to analyze your query and understand how MySQL plans to execute it.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Indexing&lt;/strong&gt;: Ensure your tables are indexed appropriately.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Query Restructuring&lt;/strong&gt;: Restructure your query if the performance isn’t optimal.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Consider STRAIGHT_JOIN&lt;/strong&gt;: If all else fails, using &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; can be a last resort to guide MySQL’s query execution order.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Monitor and Adapt&lt;/strong&gt;: Regularly monitor query performance. As your tables grow and indexes evolve, what was once an optimal query might become suboptimal.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Remember, while &lt;code&gt;STRAIGHT_JOIN&lt;/code&gt; can be powerful, it should not be your default choice. Let MySQL’s optimizer do its job and intervene only when necessary. Over time, table growth and index changes can make previously optimal queries less efficient. Stay flexible and adapt your queries as your database evolves.&lt;/p&gt;&lt;p&gt;By following these practices, you can ensure that your MySQL queries remain efficient and your database performance stays robust.&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRL-ElVaUoGGeiNaorQvpfYxdBjXAIzsTxe04zcklWXbkr8r80oQqz01didyC2JUfw8jo6paddqjRPNdRR1YmgJsFV1EMMC99XINo1zW7VreNxYhJGiCaZYvxfsL8KOxhZZNbyrKqof0yup1DIiyQHHBzMZebByRL6HU-Ve6qNFOn-475o9fJb0lT0gtU/s225/mysql.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;225&quot; data-original-width=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRL-ElVaUoGGeiNaorQvpfYxdBjXAIzsTxe04zcklWXbkr8r80oQqz01didyC2JUfw8jo6paddqjRPNdRR1YmgJsFV1EMMC99XINo1zW7VreNxYhJGiCaZYvxfsL8KOxhZZNbyrKqof0yup1DIiyQHHBzMZebByRL6HU-Ve6qNFOn-475o9fJb0lT0gtU/s400/mysql.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/7482074473295057119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2020/08/optimize-mysql-query-with-straightjoin.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7482074473295057119'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7482074473295057119'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2020/08/optimize-mysql-query-with-straightjoin.html' title='Optimizing MySQL Queries: A Deep Dive into Indexing and STRAIGHT_JOIN'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRL-ElVaUoGGeiNaorQvpfYxdBjXAIzsTxe04zcklWXbkr8r80oQqz01didyC2JUfw8jo6paddqjRPNdRR1YmgJsFV1EMMC99XINo1zW7VreNxYhJGiCaZYvxfsL8KOxhZZNbyrKqof0yup1DIiyQHHBzMZebByRL6HU-Ve6qNFOn-475o9fJb0lT0gtU/s72-c/mysql.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-2187795363663864077</id><published>2020-08-13T20:35:00.008+05:30</published><updated>2024-07-12T15:35:51.481+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ant"/><category scheme="http://www.blogger.com/atom/ns#" term="Apache"/><category scheme="http://www.blogger.com/atom/ns#" term="Build"/><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="FTP"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Automate File Transfer to Remote Server Using Ant Build in Eclipse</title><content type='html'>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Automate File Transfer to Remote Server Using Ant Build in Eclipse&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;p&gt;Working on a project often involves copying files to a remote server. Manually transferring files via SFTP tools can be tedious and time-consuming. During one such project, I wondered if Ant Builder, which is capable of copying files between directories, could also handle copying files to a remote server.&lt;/p&gt;

&lt;p&gt;After some research and experimentation, I found a solution that works perfectly. Now, my local files are automatically copied to a remote server using Ant Build. I simply build my project in Eclipse, and the files are pushed to the server. All that’s left is to refresh the web page, as the server development environment seamlessly integrates with my local setup.&lt;/p&gt;

&lt;h3&gt;Step-by-Step Guide to Copy Files to a Remote Server Using Ant Build&lt;/h3&gt;

&lt;h4&gt;1. Download the Necessary JAR File&lt;/h4&gt;
&lt;p&gt;First, download the &lt;code&gt;jsch-0.1.55.jar&lt;/code&gt; file, which enables secure file transfer.&lt;/p&gt;

&lt;h4&gt;2. Add the JAR to Eclipse&lt;/h4&gt;
&lt;p&gt;Add the &lt;code&gt;jsch-0.1.55.jar&lt;/code&gt; to your Eclipse Ant classpath:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Navigate to &lt;code&gt;C:\eclipse_folder_path\plugins\org.apache.ant_1.10.8.v20200515-1239\lib&lt;/code&gt; and place the JAR file there.&lt;/li&gt;
    &lt;li&gt;Open Eclipse and go to &lt;strong&gt;Preferences&lt;/strong&gt;.&lt;/li&gt;
    &lt;li&gt;In the &lt;strong&gt;Ant/Runtime&lt;/strong&gt; entry, go to the &lt;strong&gt;Classpath&lt;/strong&gt; tab.&lt;/li&gt;
    &lt;li&gt;Click &lt;strong&gt;Add External Jars&lt;/strong&gt; and add the &lt;code&gt;jsch.jar&lt;/code&gt; to Ant&#39;s classpath.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;3. Modify Your Ant Build Script&lt;/h4&gt;
&lt;p&gt;Update your Ant Build script to include the SCP (Secure Copy Protocol) task instead of the standard copy command. Use the following line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;scp todir=&quot;user_name@remote_server_url:/path_to_remote_dir/&quot; password=&quot;your_password&quot; trust=&quot;true&quot;&amp;gt;
    &amp;lt;fileset dir=&quot;path_to_local_dir&quot;/&amp;gt;
&amp;lt;/scp&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Benefits of Automating File Transfer&lt;/h3&gt;
&lt;p&gt;Automating the file transfer process using Ant Build offers several advantages:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: Saves time by eliminating manual file transfers.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Ensures that files are copied correctly every time.&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Integration&lt;/strong&gt;: Seamlessly integrates with your development workflow in Eclipse.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;By following these steps, you can automate the process of copying files from your local machine to a remote server using Ant Build in Eclipse. This not only streamlines your workflow but also enhances productivity by turning server development into a local-like experience.&lt;/p&gt;

&lt;p&gt;Give it a try and enjoy the convenience of automated file transfers!&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJYBO9RxoKqjudLOUP3ZzAD8K4JxhbTgpcqw5yqAyzmAOhdd_94wuMWTvf9CrT8cBhJ4ugWNQbkkNOJC7UfN_cdz8WTDBxkeCgpUaBa60LQrU3UHdmLmVUtEGIsyq7QqfFU9T_LH_ZzvBtTpzVWfbXrjtfACxMdXxDsgvzP1fPaED6cx-2jfentavhyphenhyphenLA/s285/ant.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;177&quot; data-original-width=&quot;285&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJYBO9RxoKqjudLOUP3ZzAD8K4JxhbTgpcqw5yqAyzmAOhdd_94wuMWTvf9CrT8cBhJ4ugWNQbkkNOJC7UfN_cdz8WTDBxkeCgpUaBa60LQrU3UHdmLmVUtEGIsyq7QqfFU9T_LH_ZzvBtTpzVWfbXrjtfACxMdXxDsgvzP1fPaED6cx-2jfentavhyphenhyphenLA/s400/ant.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/2187795363663864077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2020/08/how-to-copy-files-to-remote-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2187795363663864077'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2187795363663864077'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2020/08/how-to-copy-files-to-remote-server.html' title='Automate File Transfer to Remote Server Using Ant Build in Eclipse'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJYBO9RxoKqjudLOUP3ZzAD8K4JxhbTgpcqw5yqAyzmAOhdd_94wuMWTvf9CrT8cBhJ4ugWNQbkkNOJC7UfN_cdz8WTDBxkeCgpUaBa60LQrU3UHdmLmVUtEGIsyq7QqfFU9T_LH_ZzvBtTpzVWfbXrjtfACxMdXxDsgvzP1fPaED6cx-2jfentavhyphenhyphenLA/s72-c/ant.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-7975031638314409243</id><published>2016-10-10T12:31:00.002+05:30</published><updated>2024-07-12T16:15:20.416+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Periodic"/><category scheme="http://www.blogger.com/atom/ns#" term="Task"/><category scheme="http://www.blogger.com/atom/ns#" term="Timer"/><title type='text'>How to schedule a periodic task in Java?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
  &lt;p&gt;Scheduling tasks in Java is a common requirement in various applications, such as running a periodic cleanup, sending regular notifications, or updating cached data. In this guide, we&#39;ll show you how to schedule tasks periodically using the &lt;code&gt;Timer&lt;/code&gt; and &lt;code&gt;TimerTask&lt;/code&gt; classes in Java.&lt;/p&gt;
  &lt;h3&gt;Steps to Schedule a Task Periodically in Java&lt;/h3&gt;
  &lt;ol&gt;
    &lt;li&gt;&lt;strong&gt;Create a Timer Object&lt;/strong&gt;
      &lt;p&gt;First, create an instance of the &lt;code&gt;Timer&lt;/code&gt; class. This class is responsible for scheduling tasks.&lt;/p&gt;
      &lt;blockquote class=&quot;tr_bq&quot; style=&quot;font-size: 0.9em;&quot;&gt;
        &lt;code&gt;Timer timer = new Timer();&lt;/code&gt;
      &lt;/blockquote&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Create a TimerTask Object&lt;/strong&gt;
      &lt;p&gt;Next, create an instance of the &lt;code&gt;TimerTask&lt;/code&gt; class and override its &lt;code&gt;run()&lt;/code&gt; method. This method contains the code you want to execute periodically.&lt;/p&gt;
      &lt;blockquote class=&quot;tr_bq&quot; style=&quot;font-size: 0.9em;&quot;&gt;
        &lt;pre&gt;&lt;code&gt;TimerTask task = new TimerTask() {
    @Override
    public void run() {
        // Call your task here
        System.out.println(&quot;Task is running&quot;);
    }
};&lt;/code&gt;&lt;/pre&gt;
      &lt;/blockquote&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Schedule the Task&lt;/strong&gt;
      &lt;p&gt;Finally, use the &lt;code&gt;schedule()&lt;/code&gt; method of the &lt;code&gt;Timer&lt;/code&gt; class to schedule the task. You need to specify the task, delay, and period.&lt;/p&gt;
      &lt;blockquote class=&quot;tr_bq&quot; style=&quot;font-size: 0.9em;&quot;&gt;
        &lt;code&gt;timer.schedule(task, delay, period);&lt;/code&gt;
      &lt;/blockquote&gt;
      &lt;p&gt;Here:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;task&lt;/strong&gt; - The task to be scheduled. Pass the task object created in step 2.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;delay&lt;/strong&gt; - Delay in milliseconds before the task is to be executed.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;period&lt;/strong&gt; - Time in milliseconds between successive task executions.&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
  &lt;h3&gt;Example: Scheduling a Task to Run Every 5 Seconds&lt;/h3&gt;
  &lt;p&gt;Let&#39;s look at a complete example where we schedule a task to run every 5 seconds after an initial delay of 2 seconds:&lt;/p&gt;
  &lt;blockquote class=&quot;tr_bq&quot; style=&quot;font-size: 0.9em;&quot;&gt;
    &lt;pre&gt;&lt;code&gt;import java.util.Timer;
import java.util.TimerTask;

public class PeriodicTaskScheduler {
    public static void main(String[] args) {
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                System.out.println(&quot;Task is running&quot;);
            }
        };
        timer.schedule(task, 2000, 5000);
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/blockquote&gt;
  &lt;h3&gt;Why Use Timer and TimerTask in Java?&lt;/h3&gt;
  &lt;p&gt;Using &lt;code&gt;Timer&lt;/code&gt; and &lt;code&gt;TimerTask&lt;/code&gt; in Java allows you to manage periodic tasks efficiently. These classes are simple to use and provide a straightforward way to execute tasks at fixed intervals. This can be particularly useful for:&lt;/p&gt;
  &lt;ul&gt;
    &lt;li&gt;Automated backups&lt;/li&gt;
    &lt;li&gt;Scheduled notifications&lt;/li&gt;
    &lt;li&gt;Periodic data synchronization&lt;/li&gt;
    &lt;li&gt;Regular maintenance tasks&lt;/li&gt;
  &lt;/ul&gt;
  &lt;h3&gt;Conclusion&lt;/h3&gt;
  &lt;p&gt;Scheduling tasks periodically in Java is a breeze with &lt;code&gt;Timer&lt;/code&gt; and &lt;code&gt;TimerTask&lt;/code&gt;. By following the steps outlined above, you can ensure that your tasks run at the desired intervals without manual intervention.&lt;/p&gt;
  &lt;p&gt;For more information on Java scheduling, check out the &lt;a href=&quot;https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html&quot;&gt;Java Timer documentation&lt;/a&gt;.&lt;/p&gt;
  &lt;/div&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimPUY4OKZMfdbTFyXshPC3Vk2PfJWVKLAi_1SnvuWGvccUhHI7MBvCoypfK2QTjQsKkJ-HI86urGy0Y-kHmrpBQZiYQk4Fv_4bnXOnqK2IpBD1p0zOVUjbJXaP3rEA8Jo3aysAJhmfo5ZZLQEnW-cFGkVN0F5mGRyrYsofUK7oq-y9boGqVtBBCrwRS8E/s300/java%20timer.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;168&quot; data-original-width=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimPUY4OKZMfdbTFyXshPC3Vk2PfJWVKLAi_1SnvuWGvccUhHI7MBvCoypfK2QTjQsKkJ-HI86urGy0Y-kHmrpBQZiYQk4Fv_4bnXOnqK2IpBD1p0zOVUjbJXaP3rEA8Jo3aysAJhmfo5ZZLQEnW-cFGkVN0F5mGRyrYsofUK7oq-y9boGqVtBBCrwRS8E/s400/java%20timer.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/7975031638314409243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2016/10/how-to-schedule-periodic-task-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7975031638314409243'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7975031638314409243'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2016/10/how-to-schedule-periodic-task-in-java.html' title='How to schedule a periodic task in Java?'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimPUY4OKZMfdbTFyXshPC3Vk2PfJWVKLAi_1SnvuWGvccUhHI7MBvCoypfK2QTjQsKkJ-HI86urGy0Y-kHmrpBQZiYQk4Fv_4bnXOnqK2IpBD1p0zOVUjbJXaP3rEA8Jo3aysAJhmfo5ZZLQEnW-cFGkVN0F5mGRyrYsofUK7oq-y9boGqVtBBCrwRS8E/s72-c/java%20timer.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-4279133521724182973</id><published>2013-12-10T14:24:00.004+05:30</published><updated>2024-07-12T16:15:51.189+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Console"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Output"/><title type='text'>Understanding System.out.println() in Java: A Deep Dive into Java&#39;s Console Output</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
    &lt;h2&gt;Understanding System.out.println() in Java&lt;/h2&gt;
    &lt;p&gt;System.out.println() is a fundamental method in Java used for printing messages to the console. It is widely used for debugging, logging, and general output purposes.&lt;/p&gt;

    &lt;h3&gt;What is System.out.println() in Java?&lt;/h3&gt;
    &lt;p&gt;System.out.println() is a method provided by the Java standard library to print a line of text to the standard output stream, typically the console or terminal.&lt;/p&gt;

    &lt;h3&gt;Key Points about System.out.println()&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Usage:&lt;/strong&gt; Used to print messages to the console.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; Outputs text followed by a newline character.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Output Stream:&lt;/strong&gt; Writes to the standard output stream (often the console).&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;Understanding &quot;out&quot; in System.out.println()&lt;/h3&gt;
    &lt;p&gt;The &quot;out&quot; in System.out.println() is a static member variable of the System class. It is initialized to refer to the standard output stream.&lt;/p&gt;

    &lt;h3&gt;Example Usage of System.out.println()&lt;/h3&gt;
    &lt;p&gt;Here&#39;s an example demonstrating the use of System.out.println() to print &quot;Hello, World!&quot; to the console:&lt;/p&gt;
    &lt;pre&gt;&lt;code&gt;public class HelloWorld {
    public static void main(String[] args) {
        System.out.println(&quot;Hello, World!&quot;);
    }
}&lt;/code&gt;&lt;/pre&gt;

    &lt;h3&gt;Conclusion&lt;/h3&gt;
    &lt;p&gt;System.out.println() is a simple yet powerful method in Java for outputting messages to the console. It forms a basic tool for developers to communicate with the standard output stream during program execution.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZoIKkpjSBVebWdZHRYXORWO8EXmgo_L_bI_EApHgnQnQHyZa2S8SHEPNEHP5BDDIUaUvhmkNfyjXqvKBsbtyYmbF1VxvYiv8cm183aLT4FdxeHM1jrXzE2rubuAXzbQKSo4-oNCl61FCS6BAGgI-ZGo6uHvx7CR4v2VXaNvKWCsPYDE4H3AVmHjeW_9A/s284/download.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;177&quot; data-original-width=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZoIKkpjSBVebWdZHRYXORWO8EXmgo_L_bI_EApHgnQnQHyZa2S8SHEPNEHP5BDDIUaUvhmkNfyjXqvKBsbtyYmbF1VxvYiv8cm183aLT4FdxeHM1jrXzE2rubuAXzbQKSo4-oNCl61FCS6BAGgI-ZGo6uHvx7CR4v2VXaNvKWCsPYDE4H3AVmHjeW_9A/s400/download.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/4279133521724182973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-how-does-systemoutprintln-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/4279133521724182973'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/4279133521724182973'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-how-does-systemoutprintln-work.html' title='Understanding System.out.println() in Java: A Deep Dive into Java&#39;s Console Output'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZoIKkpjSBVebWdZHRYXORWO8EXmgo_L_bI_EApHgnQnQHyZa2S8SHEPNEHP5BDDIUaUvhmkNfyjXqvKBsbtyYmbF1VxvYiv8cm183aLT4FdxeHM1jrXzE2rubuAXzbQKSo4-oNCl61FCS6BAGgI-ZGo6uHvx7CR4v2VXaNvKWCsPYDE4H3AVmHjeW_9A/s72-c/download.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-5212580016169760588</id><published>2013-12-10T14:21:00.003+05:30</published><updated>2024-07-12T16:16:07.675+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Method"/><category scheme="http://www.blogger.com/atom/ns#" term="Overloading"/><category scheme="http://www.blogger.com/atom/ns#" term="Overriding"/><title type='text'>Understanding Method Overloading and Overriding in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;

    &lt;p&gt;Method overloading and overriding are fundamental concepts in Java that often lead to confusion. Let&#39;s clarify these concepts with clear examples and explanations.&lt;/p&gt;

    &lt;h3&gt;What is Method Overloading?&lt;/h3&gt;
    &lt;p&gt;Method overloading occurs when multiple methods in the same class have the same name but different parameters. Here are the conditions for method overloading:&lt;/p&gt;
    &lt;pre style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 18px; border: 6px solid #EAEAEA; padding: 15px; &quot;&gt;
1. Number of parameters is different.
2. Parameter types are different.&lt;/pre&gt;

    &lt;h3&gt;Examples of Valid and Invalid Method Overloading&lt;/h3&gt;
    &lt;p&gt;Let&#39;s look at some examples to understand what constitutes valid method overloading:&lt;/p&gt;
    &lt;pre style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 18px; border: 6px solid #EAEAEA; padding: 15px; &quot;&gt;
// Valid overloading - different parameter types
int changeDate(int year);
int changeDate(float year);

// Invalid overloading - same parameter types, different return types
int changeDate(int month);
float changeDate(int year);&lt;/pre&gt;

    &lt;h3&gt;What is Method Overriding?&lt;/h3&gt;
    &lt;p&gt;Method overriding occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. The overriding method must have the same method name, parameters, and return type.&lt;/p&gt;

    &lt;h3&gt;Key Differences Between Overloading and Overriding&lt;/h3&gt;
    &lt;p&gt;Overloading changes the method signature within the same class, while overriding provides a new implementation of an inherited method in a subclass without changing the method signature.&lt;/p&gt;

    &lt;h3&gt;Conclusion&lt;/h3&gt;
    &lt;p&gt;Understanding the differences between method overloading and overriding is crucial for writing efficient and maintainable Java code. Use overloading to provide multiple ways to invoke a method, and use overriding to customize inherited behavior in subclasses.&lt;/p&gt;

&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQYtEeEZ0IOzyCjSfUVz7zX4Flno5sSaYmP43WlKFPjadQyd2B0BT0yajzNCxhQ2FFIrfwJfpiWr2C4yKBC7pLWsF2oJ9hg_iTt2zhV6z-gejygIVzr8mKBN7n6GLR9Kyvq8txwaGlTtCkQA70bICCJEPujvIrHdPFgOZfNCduO3Mnr3ePvG4amiGPW8/s768/download%20%281%29.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;768&quot; data-original-width=&quot;768&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQYtEeEZ0IOzyCjSfUVz7zX4Flno5sSaYmP43WlKFPjadQyd2B0BT0yajzNCxhQ2FFIrfwJfpiWr2C4yKBC7pLWsF2oJ9hg_iTt2zhV6z-gejygIVzr8mKBN7n6GLR9Kyvq8txwaGlTtCkQA70bICCJEPujvIrHdPFgOZfNCduO3Mnr3ePvG4amiGPW8/s400/download%20%281%29.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/5212580016169760588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-whats-difference-between-method.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/5212580016169760588'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/5212580016169760588'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-whats-difference-between-method.html' title='Understanding Method Overloading and Overriding in Java'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQYtEeEZ0IOzyCjSfUVz7zX4Flno5sSaYmP43WlKFPjadQyd2B0BT0yajzNCxhQ2FFIrfwJfpiWr2C4yKBC7pLWsF2oJ9hg_iTt2zhV6z-gejygIVzr8mKBN7n6GLR9Kyvq8txwaGlTtCkQA70bICCJEPujvIrHdPFgOZfNCduO3Mnr3ePvG4amiGPW8/s72-c/download%20%281%29.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-7845335899452011938</id><published>2013-12-10T14:19:00.003+05:30</published><updated>2024-07-12T16:14:35.513+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Class"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><title type='text'>The Difference Between Class and Object in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
    &lt;p&gt;In Java programming, understanding the distinction between &#39;class&#39; and &#39;object&#39; is essential. While they are related concepts, each serves a distinct purpose in object-oriented programming.&lt;/p&gt;

    &lt;h3&gt;What is a Class?&lt;/h3&gt;
    &lt;p&gt;A &lt;strong&gt;class&lt;/strong&gt; in Java is a blueprint or template that defines the structure and behavior of objects. It contains attributes (fields) and methods that define the object&#39;s state and behavior. Here&#39;s a simplified definition:&lt;/p&gt;
    
        &lt;p&gt;&quot;A class is a static piece of code that defines the attributes and methods shared by all instances (objects) of that class.&quot;&lt;/p&gt;
   

    &lt;h3&gt;What is an Object?&lt;/h3&gt;
    &lt;p&gt;An &lt;strong&gt;object&lt;/strong&gt; is an instance of a class. It represents a specific entity that exists at runtime and has its own state (attributes) and behavior (methods). Unlike classes, objects are dynamic and exist only during the program&#39;s execution:&lt;/p&gt;
    
        &lt;p&gt;&quot;An object is a specific instance of a class, created at runtime with its own set of attributes and methods.&quot;&lt;/p&gt;
   

    &lt;h3&gt;Example: Class vs. Object&lt;/h3&gt;
    &lt;p&gt;Consider a class &lt;code&gt;Animal&lt;/code&gt; with attributes like &lt;code&gt;species&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt;:&lt;/p&gt;
    &lt;pre style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 18px; border: 6px solid #EAEAEA; padding: 15px; &quot;&gt;
public class Animal {
    String species;
    int age;

    public Animal(String species, int age) {
        this.species = species;
        this.age = age;
    }

    public void eat() {
        System.out.println(&quot;The animal is eating.&quot;);
    }
}&lt;/pre&gt;

    &lt;p&gt;Creating objects of the &lt;code&gt;Animal&lt;/code&gt; class:&lt;/p&gt;
    &lt;pre style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 18px; border: 6px solid #EAEAEA; padding: 15px; &quot;&gt;
Animal lion = new Animal(&quot;Lion&quot;, 5);
Animal cat = new Animal(&quot;Cat&quot;, 2);&lt;/pre&gt;

    &lt;h3&gt;Key Differences:&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Class:&lt;/strong&gt; Defines the structure and behavior shared by all instances.&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Object:&lt;/strong&gt; Represents a specific instance with its unique state and behavior.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;Conclusion&lt;/h3&gt;
    &lt;p&gt;Understanding the distinction between class and object is fundamental in Java programming. Classes provide the blueprint, while objects are the tangible instances that embody those blueprints.&lt;/p&gt;

&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2E7wlkVNalT9iJTHlz9BoA6zEG9avDoF1OR1MO9e4TRqANKNDlJ0gXT-_s8c6WJSZrA_LkCQ79tW_f5_OJVg9TMspKXRal8RuceCjiUalSKoFPiO3IhtUpYH1j-Vt4fqBUfiV1bhY2_Y4iRc76OwY1hbq-oHZgPfYHn22aFuq2S2kz69EBlffUmdrOjc/s1024/apv7Ey5vSjK3F3m5Tzg3GQ.webp&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;1024&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2E7wlkVNalT9iJTHlz9BoA6zEG9avDoF1OR1MO9e4TRqANKNDlJ0gXT-_s8c6WJSZrA_LkCQ79tW_f5_OJVg9TMspKXRal8RuceCjiUalSKoFPiO3IhtUpYH1j-Vt4fqBUfiV1bhY2_Y4iRc76OwY1hbq-oHZgPfYHn22aFuq2S2kz69EBlffUmdrOjc/s400/apv7Ey5vSjK3F3m5Tzg3GQ.webp&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/7845335899452011938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-whats-difference-between-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7845335899452011938'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/7845335899452011938'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/12/in-java-whats-difference-between-object.html' title='The Difference Between Class and Object in Java'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2E7wlkVNalT9iJTHlz9BoA6zEG9avDoF1OR1MO9e4TRqANKNDlJ0gXT-_s8c6WJSZrA_LkCQ79tW_f5_OJVg9TMspKXRal8RuceCjiUalSKoFPiO3IhtUpYH1j-Vt4fqBUfiV1bhY2_Y4iRc76OwY1hbq-oHZgPfYHn22aFuq2S2kz69EBlffUmdrOjc/s72-c/apv7Ey5vSjK3F3m5Tzg3GQ.webp" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-1866198014559338105</id><published>2013-12-10T14:12:00.002+05:30</published><updated>2024-07-12T16:34:24.269+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Class"/><category scheme="http://www.blogger.com/atom/ns#" term="Interface"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Understanding Abstract Classes and Interfaces in Java</title><content type='html'>&lt;div&gt;
  &lt;p&gt;
    Abstract classes and interfaces are fundamental concepts in Java programming, each serving distinct purposes in defining class hierarchies and contracts for implementing classes.
  &lt;/p&gt;

  &lt;h2&gt;Abstract Classes&lt;/h2&gt;
  &lt;p&gt;
    Abstract classes in Java are declared with the &lt;code&gt;abstract&lt;/code&gt; keyword. They cannot be instantiated on their own and are designed to be inherited by subclasses. They may contain abstract methods—methods without a body—that subclasses must implement.
  &lt;/p&gt;

  &lt;h3&gt;When to Use Abstract Classes&lt;/h3&gt;
  &lt;ul&gt;
    &lt;li&gt;Use abstract classes when you want to provide a default implementation that subclasses can override.&lt;/li&gt;
    &lt;li&gt;Abstract classes are suitable when you have a strong relationship between the base class and its subclasses.&lt;/li&gt;
    &lt;li&gt;They allow you to define non-public members, such as protected fields and methods.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;h2&gt;Interfaces&lt;/h2&gt;
  &lt;p&gt;
    Interfaces in Java define a contract that classes can choose to implement. They contain method signatures but no implementation details. A class can implement multiple interfaces but can extend only one class.
  &lt;/p&gt;

  &lt;h3&gt;When to Use Interfaces&lt;/h3&gt;
  &lt;ul&gt;
    &lt;li&gt;Use interfaces when you want to provide a common behavior to unrelated classes.&lt;/li&gt;
    &lt;li&gt;They are ideal for achieving abstraction and supporting multiple inheritance-like behavior.&lt;/li&gt;
    &lt;li&gt;Interfaces are a good choice when you want to create a plugin-like architecture.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;h2&gt;Key Differences Between Abstract Classes and Interfaces&lt;/h2&gt;
  &lt;ul&gt;
    &lt;li&gt;Abstract classes can have method implementations, constructors, and fields, whereas interfaces cannot.&lt;/li&gt;
    &lt;li&gt;A class can extend only one abstract class but can implement multiple interfaces.&lt;/li&gt;
    &lt;li&gt;Abstract classes are suitable for inheritance hierarchies, while interfaces are more flexible for defining contracts.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;h2&gt;Conclusion&lt;/h2&gt;
  &lt;p&gt;
    Choosing between abstract classes and interfaces depends on your design goals. Abstract classes are used for code reusability and defining a base class, while interfaces offer flexibility and multiple inheritance-like behavior. Understanding these concepts is crucial for designing effective and maintainable Java applications.
  &lt;/p&gt;

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/1866198014559338105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/12/whats-difference-between-interface-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1866198014559338105'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1866198014559338105'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/12/whats-difference-between-interface-and.html' title='Understanding Abstract Classes and Interfaces in Java'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-8127221517253050983</id><published>2013-10-05T17:12:00.002+05:30</published><updated>2024-07-12T16:42:47.592+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Class"/><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="compile"/><category scheme="http://www.blogger.com/atom/ns#" term="Hello World"/><category scheme="http://www.blogger.com/atom/ns#" term="Instance Variables"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Methods"/><category scheme="http://www.blogger.com/atom/ns#" term="Object"/><category scheme="http://www.blogger.com/atom/ns#" term="Program"/><category scheme="http://www.blogger.com/atom/ns#" term="run"/><title type='text'>Introduction to Java Programming: Classes, Objects, Methods, and Syntax</title><content type='html'>
  &lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
When considering a Java program, it consists of objects communicating by invoking each other&#39;s methods. Let&#39;s delve into the concepts of classes, objects, methods, and instance variables:
        &lt;ul&gt;
          &lt;li&gt;
            &lt;b&gt;Object -&lt;/b&gt; Objects in Java encapsulate states (e.g., color, name, breed) and behaviors (e.g., wagging, barking, eating). Each object is an instance of a class.
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b&gt;Class -&lt;/b&gt; A class serves as a blueprint or template defining the behaviors and states that objects of its type support.
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b&gt;Methods -&lt;/b&gt; Methods represent the behaviors of a class. They contain the logic, manipulate data, and execute actions within a program.
          &lt;/li&gt;
          &lt;li&gt;
            &lt;b&gt;Instance Variables -&lt;/b&gt; Every object possesses its own set of instance variables. These variables determine the state of an object by holding assigned values.
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;

      &lt;h2&gt;First Java Program:&lt;/h2&gt;
      &lt;div&gt;
        Let&#39;s start with a simple Java program that prints &quot;Hello World&quot;.
      &lt;/div&gt;

      &lt;pre&gt;&lt;code&gt;
public class MyFirstJavaProgram {

    public static void main(String[] args) {
       System.out.println(&quot;Hello World&quot;);
    }
}
      &lt;/code&gt;&lt;/pre&gt;

      &lt;div&gt;
        To compile and run the program, follow these steps:
      &lt;/div&gt;
      &lt;ul&gt;
        &lt;li&gt;
          Open a text editor (e.g., Notepad) and enter the code above.
        &lt;/li&gt;
        &lt;li&gt;
          Save the file as &lt;code&gt;MyFirstJavaProgram.java&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          Open a command prompt, navigate to the directory where the file is saved (e.g., &lt;code&gt;C:\&lt;/code&gt;), and compile the code with &lt;code&gt;javac MyFirstJavaProgram.java&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          If there are no errors, run the program with &lt;code&gt;java MyFirstJavaProgram&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          You should see &quot;Hello World&quot; printed on the console.
        &lt;/li&gt;
      &lt;/ul&gt;

      &lt;h2&gt;Basic Syntax:&lt;/h2&gt;
      &lt;div&gt;
        Key points to remember about Java syntax:
      &lt;/div&gt;
      &lt;ul&gt;
        &lt;li&gt;
          &lt;b&gt;Case Sensitivity -&lt;/b&gt; Java is case-sensitive, distinguishing between &lt;code&gt;Hello&lt;/code&gt; and &lt;code&gt;hello&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          &lt;b&gt;Class Names -&lt;/b&gt; Begin with an uppercase letter; use uppercase for each inner word. Example: &lt;code&gt;MyFirstJavaClass&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          &lt;b&gt;Method Names -&lt;/b&gt; Begin with a lowercase letter; use uppercase for each inner word. Example: &lt;code&gt;public void myMethodName()&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          &lt;b&gt;Program File Name -&lt;/b&gt; Must match the class name exactly. Save as &lt;code&gt;MyFirstJavaProgram.java&lt;/code&gt;.
        &lt;/li&gt;
        &lt;li&gt;
          &lt;b&gt;public static void main(String args[]) -&lt;/b&gt; Entry point for Java programs; must be included in every Java application.
        &lt;/li&gt;
      &lt;/ul&gt;

    &lt;/div&gt;
  &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_kG8_mcKuHp9HTheGAoS1ZF8jb5fhSrAOmy5yAlB2UZc6FsnFZhsFcCpJXvO9oMI6dh0XtBQu-E-0Z5IQpo1GGNsi2F-fIPD51ff84kqVD1JfhjzEDSRGpY5GFaJp8pC7WVVGQOqWBI_Wds-0RB-e-JS-KjoRpkkKXE6mEdqxW3-Fpx1gmZqQKe8xIaY/s284/download.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;177&quot; data-original-width=&quot;284&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_kG8_mcKuHp9HTheGAoS1ZF8jb5fhSrAOmy5yAlB2UZc6FsnFZhsFcCpJXvO9oMI6dh0XtBQu-E-0Z5IQpo1GGNsi2F-fIPD51ff84kqVD1JfhjzEDSRGpY5GFaJp8pC7WVVGQOqWBI_Wds-0RB-e-JS-KjoRpkkKXE6mEdqxW3-Fpx1gmZqQKe8xIaY/s400/download.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/8127221517253050983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/10/basic-hello-world-program-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8127221517253050983'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8127221517253050983'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/10/basic-hello-world-program-in-java.html' title='Introduction to Java Programming: Classes, Objects, Methods, and Syntax'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_kG8_mcKuHp9HTheGAoS1ZF8jb5fhSrAOmy5yAlB2UZc6FsnFZhsFcCpJXvO9oMI6dh0XtBQu-E-0Z5IQpo1GGNsi2F-fIPD51ff84kqVD1JfhjzEDSRGpY5GFaJp8pC7WVVGQOqWBI_Wds-0RB-e-JS-KjoRpkkKXE6mEdqxW3-Fpx1gmZqQKe8xIaY/s72-c/download.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-597396201512298457</id><published>2013-03-25T13:06:00.004+05:30</published><updated>2024-07-12T16:52:55.931+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="element"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to delete first preceding element?</title><content type='html'>&lt;div&gt;
Here is the html from which I want to remove the div element &#39;div&#39; by clicking the link.
&lt;/div&gt;
&lt;pre&gt;
    &amp;lt;div&amp;gt;
      &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;javascript:void(0)&quot; class=&quot;link&quot;&amp;gt;My link&amp;lt;/a&amp;gt;
    &amp;lt;/div&amp;gt;
  &lt;/pre&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
To access&lt;span style=&quot;color: maroon;&quot;&gt;&amp;nbsp;&lt;/span&gt;the preceding element I will use the .parents() method of jQuery and then call&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;
the method .remove() to remove the &#39;div&#39; element.
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Here is the code...
&lt;/div&gt;&lt;pre&gt;
    $(&#39;a.link&#39;).click(function() {
    	$(this).parents(&#39;div:first&#39;).remove();
    });&lt;/pre&gt;

</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/597396201512298457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/03/how-to-delete-first-preceding-element.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/597396201512298457'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/597396201512298457'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/03/how-to-delete-first-preceding-element.html' title='How to delete first preceding element?'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-1091887213849620386</id><published>2013-03-25T11:54:00.001+05:30</published><updated>2024-07-12T17:00:00.249+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bootstrap"/><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>HBootstrap Basics: A Simple Guide</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;Explore Bootstrap basics through a simple HTML setup. Let&#39;s create a foundational template:&lt;/p&gt;
    &lt;p&gt;To start, ensure your HTML includes:&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;Proper document structure with &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;Basic elements like &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;Viewport meta tag for responsiveness&lt;/li&gt;
    &lt;/ul&gt;
    &lt;p&gt;Next, integrate Bootstrap CSS and JavaScript:&lt;/p&gt;
    &lt;pre&gt;&lt;code&gt;&amp;lt;link href=&quot;css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&amp;gt;
&amp;lt;script src=&quot;js/bootstrap.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/pre&gt;
    &lt;p&gt;With these files added, you&#39;re ready to leverage Bootstrap&#39;s features.&lt;/p&gt;
  &lt;/div&gt;

  &lt;div&gt;
    &lt;p&gt;&lt;strong&gt;Pro Tip:&lt;/strong&gt; Ensure your &lt;code&gt;css/bootstrap.min.css&lt;/code&gt; and &lt;code&gt;js/bootstrap.min.js&lt;/code&gt; files are correctly linked to access Bootstrap&#39;s styling and interactive components.&lt;/p&gt;
  &lt;/div&gt;


&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-c0nPise2prx17lNTQJrp1qpMRhuydChulcF4NAQxopArd2DrGg5JU-CKtzq5KHyXPSo4aj0raSTm-mYfNB1mdz5I3JTNzjVigksCioAAE5fMcOSZhKWNaqxzxOI8FqBIo_zKGiP5m1uJRskOtRBX2UB-XcaHiJppNvpL3Bae6Mg6s7ceo7Xg1hwMVbc/s251/download%20%281%29.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;200&quot; data-original-width=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-c0nPise2prx17lNTQJrp1qpMRhuydChulcF4NAQxopArd2DrGg5JU-CKtzq5KHyXPSo4aj0raSTm-mYfNB1mdz5I3JTNzjVigksCioAAE5fMcOSZhKWNaqxzxOI8FqBIo_zKGiP5m1uJRskOtRBX2UB-XcaHiJppNvpL3Bae6Mg6s7ceo7Xg1hwMVbc/s400/download%20%281%29.jpg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/1091887213849620386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/03/html-template-using-bootstrap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1091887213849620386'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1091887213849620386'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/03/html-template-using-bootstrap.html' title='HBootstrap Basics: A Simple Guide'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-c0nPise2prx17lNTQJrp1qpMRhuydChulcF4NAQxopArd2DrGg5JU-CKtzq5KHyXPSo4aj0raSTm-mYfNB1mdz5I3JTNzjVigksCioAAE5fMcOSZhKWNaqxzxOI8FqBIo_zKGiP5m1uJRskOtRBX2UB-XcaHiJppNvpL3Bae6Mg6s7ceo7Xg1hwMVbc/s72-c/download%20%281%29.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-2844419578842135724</id><published>2013-03-25T11:53:00.002+05:30</published><updated>2024-07-12T17:03:11.269+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="501"/><category scheme="http://www.blogger.com/atom/ns#" term="Client"/><category scheme="http://www.blogger.com/atom/ns#" term="CONNECT"/><category scheme="http://www.blogger.com/atom/ns#" term="DELETE"/><category scheme="http://www.blogger.com/atom/ns#" term="GET"/><category scheme="http://www.blogger.com/atom/ns#" term="HEAD"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTP Status Code"/><category scheme="http://www.blogger.com/atom/ns#" term="Not Implemented"/><category scheme="http://www.blogger.com/atom/ns#" term="OPTIONS"/><category scheme="http://www.blogger.com/atom/ns#" term="POST"/><category scheme="http://www.blogger.com/atom/ns#" term="PUT"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="TRACE"/><title type='text'> HTTP Status Code 501 - Not Implemented</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;The server either does not recognize the request method, or it lacks the ability to fulfill the request.&lt;/p&gt;
  &lt;/div&gt;

  &lt;h4&gt;Why it occurs&lt;/h4&gt;
  &lt;div&gt;
    &lt;p&gt;The error occurs when the Web server does not understand or support the HTTP method found in the HTTP data stream sent by the client. The method should be one of GET, OPTIONS, HEAD, POST, PUT, DELETE, TRACE, or CONNECT as defined by the HTTP protocol.&lt;/p&gt;
    &lt;p&gt;If the method is valid but not supported by the Web server, upgrading the server might resolve the issue.&lt;/p&gt;
  &lt;/div&gt;

  &lt;h4&gt;Fixing the 501 error code&lt;/h4&gt;
  &lt;div&gt;
    &lt;p&gt;Clients should specify a valid request type. If the Web server continues to respond incorrectly, consider upgrading the server.&lt;/p&gt;
    &lt;p&gt;If you&#39;re registered with 100pulse, you&#39;ll receive alerts via email or SMS when a 501 status code error occurs.&lt;/p&gt;
  &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDDqxJYuZFKFJd6zXWNSizF1rTeUPMPHh8RlnLrq_WJUgazwBjAq9PuAiPKgk_UZwg73SqQafn4IuERhU4FReGLSe6araZ_VNZsu_CGMRTW8hGy8Mfn9MEDT6ZGbVgLwBr1R6vC47UiuEE-zklcSW1YCKZlxPL6dBmLpnack_NkUWPhQzXSNvlbggKm2U/s1418/91274937-17005180-e79d-11ea-84cf-efa2938c0222.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; width=&quot;400&quot; data-original-height=&quot;878&quot; data-original-width=&quot;1418&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDDqxJYuZFKFJd6zXWNSizF1rTeUPMPHh8RlnLrq_WJUgazwBjAq9PuAiPKgk_UZwg73SqQafn4IuERhU4FReGLSe6araZ_VNZsu_CGMRTW8hGy8Mfn9MEDT6ZGbVgLwBr1R6vC47UiuEE-zklcSW1YCKZlxPL6dBmLpnack_NkUWPhQzXSNvlbggKm2U/s400/91274937-17005180-e79d-11ea-84cf-efa2938c0222.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/2844419578842135724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2013/03/http-status-code-501-not-implemented.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2844419578842135724'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2844419578842135724'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2013/03/http-status-code-501-not-implemented.html' title=' HTTP Status Code 501 - Not Implemented'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDDqxJYuZFKFJd6zXWNSizF1rTeUPMPHh8RlnLrq_WJUgazwBjAq9PuAiPKgk_UZwg73SqQafn4IuERhU4FReGLSe6araZ_VNZsu_CGMRTW8hGy8Mfn9MEDT6ZGbVgLwBr1R6vC47UiuEE-zklcSW1YCKZlxPL6dBmLpnack_NkUWPhQzXSNvlbggKm2U/s72-c/91274937-17005180-e79d-11ea-84cf-efa2938c0222.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-8662666789857175866</id><published>2012-12-21T00:28:00.005+05:30</published><updated>2024-07-12T17:13:09.547+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Query"/><title type='text'>Using Ajax to Query MySQL</title><content type='html'>
  &lt;p&gt;Using Ajax to Query MySQL&lt;/p&gt;
  &lt;br&gt;
  &lt;p&gt;Creating the MySQL Table:&lt;/p&gt;
  &lt;pre&gt;
CREATE TABLE `ajax_example` (
  `name` varchar(50) NOT NULL,
  `age` int(11) NOT NULL,
  `sex` varchar(1) NOT NULL,
  `wpm` int(11) NOT NULL,
  PRIMARY KEY  (`name`)
);
  &lt;/pre&gt;

  &lt;p&gt;Inserting Data into the Table:&lt;/p&gt;
  &lt;pre&gt;
INSERT INTO `ajax_example` VALUES (&#39;Jerry&#39;, 120, &#39;m&#39;, 20);
INSERT INTO `ajax_example` VALUES (&#39;Regis&#39;, 75, &#39;m&#39;, 44);
INSERT INTO `ajax_example` VALUES (&#39;Frank&#39;, 45, &#39;m&#39;, 87);
INSERT INTO `ajax_example` VALUES (&#39;Jill&#39;, 22, &#39;f&#39;, 72);
INSERT INTO `ajax_example` VALUES (&#39;Tracy&#39;, 27, &#39;f&#39;, 0);
INSERT INTO `ajax_example` VALUES (&#39;Julie&#39;, 35, &#39;f&#39;, 90);
  &lt;/pre&gt;

  &lt;hr&gt;

  &lt;p2&gt;Client Side HTML File (ajax.html):&lt;/p&gt;
  &lt;pre&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;Ajax Example&amp;lt;/title&amp;gt;
  &amp;lt;script&amp;gt;
    function ajaxFunction() {
      var ajaxRequest;
      try {
        ajaxRequest = new XMLHttpRequest();
      } catch (e) {
        try {
          ajaxRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);
        } catch (e) {
          try {
            ajaxRequest = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
          } catch (e) {
            alert(&quot;Your browser broke!&quot;);
            return false;
          }
        }
      }
      
      ajaxRequest.onreadystatechange = function() {
        if (ajaxRequest.readyState == 4) {
          var ajaxDisplay = document.getElementById(&#39;ajaxDiv&#39;);
          ajaxDisplay.innerHTML = ajaxRequest.responseText;
        }
      }
      
      var age = document.getElementById(&#39;age&#39;).value;
      var wpm = document.getElementById(&#39;wpm&#39;).value;
      var sex = document.getElementById(&#39;sex&#39;).value;
      var queryString = &quot;?age=&quot; + age + &quot;&amp;amp;wpm=&quot; + wpm + &quot;&amp;amp;sex=&quot; + sex;
      
      ajaxRequest.open(&quot;GET&quot;, &quot;ajax-example.php&quot; + queryString, true);
      ajaxRequest.send(null);
    }
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;form name=&#39;myForm&#39;&amp;gt;
    Max Age: &amp;lt;input type=&#39;text&#39; id=&#39;age&#39; /&amp;gt; &amp;lt;br /&amp;gt;
    Max WPM: &amp;lt;input type=&#39;text&#39; id=&#39;wpm&#39; /&amp;gt; &amp;lt;br /&amp;gt;
    Sex: &amp;lt;select id=&#39;sex&#39;&amp;gt;
      &amp;lt;option value=&quot;m&quot;&amp;gt;m&amp;lt;/option&amp;gt;
      &amp;lt;option value=&quot;f&quot;&amp;gt;f&amp;lt;/option&amp;gt;
    &amp;lt;/select&amp;gt;
    &amp;lt;input type=&#39;button&#39; onclick=&#39;ajaxFunction()&#39; value=&#39;Query MySQL&#39;/&amp;gt;
  &amp;lt;/form&amp;gt;
  
  &amp;lt;div id=&#39;ajaxDiv&#39;&amp;gt;Your result will display here&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
  &lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/8662666789857175866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/ajax-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8662666789857175866'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8662666789857175866'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/ajax-database.html' title='Using Ajax to Query MySQL'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-2897727294145874613</id><published>2012-12-21T00:25:00.002+05:30</published><updated>2024-07-12T17:16:37.657+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Image Map"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>Using JavaScript Image Map</title><content type='html'>
  &lt;div style=&quot;text-align: left;&quot;&gt;
    &lt;p&gt;
      JavaScript can be used to create client-side image maps, which are defined using the &lt;code&gt;&amp;lt;map&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;area&amp;gt;&lt;/code&gt; tags in conjunction with the &lt;code&gt;usemap&lt;/code&gt; attribute of the &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; tag.
    &lt;/p&gt;
    
    &lt;p&gt;
      The &lt;code&gt;&amp;lt;map&amp;gt;&lt;/code&gt; element acts as a container for defining clickable hotspots within an image. Each &lt;code&gt;&amp;lt;area&amp;gt;&lt;/code&gt; tag specifies a shape and coordinates for the hotspot.
    &lt;/p&gt;
    
    &lt;p&gt;
      Below is an example demonstrating how to use an image map with JavaScript to display different messages when hovering over specific areas of an image:
    &lt;/p&gt;
    
    &lt;table class=&quot;src&quot;&gt;
      &lt;tr&gt;
        &lt;td&gt;
          &lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Using JavaScript Image Map&amp;lt;/title&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function showTutorial(name) {
  document.myform.stage.value = name;
}
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form name=&quot;myform&quot;&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;stage&quot; size=&quot;20&quot; /&amp;gt;
&amp;lt;/form&amp;gt;

&amp;lt;img src=&quot;/images/usemap.gif&quot; alt=&quot;HTML Map&quot; 
     border=&quot;0&quot; usemap=&quot;#tutorials&quot;/&amp;gt;

&amp;lt;map name=&quot;tutorials&quot;&amp;gt;
  &amp;lt;area shape=&quot;poly&quot; coords=&quot;74,0,113,29,98,72,52,72,38,27&quot;
        href=&quot;/perl/index.htm&quot; alt=&quot;Perl Tutorial&quot;
        target=&quot;_self&quot; 
        onMouseOver=&quot;showTutorial(&#39;perl&#39;)&quot; 
        onMouseOut=&quot;showTutorial(&#39;&#39;)&quot;/&amp;gt;

  &amp;lt;area shape=&quot;rect&quot; coords=&quot;22,83,126,125&quot;
        href=&quot;/html/index.htm&quot; alt=&quot;HTML Tutorial&quot; 
        target=&quot;_self&quot; 
        onMouseOver=&quot;showTutorial(&#39;html&#39;)&quot; 
        onMouseOut=&quot;showTutorial(&#39;&#39;)&quot;/&amp;gt;

  &amp;lt;area shape=&quot;circle&quot; coords=&quot;73,168,32&quot;
        href=&quot;/php/index.htm&quot; alt=&quot;PHP Tutorial&quot;
        target=&quot;_self&quot; 
        onMouseOver=&quot;showTutorial(&#39;php&#39;)&quot; 
        onMouseOut=&quot;showTutorial(&#39;&#39;)&quot;/&amp;gt;
&amp;lt;/map&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
          &lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/2897727294145874613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/image-map-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2897727294145874613'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2897727294145874613'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/image-map-in-javascript.html' title='Using JavaScript Image Map'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-5716194447888608573</id><published>2012-12-21T00:22:00.004+05:30</published><updated>2024-07-12T17:22:11.307+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Page Redirection"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Development"/><title type='text'>Page Redirection Examples - Learn How to Redirect Web Pages</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;Page redirection is essential for directing users from one URL to another. Learn how to implement different types of redirects using JavaScript:&lt;/p&gt;

    &lt;div&gt;
      &lt;h2&gt;Why Use Page Redirection?&lt;/h2&gt;
      &lt;ul&gt;
        &lt;li&gt;Migrating to a new domain without losing traffic.&lt;/li&gt;
        &lt;li&gt;Routing users based on browser types or geographical locations.&lt;/li&gt;
        &lt;li&gt;Maintaining SEO when restructuring URLs.&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Examples of Page Redirection&lt;/h2&gt;

      &lt;div&gt;
        &lt;h3&gt;Example 1: Instant Redirection&lt;/h3&gt;
        &lt;p&gt;Redirect users immediately:&lt;/p&gt;
        &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
window.location = &quot;http://www.newlocation.com&quot;;
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;/div&gt;

      &lt;div&gt;
        &lt;h3&gt;Example 2: Delayed Redirection with Message&lt;/h3&gt;
        &lt;p&gt;Display a message and redirect after a delay:&lt;/p&gt;
        &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function Redirect() {
  window.location = &quot;http://www.newlocation.com&quot;;
}

document.write(&quot;Redirecting in 10 seconds...&quot;);
setTimeout(&#39;Redirect()&#39;, 10000);
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;/div&gt;

      &lt;div&gt;
        &lt;h3&gt;Example 3: Redirect Based on Browser Type&lt;/h3&gt;
        &lt;p&gt;Redirect users based on their browser type:&lt;/p&gt;
        &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
var browserName = navigator.appName; 
if (browserName == &quot;Netscape&quot;) {
  window.location = &quot;http://www.location.com/ns.htm&quot;;
} else if (browserName == &quot;Microsoft Internet Explorer&quot;) {
  window.location = &quot;http://www.location.com/ie.htm&quot;;
} else {
  window.location = &quot;http://www.location.com/other.htm&quot;;
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/5716194447888608573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/redirect-page-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/5716194447888608573'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/5716194447888608573'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/redirect-page-in-javascript.html' title='Page Redirection Examples - Learn How to Redirect Web Pages'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-6690101057303984190</id><published>2012-12-21T00:17:00.003+05:30</published><updated>2024-07-12T17:23:41.303+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Print"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Page"/><title type='text'>Printing Web Pages with JavaScript - Learn How to Implement Print Functionality</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;Implementing printing functionality on web pages using JavaScript&#39;s &lt;code&gt;window.print()&lt;/code&gt; function allows users to print the current page directly from the browser.&lt;/p&gt;
    
    &lt;div&gt;
      &lt;h2&gt;Implementing Print Functionality&lt;/h2&gt;
      &lt;p&gt;To enable printing, simply use a button with an &lt;code&gt;onclick&lt;/code&gt; event:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;input type=&quot;button&quot; value=&quot;Print&quot; onclick=&quot;window.print()&quot; /&amp;gt;&lt;/pre&gt;
      &lt;p&gt;This button, when clicked, triggers the browser&#39;s print dialog.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Making a Page Printer-Friendly&lt;/h2&gt;
      &lt;p&gt;A printer-friendly page is optimized for printing, usually with minimal graphics and ads:&lt;/p&gt;
      &lt;ul&gt;
        &lt;li&gt;Create a separate printer-friendly version of the page without unnecessary elements.&lt;/li&gt;
        &lt;li&gt;Alternatively, mark printable content with HTML comments like &lt;code&gt;&amp;lt;!-- PRINT STARTS HERE --&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;!-- PRINT ENDS HERE --&amp;gt;&lt;/code&gt;, and use server-side scripts to generate a printable version.&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;Our site follows these practices to provide a better printing experience for visitors.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h3&gt;Alternative Printing Method&lt;/h3&gt;
      &lt;p&gt;If no print button is available, users can use the browser&#39;s standard toolbar:&lt;/p&gt;
      &lt;p&gt;File &amp;rarr; Print &amp;rarr; Click OK.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/6690101057303984190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/print-page-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6690101057303984190'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6690101057303984190'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/print-page-in-javascript.html' title='Printing Web Pages with JavaScript - Learn How to Implement Print Functionality'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-2663711527936289699</id><published>2012-12-21T00:06:00.005+05:30</published><updated>2024-07-12T17:25:37.422+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Client-Side"/><category scheme="http://www.blogger.com/atom/ns#" term="Form Validation"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>Client-Side Form Validation with JavaScript</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;In traditional web forms, validation occurred on the server after submission, leading to delays and server load. JavaScript allows for client-side form validation, checking data before it&#39;s sent to the server.&lt;/p&gt;
    
    &lt;div&gt;
      &lt;h2&gt;Basic Form Validation&lt;/h2&gt;
      &lt;p&gt;Basic validation ensures required fields are filled and formats are correct:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;form action=&quot;/cgi-bin/test.cgi&quot; name=&quot;myForm&quot; onsubmit=&quot;return validate()&quot;&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;Name&quot; /&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;EMail&quot; /&amp;gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;Zip&quot; /&amp;gt;
  &amp;lt;select name=&quot;Country&quot;&amp;gt;
    &amp;lt;option value=&quot;-1&quot; selected&amp;gt;[choose yours]&amp;lt;/option&amp;gt;
    &amp;lt;option value=&quot;1&quot;&amp;gt;USA&amp;lt;/option&amp;gt;
    &amp;lt;option value=&quot;2&quot;&amp;gt;UK&amp;lt;/option&amp;gt;
    &amp;lt;option value=&quot;3&quot;&amp;gt;INDIA&amp;lt;/option&amp;gt;
  &amp;lt;/select&amp;gt;
  &amp;lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function validate() {
  if (document.myForm.Name.value == &quot;&quot;) {
    alert(&quot;Please provide your name!&quot;);
    document.myForm.Name.focus();
    return false;
  }
  if (document.myForm.EMail.value == &quot;&quot;) {
    alert(&quot;Please provide your Email!&quot;);
    document.myForm.EMail.focus();
    return false;
  }
  if (document.myForm.Zip.value == &quot;&quot; || isNaN(document.myForm.Zip.value) || document.myForm.Zip.value.length != 5) {
    alert(&quot;Please provide a zip in the format #####.&quot;);
    document.myForm.Zip.focus();
    return false;
  }
  if (document.myForm.Country.value == &quot;-1&quot;) {
    alert(&quot;Please provide your country!&quot;);
    return false;
  }
  return true;
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Data Format Validation&lt;/h2&gt;
      &lt;p&gt;Validate specific data formats like email addresses:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function validateEmail() {
  var emailID = document.myForm.EMail.value;
  atpos = emailID.indexOf(&quot;@&quot;);
  dotpos = emailID.lastIndexOf(&quot;.&quot;);
  if (atpos &amp;lt; 1 || ( dotpos - atpos &amp;lt; 2 )) {
    alert(&quot;Please enter correct email ID&quot;)
    document.myForm.EMail.focus();
    return false;
  }
  return true;
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/2663711527936289699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/form-validation-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2663711527936289699'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/2663711527936289699'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/form-validation-in-javascript.html' title='Client-Side Form Validation with JavaScript'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-6006010195958147657</id><published>2012-12-21T00:04:00.006+05:30</published><updated>2024-07-12T17:27:17.862+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Error Handling"/><category scheme="http://www.blogger.com/atom/ns#" term="Errors"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Types"/><title type='text'>Types of Errors and Error Handling in JavaScript</title><content type='html'>
  &lt;div&gt;
    &lt;p&gt;Errors in programming can be categorized into three types: Syntax Errors, Runtime Errors, and Logical Errors.&lt;/p&gt;
    
    &lt;div&gt;
      &lt;h2&gt;Syntax Errors&lt;/h2&gt;
      &lt;p&gt;Syntax errors, also known as parsing errors, occur during compilation or interpretation:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
window.print(;  // Syntax error: missing closing parenthesis
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;p&gt;When a syntax error occurs in JavaScript, only the affected thread stops, allowing other threads to continue.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Runtime Errors&lt;/h2&gt;
      &lt;p&gt;Runtime errors, or exceptions, occur during script execution:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
window.printme();  // Runtime error: calling a non-existing function
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;p&gt;Exceptions affect the thread they occur in, but other JavaScript threads can continue normally.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Logical Errors&lt;/h2&gt;
      &lt;p&gt;Logical errors are mistakes in the logic of your script, resulting in unexpected behavior:&lt;/p&gt;
      &lt;p&gt;These errors are not syntax or runtime errors and depend on business logic.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;The try...catch...finally Statement&lt;/h2&gt;
      &lt;p&gt;JavaScript supports exception handling with try...catch...finally blocks:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
try {
    // Code to run
} catch (e) {
    // Code to handle exception
} finally {
    // Code that always executes
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;p&gt;The try block must be followed by either a catch block, a finally block, or both.&lt;/p&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;Examples&lt;/h2&gt;
      &lt;p&gt;Example demonstrating try...catch to handle a runtime error:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function myFunc() {
   var a = 100;
   
   try {
      alert(&quot;Value of variable a is : &quot; + a);
      window.printme();  // Trying to call a non-existing function
   } catch (e) {
      alert(&quot;Error: &quot; + e);
   }
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;The throw Statement&lt;/h2&gt;
      &lt;p&gt;The throw statement allows you to create custom exceptions:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
function myFunc() {
   var a = 100;
   var b = 0;
   
   try {
      if (b == 0) {
         throw(&quot;Divide by zero error.&quot;);
      } else {
         var c = a / b;
      }
   } catch (e) {
      alert(&quot;Error: &quot; + e);
   }
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
    &lt;/div&gt;

    &lt;div&gt;
      &lt;h2&gt;The onerror() Method&lt;/h2&gt;
      &lt;p&gt;The onerror event handler provides information about errors occurring on a page:&lt;/p&gt;
      &lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
window.onerror = function(msg, url, line) {
   alert(&quot;Message: &quot; + msg);
   alert(&quot;URL: &quot; + url);
   alert(&quot;Line number: &quot; + line);
}
&amp;lt;/script&amp;gt;&lt;/pre&gt;
      &lt;p&gt;It helps in identifying and handling errors that occur during script execution.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/6006010195958147657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/12/error-handling-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6006010195958147657'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6006010195958147657'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/12/error-handling-in-javascript.html' title='Types of Errors and Error Handling in JavaScript'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-4921680998624838609</id><published>2012-09-27T19:20:00.004+05:30</published><updated>2024-07-19T13:06:03.343+05:30</updated><title type='text'>Understanding the Difference Between GET and POST Methods in HTTP </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
    &lt;p style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
        When it comes to web development, understanding the fundamental differences between the GET and POST methods in HTTP is essential. These methods are used to send data between the client and server, but they do so in distinct ways, each with its own advantages and limitations. Let&#39;s delve into the key differences between GET and POST methods.
    &lt;/p&gt;
    
    &lt;h3 style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;GET Method:&lt;/h3&gt;
    &lt;ul style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
        &lt;li&gt;&lt;b&gt;Data Transmission:&lt;/b&gt; In the GET method, data is appended to the URL as query parameters. This makes it easily visible in the browser&#39;s address bar.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Single Call System:&lt;/b&gt; GET requests are simple and involve a single call to the server.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Data Size Limit:&lt;/b&gt; The amount of data that can be sent via GET is limited to around 256 characters due to URL length restrictions.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Speed:&lt;/b&gt; Data transmission is generally faster with GET requests since the data is sent as part of the URL.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Default Method:&lt;/b&gt; Many browsers default to using the GET method for requests.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Security:&lt;/b&gt; GET is less secure because the data is exposed in the URL. This makes it unsuitable for sending sensitive information like passwords.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Bookmarking:&lt;/b&gt; URLs containing GET parameters can be bookmarked, allowing users to save and revisit specific states of a webpage.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Server Logging:&lt;/b&gt; Servers can easily log all actions and requests made using the GET method.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Query String Length:&lt;/b&gt; Despite server logs, only up to 255 characters can typically be used in a query string.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Form Variables:&lt;/b&gt; GET can only store up to 18 form variables.&lt;/li&gt;
    &lt;/ul&gt;
    
    &lt;h3 style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;POST Method:&lt;/h3&gt;
    &lt;ul style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
        &lt;li&gt;&lt;b&gt;Data Transmission:&lt;/b&gt; Data is not appended to the URL. Instead, it is sent in the body of the request.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Two Call System:&lt;/b&gt; POST involves a two-step process: one to send the data and another to receive the response.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Data Size Limit:&lt;/b&gt; There is no limit to the amount of data that can be sent using POST. It can handle large volumes of data.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Speed:&lt;/b&gt; Data transmission is comparatively slower with POST requests because the data is included in the body of the request.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Default Method:&lt;/b&gt; POST is not the default method and must be explicitly specified.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Bookmarking:&lt;/b&gt; Pages using POST cannot be bookmarked in the same way as GET requests.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Data Transmission:&lt;/b&gt; POST allows for the transmission of unlimited data as query strings.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Security:&lt;/b&gt; POST is more secure than GET as data is not visible in the URL, making it suitable for sensitive information.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Form Contents:&lt;/b&gt; POST form contents are passed to the script as an input file, allowing for the handling of complex data.&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/4921680998624838609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/difference-between-get-and-post-methods.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/4921680998624838609'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/4921680998624838609'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/difference-between-get-and-post-methods.html' title='Understanding the Difference Between GET and POST Methods in HTTP '/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-3956415587289520363</id><published>2012-09-17T11:25:00.000+05:30</published><updated>2012-09-17T11:25:03.885+05:30</updated><title type='text'>How To Optimize Your Site With GZIP Compression</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;header class=&quot;entry-header&quot;&gt;
  &lt;h1 class=&quot;entry-title&quot;&gt;
&lt;/h1&gt;
&lt;/header&gt;

 &lt;br /&gt;
&lt;div class=&quot;entry-content&quot;&gt;
Compression is a simple, effective way to save bandwidth and speed 
up your site. I hesitated when recommending gzip compression when &lt;a href=&quot;http://betterexplained.com/articles/speed-up-your-javascript-load-time/&quot;&gt;speeding up your javascript&lt;/a&gt; because of &lt;a href=&quot;http://support.microsoft.com/kb/837251&quot;&gt;problems&lt;/a&gt; &lt;a href=&quot;http://support.microsoft.com/kb/823386&quot;&gt;in&lt;/a&gt; &lt;a href=&quot;http://schroepl.net/projekte/mod_gzip/browser.htm&quot;&gt;older browsers&lt;/a&gt;.&lt;br /&gt;
But it&#39;s the 21st century. Most of my traffic comes from modern browsers, and quite frankly, most of &lt;a href=&quot;http://instacalc.com/&quot;&gt;my users&lt;/a&gt;
 are fairly tech-savvy. I don&#39;t want to slow everyone else down because 
somebody is chugging along on IE 4.0 on Windows 95. Google and Yahoo use
 gzip compression. A modern browser is needed to enjoy modern web 
content and modern web speed -- so gzip encoding it is. Here&#39;s how to 
set it up.&lt;br /&gt;
&lt;h2&gt;
Wait, wait, wait: Why are we doing this?&lt;/h2&gt;
Before we start I should explain what content encoding is. When you request a file like &lt;code&gt;http://www.yahoo.com/index.html&lt;/code&gt;, your browser talks to a web server. The conversation goes a little like this:&lt;br /&gt;
&lt;img alt=&quot;HTTP_request.png&quot; border=&quot;0&quot; height=&quot;221&quot; src=&quot;http://betterexplained.com/wp-content/uploads/compression/HTTP_request.png&quot; title=&quot;HTTP_request.png&quot; width=&quot;437&quot; /&gt;&lt;br /&gt;
1. Browser: Hey, &lt;strong&gt;GET&lt;/strong&gt; me /index.html&lt;br /&gt;
2. Server: Ok, let me see if index.html is lying around...&lt;br /&gt;
3. Server: Found it! Here&#39;s your response code (200 OK) and I&#39;m sending the file.&lt;br /&gt;
4. Browser: 100KB? Ouch... waiting, waiting... ok, it&#39;s loaded.&lt;br /&gt;
Of course, the actual headers and protocols are much more formal (monitor them with &lt;a href=&quot;http://betterexplained.com/articles/how-to-debug-web-applications-with-firefox/&quot;&gt;Live &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Headers&lt;/a&gt; if you&#39;re so inclined).&lt;br /&gt;
But it worked, and you got your file.&lt;br /&gt;
&lt;h2&gt;
So what&#39;s the problem?&lt;/h2&gt;
Well, the system works, but it&#39;s not that efficient. 100KB is a &lt;strong&gt;lot of text&lt;/strong&gt;, and frankly, &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;is redundant. Every &lt;code&gt;&amp;lt;html&amp;gt;, &amp;lt;table&amp;gt; and &amp;lt;div&amp;gt;&lt;/code&gt; tag has a closing tag that&#39;s almost the same. Words are repeated throughout the document. Any way you slice it, &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;(and its beefy cousin, &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt;) is not lean.&lt;br /&gt;
And what&#39;s the plan when a file&#39;s too big? Zip it!&lt;br /&gt;
If we could send a .zip file to the browser (index.html.zip) instead 
of plain old index.html, we&#39;d save on bandwidth and download time. The 
browser could download the zipped file, extract it, and then show it to 
user, who&#39;s in a good mood because the page loaded quickly. The 
browser-server conversation might look like this:&lt;br /&gt;
&lt;img alt=&quot;HTTP_request_compressed.png&quot; border=&quot;0&quot; height=&quot;213&quot; src=&quot;http://betterexplained.com/wp-content/uploads/compression/HTTP_request_compressed.png&quot; title=&quot;HTTP_request_compressed.png&quot; width=&quot;436&quot; /&gt;&lt;br /&gt;
1. Browser: Hey, can I &lt;strong&gt;GET&lt;/strong&gt; index.html? I&#39;ll take a compressed version if you&#39;ve got it.&lt;br /&gt;
2. Server: Let me find the file... yep, it&#39;s here. And you&#39;ll take a compressed version? Awesome.&lt;br /&gt;
3. Server: Ok, I&#39;ve found index.html (200 OK), am zipping it and sending it over.&lt;br /&gt;
4. Browser: Great! It&#39;s only 10KB. I&#39;ll unzip it and show the user.&lt;br /&gt;
The formula is simple: Smaller file = faster download = &lt;strong&gt;happy user&lt;/strong&gt;.&lt;br /&gt;
Don&#39;t believe me? The &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;portion of the yahoo home page goes from 101kb to 15kb after compression:&lt;br /&gt;
&lt;img alt=&quot;yahoo_compression.PNG&quot; border=&quot;0&quot; height=&quot;50&quot; src=&quot;http://betterexplained.com/wp-content/uploads/compression/yahoo.png&quot; title=&quot;yahoo_compression.PNG&quot; width=&quot;391&quot; /&gt;&lt;br /&gt;
&lt;h2&gt;
The (not so) hairy details&lt;/h2&gt;
The tricky part of this exchange is the browser and server knowing 
it&#39;s ok to send a zipped file over. The agreement has two parts&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;browser sends a header&lt;/strong&gt; telling the server it accepts compressed content (gzip and deflate are two compression schemes): &lt;code&gt;Accept-Encoding: gzip, deflate&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;server sends a response&lt;/strong&gt; if the content is actually compressed: &lt;code&gt;Content-Encoding: gzip&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
If the server doesn&#39;t send the content-encoding response header, it 
means the file is not compressed (the default on many servers). The 
&quot;Accept-encoding&quot; header is just a request by the browser, not a demand.
 If the server doesn&#39;t want to send back compressed content, the browser
 has to make do with the heavy regular version.&lt;br /&gt;
&lt;h2&gt;
Setting up the server&lt;/h2&gt;
The &quot;good news&quot; is that we can&#39;t control the browser. It either sends the &lt;code&gt;Accept-encoding: gzip, deflate&lt;/code&gt; header or it doesn&#39;t.&lt;br /&gt;
Our job is to configure the server so it returns zipped content if 
the browser can handle it, saving bandwidth for everyone (and giving us a
 happy user).&lt;br /&gt;
For &lt;span class=&quot;caps&quot;&gt;IIS, &lt;/span&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc771003%28WS.10%29.aspx&quot;&gt;enable compression&lt;/a&gt; in the settings.&lt;br /&gt;
In Apache, &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_deflate.html&quot;&gt;enabling output compression&lt;/a&gt; is fairly straightforward. Add the following to your .htaccess file:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
&amp;lt;files *.html&amp;gt;
SetOutputFilter DEFLATE
&amp;lt;/files&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
Apache actually has two compression options:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;mod_deflate&lt;/strong&gt; is easier to set up and is standard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;mod_gzip&lt;/strong&gt; seems more powerful: you can pre-compress content.&lt;/li&gt;
&lt;/ul&gt;
Deflate is quick and works, so I use it; use mod_gzip if that floats 
your boat. In either case, Apache checks if the browser sent the 
&quot;Accept-encoding&quot; header and returns the compressed or regular version 
of the file. However, some older browsers may have trouble (more below) 
and there are special directives you can add to correct this.&lt;br /&gt;
If you can&#39;t change your .htaccess file, you can &lt;a href=&quot;http://perishablepress.com/press/2007/03/26/fast-effective-php-compression/&quot;&gt;use &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;&lt;/a&gt; to return compressed content. Give your &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;file a .php extension and add this code to the top:&lt;br /&gt;
In &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;:&lt;br /&gt;
&amp;lt;?php if (substr_count($_SERVER[&#39;HTTP_ACCEPT_ENCODING&#39;], &#39;gzip&#39;)) ob_start(&quot;ob_gzhandler&quot;); else ob_start(); ?&amp;gt;&lt;br /&gt;
We check the &quot;Accept-encoding&quot; header and return a gzipped version of
 the file (otherwise the regular version). This is almost like building 
your own webserver (what fun!). But really, try to use Apache to 
compress your output if you can help it. You don&#39;t want to monkey with 
your files.&lt;br /&gt;
&lt;h2&gt;
Verify Your Compression&lt;/h2&gt;
Once you&#39;ve configured your server, check to make sure you&#39;re actually serving up compressed content.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Online:&lt;/strong&gt; Use the &lt;a href=&quot;http://www.gidnetwork.com/tools/gzip-test.php&quot;&gt;online gzip test&lt;/a&gt; to check whether your page is compressed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;In your browser:&lt;/strong&gt; Use &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/60&quot;&gt;Web Developer Toolbar&lt;/a&gt; &amp;gt; Information &amp;gt; View Document Size (like I did for Yahoo, above) to see whether the page is compressed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View the headers:&lt;/strong&gt; Use &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/3829&quot;&gt;Live &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Headers&lt;/a&gt; to examine the response. Look for a line that says &quot;Content-encoding: gzip&quot;.&lt;/li&gt;
&lt;/ul&gt;
Be prepared to marvel at the results. The &lt;a href=&quot;http://instacalc.com/&quot;&gt;instacalc homepage&lt;/a&gt; shrunk from 36k to 10k, a 75% reduction in size.&lt;br /&gt;
&lt;h2&gt;
Try Some Examples&lt;/h2&gt;
I&#39;ve set up some pages and a &lt;a href=&quot;http://betterexplained.com/examples/compressed/compression-example.zip&quot;&gt;downloadable example&lt;/a&gt;:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://betterexplained.com/examples/compressed/index.html&quot;&gt;index.html&lt;/a&gt; - No explicit compression (on this server, I am using compression by default &lt;img alt=&quot;:)&quot; class=&quot;wp-smiley&quot; src=&quot;http://betterexplained.com/wp-includes/images/smilies/icon_smile.gif&quot; /&gt;  ).&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://betterexplained.com/examples/compressed/index.htm&quot;&gt;index.htm&lt;/a&gt; - Explicitly compressed with Apache .htaccess using *.htm as a rule&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://betterexplained.com/examples/compressed/index.php&quot;&gt;index.php&lt;/a&gt; - Explicitly compressed using the &lt;span class=&quot;caps&quot;&gt;PHP &lt;/span&gt;header&lt;/li&gt;
&lt;/ul&gt;
Feel free to download the files, put them on your server and tweak the settings.&lt;br /&gt;
&lt;h2&gt;
Caveats&lt;/h2&gt;
As exciting as it may appear, &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Compression isn&#39;t all fun and games. Here&#39;s what to watch out for:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Older browsers&lt;/strong&gt;: Yes, some browsers still may have 
trouble with compressed content (they say they can accept it, but really
 they can&#39;t). If your site absolutely must work with Netscape 1.0 on 
Windows 95, you may not want to use &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; Compression. Apache mod_deflate &lt;a href=&quot;http://httpd.apache.org/docs/2.0/mod/mod_deflate.html#recommended&quot;&gt;has some rules&lt;/a&gt; to avoid compression for older browsers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Already-compressed content&lt;/strong&gt;: Most images, music and 
videos are already compressed. Don&#39;t waste time compressing them again. 
In fact, you probably only need to compress the &quot;big 3&quot; (HTML, &lt;span class=&quot;caps&quot;&gt;CSS &lt;/span&gt;and Javascript).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt;-load&lt;/strong&gt;: Compressing content on-the-fly uses &lt;span class=&quot;caps&quot;&gt;CPU &lt;/span&gt;time
 and saves bandwidth. Usually this is a great tradeoff given the speed 
of compression. There are ways to pre-compress static content and send 
over the compressed versions. This requires more configuration; even if 
it&#39;s not possible, compressing output may still be a net win. Using &lt;span class=&quot;caps&quot;&gt;CPU &lt;/span&gt;cycles for a faster user experience is well worth it, given the short attention spans on the web.&lt;/li&gt;
&lt;/ul&gt;
Enabling compression is one of the fastest ways to improve your 
site&#39;s performance. Go forth, set it up, and let your users enjoy the 
benefits.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/3956415587289520363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/how-to-optimize-your-site-with-gzip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/3956415587289520363'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/3956415587289520363'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/how-to-optimize-your-site-with-gzip.html' title='How To Optimize Your Site With GZIP Compression'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-8830236274227474440</id><published>2012-09-15T16:54:00.001+05:30</published><updated>2012-09-15T16:54:45.031+05:30</updated><title type='text'>Life cycle of Servlet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
The life cycle of a servlet can be categorized into four parts:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;li&gt;&lt;b&gt;Loading and Inatantiation:&amp;nbsp;&lt;/b&gt;The servlet container loads the servlet during startup or when the first request is made. The loading of the servlet depends on the attribute &amp;lt;load-on-startup&amp;gt; of web.xml file. If the attribute &amp;lt;load-on-startup&amp;gt; has a positive value then the servlet is load with loading of the container otherwise it load when the first request comes for service. After loading of the servlet, the container creates the instances of the servlet.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Initialization:&amp;nbsp;&lt;/b&gt;After creating the instances, the servlet container calls the init() method and passes the servlet initialization parameters to the init() method. The init() must be called by the servlet container before the servlet can service any request. The initialization parameters persist untill the servlet is destroyed. The init() method is called only once throughout the life cycle of the servlet.&lt;br /&gt;&lt;br /&gt;The servlet will be available for service if it is loaded successfully otherwise the servlet container unloads the servlet.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Servicing the Request:&lt;/b&gt;&amp;nbsp;After successfully completing the initialization process, the servlet will be available for service. Servlet creates seperate threads for each request. The sevlet container calls the service() method for servicing any request. The service() method determines the kind of request and calls the appropriate method (doGet() or doPost()) for handling the request and sends response to the client using the methods of the response object.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Destroying the Servlet:&amp;nbsp;&lt;/b&gt;If the servlet is no longer needed for servicing any request, the servlet container calls the destroy() method . Like the init() method this method is also called only once throughout the life cycle of the servlet. Calling the destroy() method indicates to the servlet container not to sent the any request for service and the servlet&amp;nbsp; releases all the resources associated with it. Java Virtual Machine claims for the memory associated with the resources for garbage collection.&lt;/li&gt;
&lt;/ol&gt;
&lt;table border=&quot;1&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px; text-align: start; width: 30%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td width=&quot;100%&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;http://www.roseindia.net/servlets/LifeCycle.gif&quot; style=&quot;border: 0px;&quot; width=&quot;328&quot; /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/8830236274227474440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/life-cycle-of-servlet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8830236274227474440'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8830236274227474440'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/life-cycle-of-servlet.html' title='Life cycle of Servlet'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-8284216030739314317</id><published>2012-09-15T16:52:00.001+05:30</published><updated>2012-09-15T16:52:37.668+05:30</updated><title type='text'>Methods of Servlets</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot; style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
A Generic servlet contains the following five methods:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;b&gt;init()&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public void init(ServletConfig config) throws ServletException&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
The&amp;nbsp;&lt;b&gt;init() method&lt;/b&gt;&amp;nbsp;is called only once by the servlet container throughout the life of a servlet. By this init() method the servlet get to know that it has been placed into service.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
The servlet cannot be put into the service if&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;li&gt;&amp;nbsp;The init() method does not return within a fix time set by the web server.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;It throws a ServletException&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
Parameters - The init() method takes&lt;b&gt;&amp;nbsp;&lt;/b&gt;a&lt;b&gt;&amp;nbsp;ServletConfig&lt;/b&gt;&amp;nbsp;object that contains the initialization parameters and servlet&#39;s configuration and throws a&amp;nbsp;&lt;b&gt;ServletException&lt;/b&gt;&amp;nbsp;if an exception has occurred.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;service()&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Once the servlet starts getting the requests, the service() method is called by the servlet container to respond. The servlet services the client&#39;s request with the help of two objects. These two objects&lt;b&gt;javax.servlet.ServletRequest&amp;nbsp;&lt;/b&gt;and&amp;nbsp;&amp;nbsp;&lt;b&gt;javax.servlet.ServletResponse&amp;nbsp;&lt;/b&gt;are passed by the servlet container.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The status code of the response always should be set for a servlet that throws or sends an error.&lt;br /&gt;&lt;br /&gt;Parameters -&amp;nbsp;&lt;b&gt;&amp;nbsp;&lt;/b&gt;The service() method takes&lt;b&gt;&amp;nbsp;the ServletRequest&amp;nbsp;&lt;/b&gt;object that contains the client&#39;s request and the object&lt;b&gt;&amp;nbsp;ServletResponse&lt;/b&gt;&amp;nbsp;contains the servlet&#39;s response. The service() method throws&lt;b&gt;ServletException and IOExceptions&amp;nbsp;&lt;/b&gt;exception.&lt;br /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;b&gt;getServletConfig()&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public ServletConfig getServletConfig()&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
This method contains parameters for initialization and startup of the servlet and returns a&amp;nbsp;&lt;b&gt;ServletConfig object.&amp;nbsp;&lt;/b&gt;This object is then passed to the init method. When this interface is implemented then it stores&lt;b&gt;the ServletConfig object&amp;nbsp;&lt;/b&gt;in order to return it. It is done by the generic class which implements this inetrface.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
Returns -&amp;nbsp; the ServletConfig object&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;b&gt;getServletInfo()&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public String getServletInfo()&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
The information about the servlet is returned by this method like version, author etc. This method returns a string which should be in the form of plain text and not any kind of markup.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&amp;nbsp;Returns - a string that contains the information about the servlet&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;b&gt;destroy()&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public void destroy()&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
This method is called when we need to close the servlet. That is before removing a servlet instance from service, the servlet container calls the destroy() method. Once the servlet container calls the destroy() method, no service methods will be then called . That is after the exit of all the threads running in the servlet, the destroy() method is called. Hence, the servlet gets a chance to clean up all the resources like memory, threads etc which are being held.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/8284216030739314317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/methods-of-servlets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8284216030739314317'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/8284216030739314317'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/methods-of-servlets.html' title='Methods of Servlets'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-1798567013343625081</id><published>2012-09-15T16:51:00.001+05:30</published><updated>2012-09-15T16:51:28.551+05:30</updated><title type='text'>Servlet Container</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;A servlet container is nothing but a compiled, executable program. The main function of the container is to load, initialize and execute servlets. The servlet container is the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;A container handles large number of requests as it can hold many active servlets, listeners etc. It is interesting to note here that the container and the objects in a container are multithreaded. So each object must be thread safe in a container as the multiple requests are being handled by the container due to the entrance of more than one thread to an object at a time.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Note : A Servlet container may run stand alone i.e. without a web server or even on another host.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;We can categorize the servlet containers as:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;I. A simple servlet container is not fully functional and therefore it can only run very simple servlets and does the following :&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Wait for HTTP request.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Construct a&amp;nbsp;&lt;code&gt;ServletRequest&lt;/code&gt;&amp;nbsp;object and a&amp;nbsp;&lt;code&gt;ServletResponse&lt;/code&gt;&amp;nbsp;object.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;If the request is for a static resource, invoke the&amp;nbsp;&lt;code&gt;process&lt;/code&gt;&amp;nbsp;method of the&lt;code&gt;StaticResourceProcessor&lt;/code&gt;&amp;nbsp;instance, passing the&amp;nbsp;&lt;code&gt;ServletRequest&lt;/code&gt;&amp;nbsp;and&lt;code&gt;ServletResponse&lt;/code&gt;&amp;nbsp;objects.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;If the request is for a servlet, load the servlet class and invoke its&amp;nbsp;&lt;code&gt;service&lt;/code&gt;&amp;nbsp;method, passing the&lt;code&gt;ServletRequest&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code&gt;ServletResponse&lt;/code&gt;&amp;nbsp;objects. Note that in this servlet container, the servlet class is loaded every time the servlet is requested.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;II. A fully functional servlet container additionally does the following for each HTTP request for a servlet:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;When the servlet is called for the first time, load the servlet class and call its&amp;nbsp;&lt;code&gt;init&lt;/code&gt;&amp;nbsp;method (once only).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;For each request, construct an instance of&amp;nbsp;&lt;code&gt;javax.servlet.ServletRequest&lt;/code&gt;&amp;nbsp;and an instance of&amp;nbsp;&lt;code&gt;javax.servlet.ServletResponse&lt;/code&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Invoke the servlet&#39;s&amp;nbsp;&lt;code&gt;service&lt;/code&gt;&amp;nbsp;method, passing the&amp;nbsp;&lt;code&gt;ServletRequest&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code&gt;ServletResponse&lt;/code&gt;objects.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;When the servlet class is shut down, call the servlet&#39;s&amp;nbsp;&lt;code&gt;destroy&lt;/code&gt;&amp;nbsp;method and unload the servlet class.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Now lets see what a servlet container does for each HTTP request for a servlet, in general :&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 24px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;The servlet container l&lt;b&gt;oads the servlet class and calls the init method of the servlet&amp;nbsp;&lt;/b&gt;as soon as the servlet is called for the first time.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Then this container makes an instance of&amp;nbsp;&lt;b&gt;javax.servlet.ServletRequest&lt;/b&gt;&amp;nbsp;and&lt;b&gt;javax.servlet.ServletResponse&lt;/b&gt;&amp;nbsp;for each request.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Then it passes the&lt;b&gt;&amp;nbsp;ServletRequest&amp;nbsp;&lt;/b&gt;and&amp;nbsp;&lt;b&gt;ServletResponse&amp;nbsp;&lt;/b&gt;objects by invoking the servlet&#39;s&lt;b&gt;service method.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Finally, it calls the&amp;nbsp;&lt;b&gt;destroy method&lt;/b&gt;&amp;nbsp;and unload the servlet class when the servlet class is to be shut down.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/1798567013343625081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/servlet-container.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1798567013343625081'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1798567013343625081'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/servlet-container.html' title='Servlet Container'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-6386131404457186034</id><published>2012-09-15T16:45:00.000+05:30</published><updated>2012-09-17T10:47:24.749+05:30</updated><title type='text'>What is Java Servlets?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Servlets are server side components that provide a powerful mechanism for developing server side programs. Servlets provide component-based, platform-independent methods for building Web-based applications, without the performance limitations of CGI programs. Unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server as well as platform-independent.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;This leaves you free to select a &quot;best of breed&quot; strategy for your servers, platforms, and tools. Using servlets web developers can create fast and efficient server side application which can run on any servlet enabled web server. Servlets run entirely inside the Java Virtual Machine. Since the Servlet runs at server side so it does not checks the browser for compatibility. Servlets can access the entire family of Java APIs, including the JDBC API to access enterprise databases.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Servlets can also access a library of HTTP-specific calls, receive all the benefits of the mature java language including portability, performance, reusability, and crash protection. Today servlets are the popular choice for building interactive web applications. Third-party servlet containers are available for Apache Web Server, Microsoft IIS, and others. Servlet containers are usually the components of web and application servers, such as BEA WebLogic Application Server, IBM WebSphere, Sun Java System Web Server, Sun Java System Application Server and others.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Servlets are not designed for a specific protocols. It is different thing that they are most commonly used with the HTTP protocols Servlets uses the classes in the java packages javax.servlet and javax.servlet.http. Servlets provides a way of creating the sophisticated server side extensions in a server as they follow the standard framework and use the highly portable java language.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;HTTP Servlet typically used to:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;- Provide dynamic content like getting the results of a database query and returning to the client.&lt;br /&gt;
&amp;nbsp;- Process and/or store the data submitted by the HTML.&lt;br /&gt;
&amp;nbsp;- Manage information about the state of a stateless HTTP.&lt;br /&gt;
&amp;nbsp;- e.g. an online shopping car manages request for multiple concurrent customers.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/6386131404457186034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/09/what-is-java-servlets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6386131404457186034'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/6386131404457186034'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/09/what-is-java-servlets.html' title='What is Java Servlets?'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2003732912185691712.post-1480231455932604892</id><published>2012-04-26T02:47:00.001+05:30</published><updated>2012-04-26T02:47:33.367+05:30</updated><title type='text'>Table to jqGrid</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;level2&quot;&gt;



 
In order to use this module you should mark the Table to Grid (in Other 
modules) when you download the grid.&lt;br /&gt;


&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Calling Convention:&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;pre class=&quot;code javascript&quot;&gt;tableToGrid&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;selector&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; options&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;noteclassic&quot;&gt;
This is function and not a method
&lt;/div&gt;
where 
&lt;br /&gt;

&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;
 selector(string) can be either the table&#39;s class or id&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;
 options is array with grid options&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
The html table should have the following structure:
&lt;br /&gt;

&lt;pre class=&quot;code html4strict&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;mytable&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt; (or &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;mytable&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;) 
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
     &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;th&lt;/span&gt;&amp;gt;&lt;/span&gt; header 1 &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;th&lt;/span&gt;&amp;gt;&lt;/span&gt; 
     &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;th&lt;/span&gt;&amp;gt;&lt;/span&gt; header 2 &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;th&lt;/span&gt;&amp;gt;&lt;/span&gt; 
     ... 
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;tbody&lt;/span&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;td&lt;/span&gt;&amp;gt;&lt;/span&gt; data 1 &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;td&lt;/span&gt;&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;td&lt;/span&gt;&amp;gt;&lt;/span&gt; data 1 &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;td&lt;/span&gt;&amp;gt;&lt;/span&gt; 
      ... 
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
      ... 
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;tr&lt;/span&gt;&amp;gt;&lt;/span&gt; 
    .... 
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;tbody&lt;/span&gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;table&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://code-developers.blogspot.com/feeds/1480231455932604892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://code-developers.blogspot.com/2012/04/table-to-jqgrid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1480231455932604892'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/2003732912185691712/posts/default/1480231455932604892'/><link rel='alternate' type='text/html' href='https://code-developers.blogspot.com/2012/04/table-to-jqgrid.html' title='Table to jqGrid'/><author><name>Snehal Ghumade</name><uri>http://www.blogger.com/profile/09050893666944565996</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJ2NzCrfrd9EhEHXLt8J2F2u2y-iwTKbLIORH8YOMHhd2BOhD8STLeepthMtnMHqmxoFNwqScRIjUiVFIHQVikVFGMQblMrKrt6zPY8BqUjEssju7Z8CYqYXPr48JBu0/s113/-Fk0vWpP_400x400.jpg'/></author><thr:total>0</thr:total></entry></feed>