15. Assume that we have got three pdf files for the MCA-1 Syllabus, MCA-2 Syllabus and MCA-3 Syllabus respectively, Now write a Servlet which displays the appropriate PDF file to the client, by looking at a request parameter for the year (1, 2 or 3).
Index.html
<html>
<head>
<title>EX-15: WTAD : www.bipinrupadiya.com</title>
</head>
<body>
<center>
<FORM action="/Ex15/bipinrupadiya.blogspot.com">
Select MCA Syllabus : <select size=1 name="MCA">
<option value="MCA-1">MCA1</option>
<option value="MCA-2">MCA2</option>
<option value="MCA-3">MCA3</option>
</select>
<INPUT TYPE="SUBMIT" value="Show" >
</FORM>
</center>
</body>
</html>
Servlet<head>
<title>EX-15: WTAD : www.bipinrupadiya.com</title>
</head>
<body>
<center>
<FORM action="/Ex15/bipinrupadiya.blogspot.com">
Select MCA Syllabus : <select size=1 name="MCA">
<option value="MCA-1">MCA1</option>
<option value="MCA-2">MCA2</option>
<option value="MCA-3">MCA3</option>
</select>
<INPUT TYPE="SUBMIT" value="Show" >
</FORM>
</center>
</body>
</html>
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.WebServlet;
@WebServlet(
name="WTAD",
urlPatterns={"/Ex15","/bipinrupadiya.blogspot.com"}
)
public class ShowPDF extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)throws
ServletException,IOException
{
String sem = request.getParameter("MCA");
response.setContentType("application/pdf");
response.sendRedirect("/"+sem+".pdf");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
{
doGet(request,response);
}
}
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.WebServlet;
@WebServlet(
name="WTAD",
urlPatterns={"/Ex15","/bipinrupadiya.blogspot.com"}
)
public class ShowPDF extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)throws
ServletException,IOException
{
String sem = request.getParameter("MCA");
response.setContentType("application/pdf");
response.sendRedirect("/"+sem+".pdf");
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
{
doGet(request,response);
}
}
NOTE: Put Three .pdf file on application's root directory (MCA-1.pdf, MCA-2.pdf, MCA-3.pdf)
Subscribe to:
Post Comments (Atom)
Subjects
- WordPress
- Mobile Computing-4649303 Practical Solution
- Android Programming New Syllabus Theory
- PHP LAMP Question Bank
- PHP LAMP Theory
- Step by Step Android Example
- Android Practical
- Android Theory
- Android Question Bank
- Networking FON Practical
- Networking FON Theory
- OS Practical
- OS Theory
- HTML
- JavaScript
- J2EE WTAD Theory
- J2EE WTAD Question Bank
- J2EE WTAD Quick Guide
- J2EE WTAD GTU Papers
- J2EE WTAD Practical
- Python
- JAVA Theory
- JAVA Practical
- MIS
Categories
- Android (55)
- c (11)
- Configure Tomcat7 (2)
- CSS (3)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- install Tomcat (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- linux (8)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- shell script (33)
- unix (22)
- WTAD (34)
Blog Archive
-
▼
2012
(79)
-
▼
January
(16)
- 15. Assume that we have got three pdf files for th...
- 14. Write a Servlet which displays a message and a...
- 13. Write a Servlet to display all the attributes ...
- 12. Write a Servlet to display parameters availabl...
- 11. Write a Servlet to display all the headers ava...
- create GenericServlet
- 9. Write a JavaScript to show a pop up window with...
- 8. Write a JavaScript to find a string from the gi...
- 7. Write a JavaScript to convert Celsius to Fahren...
- 6. Write a JavaScript to remove the highest elemen...
- 5. Write a JavaScript to generate two random numbe...
- 4. Write a JavaScript that finds out multiples of ...
- 3. Create a Form in HTML with two fields, minimum ...
- 2. Write a JavaScript that demonstrates the use of...
- 1. Write a JavaScript that shows how a variable’s ...
- getting "android write to sdcard permission denied...
-
▼
January
(16)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
14 comments:
Enjoy taking advantage of Motor Club of America's many health and travel discounts on services such as hotels, rental cars, vision, and dental. We have a network of the largest brands in those respective industries. Our perks will allow you to save hundreds on everday purchase items. Save hundreds of dollars a year by booking with any of our rental car agencies or hotel chains.
America auto club
Join Motor Club of America
Motor Club of America website
Motor Club
roadside assistance
MCA
thanks for this excellent article! Just the scripts I've been looking for. a quick question:
how did you create those beautiful charts/graph in your post? many thanks!!!
Java training in Chennai | Java training institute in Chennai | Java course in Chennai
thanks for this excellent article! Just the scripts I've been looking for. a quick question:
how did you create those beautiful charts/graph in your post? many thanks!!!
Java training in Chennai | Java training institute in Chennai | Java course in Chennai
nice blog..
java training in chennai
java training in omr
aws training in chennai
aws training in omr
python training in chennai
python training in omr
selenium training in chennai
selenium training in omr
Very nice post here and thanks for latest smartphone applications it .I always like and such a super colors of phone for these post.Excellent and very cool idea and great models and different kinds of the more information's.
oracle training in chennai
oracle training in tambaram
oracle dba training in chennai
oracle dba training in tambaram
ccna training in chennai
ccna training in tambaram
seo training in chennai
seo training in tambaram
This is also a very good post which I really enjoyed reading. It is not every day that I have the possibility to see something like this.
angular js training in chennai
angular js training in velachery
full stack training in chennai
full stack training in velachery
php training in chennai
php training in velachery
photoshop training in chennai
photoshop training in velachery
thanks for this excellent article. Keep sharing like this.
web designing training in chennai
web designing training in annanagar
digital marketing training in chennai
digital marketing training in annanagar
rpa training in chennai
rpa training in annanagar
tally training in chennai
tally training in annanagar
Excellent blog!!! I got to know more useful information by reading your blog. Thanks for posting this blog.
Big Data Training Institute in Pune
Hadoop Training in Pune
It is really a nice and useful piece of info. I'm glad that you just shared this helpful information with us. Please stay us informed like this. Thanks for sharing.
amazon web services aws training in chennai
microsoft azure training in chennai
workday training in chennai
android-training-in chennai
ios training in chennai
This is most informative and also this post most user-friendly and super navigation to all posts.
Data Science Course in Pune
Python Classes in Pune
AWS Training in Pune
very informative article.
Angular training in Chennai
very clearly explained thanks for sharing !
TALLY TRAINING IN CHENNAI
TALLY TRAINING INSTITUTE IN CHENNAI
TALLY ERP 9 CLASSES IN CHENNAI
TALLY COURSE IN CHENNAI
GST TALLY TRAINING INSTITUTE IN CHENNAI
TALLY CLASSES IN CHENNAI
BEST TALLY TRAINING CENTER IN CHENNAI
TALLY CERTIFICATION COURSE IN CHENNAI
TALLY CLASSES IN CHENNAI
BEST TALLY TRAINING COURSES IN CHENNAI
BEST TALLY ERP 9 TRAINING IN CHENNAI
TALLY ERP 9 COURSE IN CHENNAI
COMPANY ACCOUNTS TRAINING INSTITUTE IN CHENNAI
COMPANY ACCOUNTS TRAINING IN CHENNAI
ACCOUNTING COURSES IN CHENNAI
ACCOUNTS TRAINING CENTER IN CHENNAI
GST TRAINING INSTITUTE IN CHENNAI
GST CLASSES IN CHENNAI
GST TRAINING COURSES IN CHENNAI
GST CERTIFICATION COURSE IN CHENNAI
TALLY GST CERTIFICATION TRAINING IN CHENNAI
BEST TAXATION TRAINING IN CHENNAI
TAXATION COURSE IN CHENNAI
TAXATION CLASSES IN CHENNAI
INCOME TAX CONSULTANT COURSE IN CHENNAI
BEST TALLY TRAINING IN CHENNAI&VADAPALANI
BEST TALLY TRAINING COURSES WITH 100% JOB PLACEMENTS & CERTIFICATION
great!very useful article thanks for sharing
Java training institute in Chennai
Java training in Chennai
Best Java courses institutes
Java training in Chennai with 100% placements
Best Java training institute in Chennai
ONLINE JAVA TRAINING INSTITUTE IN CHENNAI
BEST JAVA TRAINING IN CHENNAI & VADAPALANI
CORE JAVA/J2EE TRAINING IN CHENNAI
BEST NO.1 JAVA TRAINING INSTITUTE IN CHENNAI & VADAPALANI
JAVA COURSE IN CHENNAI
JAVA CLASS IN CHENNAI
JAVA CLASSES IN CHENNAI
BEST JAVA TRAINING CENTER IN CHENNAI
JAVA CERTIFICATION COURSE IN CHENNAI
BEST JAVA TRAINING COURSES WITH 100% JOB PLACEMENTS & CERTIFICATION
Excellent and very cool idea and great content of different kinds of the valuable information's.
Apache Spark and Scala Online Training
Spark and Scala Training
Post a Comment