01 import javax.servlet.*;
02 import javax.servlet.http.*;
03 import java.io.*;
04
05 public class ConfigParamServlet extends HttpServlet {
06
07 public static final String CONFIG_PARAM = "some_param";
08 public static final String CONFIG_VALUE = "some_value";
09 public String param_value;
10
11 public void init(ServletConfig config) throws ServletException {
12 super.init(config);
13 param_value = config.getInitParameter("some_param");
14 }
15
16 // metóda na overenie správnosti init údajov
17 protected boolean validateInitParameters() {
18 if (param_value.equals(CONFIG_VALUE)) {
19 return true;
20 }
21 else {
22 return false;
23 }
24 }
25 }
|