|
| 1 | +/* |
| 2 | + * To change this license header, choose License Headers in Project Properties. |
| 3 | + * To change this template file, choose Tools | Templates |
| 4 | + * and open the template in the editor. |
| 5 | + */ |
| 6 | +package org.cidarlab.fpSelection.servlets; |
| 7 | + |
| 8 | +import java.io.BufferedReader; |
| 9 | +import java.io.FileInputStream; |
| 10 | +import java.io.IOException; |
| 11 | +import java.io.InputStreamReader; |
| 12 | +import java.io.PrintWriter; |
| 13 | +import javax.servlet.ServletConfig; |
| 14 | +import javax.servlet.ServletContext; |
| 15 | +import javax.servlet.ServletException; |
| 16 | +import javax.servlet.http.HttpServlet; |
| 17 | +import javax.servlet.http.HttpServletRequest; |
| 18 | +import javax.servlet.http.HttpServletResponse; |
| 19 | + |
| 20 | + |
| 21 | +/** |
| 22 | + * |
| 23 | + * @author prash |
| 24 | + */ |
| 25 | +public class Compensation extends HttpServlet { |
| 26 | + |
| 27 | + private ServletContext context; |
| 28 | + |
| 29 | + public void init(ServletConfig config) throws ServletException |
| 30 | + { |
| 31 | + this.context = config.getServletContext(); |
| 32 | + } |
| 33 | + |
| 34 | + @Override |
| 35 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| 36 | + BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(context.getRealPath("/")+"/_LayoutHeader.html"))); |
| 37 | + String str; |
| 38 | + PrintWriter out = response.getWriter(); |
| 39 | + while ((str = in.readLine()) != null) { |
| 40 | + out.println(str); |
| 41 | + } |
| 42 | + in = new BufferedReader(new InputStreamReader(new FileInputStream(context.getRealPath("/")+"/Compensation.html"))); |
| 43 | + while ((str = in.readLine()) != null) { |
| 44 | + out.println(str); |
| 45 | + } |
| 46 | + in = new BufferedReader(new InputStreamReader(new FileInputStream(context.getRealPath("/")+"/_LayoutFooter.html"))); |
| 47 | + while ((str = in.readLine()) != null) { |
| 48 | + out.println(str); |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments