Java Code Examples for javax.servlet.ServletException

The following are top voted examples for showing how to use javax.servlet.ServletException. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: sns-todo   File: LoginAuthenticationFailureHandler.java   Source Code and License 7 votes vote down vote up
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {

    if (exception instanceof CaptchaException) {
        getRedirectStrategy().sendRedirect(request, response, CODE_ERROR_URL);
    } else {
        getRedirectStrategy().sendRedirect(request, response, PASS_ERROR_URL);
    }
}
 
Example 2
Project: lams   File: EventActionDispatcher.java   Source Code and License 6 votes vote down vote up
/**
 * <p>Dispatches to the target class' <code>unspecified</code> method, if
 * present, otherwise throws a ServletException. Classes utilizing
 * <code>EventActionDispatcher</code> should provide an <code>unspecified</code>
 * method if they wish to provide behavior different than throwing a
 * ServletException.</p>
 *
 * @param mapping  The ActionMapping used to select this instance
 * @param form     The optional ActionForm bean for this request (if any)
 * @param request  The non-HTTP request we are processing
 * @param response The non-HTTP response we are creating
 * @return The forward to which control should be transferred, or
 *         <code>null</code> if the response has been completed.
 * @throws Exception if the application business logic throws an
 *                   exception.
 */
protected ActionForward unspecified(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    // Identify if there is an "unspecified" method to be dispatched to
    String name = "unspecified";
    Method method = null;

    try {
        method = getMethod(name);
    } catch (NoSuchMethodException e) {
        String message =
            messages.getMessage("event.parameter", mapping.getPath());

        LOG.error(message + " " + mapping.getParameter());

        throw new ServletException(message);
    }

    return dispatchMethod(mapping, form, request, response, name, method);
}
 
Example 3
Project: servlet4-demo   File: Http2ServletTest.java   Source Code and License 6 votes vote down vote up
@Test
public void testDoGet() {
  try {
    sut.doGet(request, response);
    verify(response, times(1)).setContentType("text/html;charset=UTF-8");
    verify(response, times(1)).getWriter();
    assertEquals("<html>" +
        "<img src='images/cat.jpg'>" +
        "<p>Image by <a href=\"https://flic.kr/p/HPf9R1\">" +
        "Andy Miccone</a></p>" +
        "<p>License: <a href=\"https://creativecommons.org/" +
        "publicdomain/zero/1.0/\">" +
        "CC0 1.0 Universal (CC0 1.0) \n" +
        "Public Domain Dedication</a></p>" +
        "</html>", stringWriter.toString());
    verify(pushBuilder, times(2)).push();
  } catch (ServletException | IOException e) {
    fail();

  }
}
 
Example 4
Project: hadoop   File: TestHttpServer.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public void doGet(HttpServletRequest request, 
                  HttpServletResponse response
                  ) throws ServletException, IOException {
  PrintWriter out = response.getWriter();
  Map<String, String[]> params = request.getParameterMap();
  SortedSet<String> keys = new TreeSet<String>(params.keySet());
  for(String key: keys) {
    out.print(key);
    out.print(':');
    String[] values = params.get(key);
    if (values.length > 0) {
      out.print(values[0]);
      for(int i=1; i < values.length; ++i) {
        out.print(',');
        out.print(values[i]);
      }
    }
    out.print('\n');
  }
  out.close();
}
 
Example 5
Project: sgroup   File: FileManageServlet.java   Source Code and License 6 votes vote down vote up
/**
     * 获取文件列表
     * @param req 客户端发送的数据对象
     * @param resp 服务器发送的数据对象(大概)
     */
    protected void toFileList(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        每页默认显示2条数据
        String size = req.getParameter("pageSize");

        int pageSize = size == null ? 5 : Integer.parseInt(size);
//        查询文件总数
        int fileNum = fileService.queryFileNum();
//        计算总页数
        int pages;
        if (fileNum%pageSize != 0) {
            pages = (fileNum/pageSize) + 1;
        } else {
            pages = (fileNum/pageSize);
        }
//        当前页
        String pageIndex = req.getParameter("curPage");
        int curPage = pageIndex == null ? 1 : Integer.parseInt(pageIndex);

        List<FileDemo> fileDemos = fileService.queryFile(curPage, pageSize);
        req.setAttribute("fileDemos", fileDemos);
        req.setAttribute("curPage",curPage);
        req.setAttribute("pageSize",pageSize);
        req.setAttribute("pages",pages);
        req.getRequestDispatcher("/filemanage/filemanage.jsp").forward(req, resp);
    }
 
Example 6
Project: goodees   File: CatalinaValve.java   Source Code and License 6 votes vote down vote up
@Override
public int invoke(Request rqst, Response rspns) throws IOException,
        ServletException {
    if (!isStarted()) {
        try {
            start();
        } catch (LifecycleException ex) {
            throw new ServletException(ex);
        }
    }
    rqst.setNote(CatalinaAdapter.REQUEST_TIME, System.currentTimeMillis());
    if (!alreadySetLogbackStatusManager) {
        alreadySetLogbackStatusManager = true;
        org.apache.catalina.Context tomcatContext = rqst.getContext();
        if (tomcatContext != null) {
            ServletContext sc = tomcatContext.getServletContext();
            if (sc != null) {
                sc.setAttribute(AccessConstants.LOGBACK_STATUS_MANAGER_KEY, ctx.getStatusManager());
            }
        }
    }

    return INVOKE_NEXT;
}
 
Example 7
Project: tomcat7   File: DuplicateMappingParamServlet.java   Source Code and License 6 votes vote down vote up
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException {
    PrintWriter out = res.getWriter();
    out.print("<p>" + getInitParameter("foo") + " "
            + getInitParameter("bar") + "</p>");
}
 
Example 8
Project: urule   File: FrameServletHandler.java   Source Code and License 6 votes vote down vote up
public void copyFile(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	String newFullPath=req.getParameter("newFullPath");
	String oldFullPath=req.getParameter("oldFullPath");
	newFullPath=Utils.decodeURL(newFullPath);
	oldFullPath=Utils.decodeURL(oldFullPath);
	try{
		InputStream inputStream=repositoryService.readFile(oldFullPath, null);
		String content=IOUtils.toString(inputStream, "utf-8");
		inputStream.close();
		User user=EnvironmentUtils.getLoginUser(new RequestContext(req,resp));
		repositoryService.createFile(newFullPath, content,user);
		loadProjects(req, resp);
	}catch(Exception ex){
		throw new RuleException(ex);
	}
}
 
Example 9
Project: jshERP   File: SessionFilter.java   Source Code and License 6 votes vote down vote up
/**
 * 判断用户session是否存在 不存在则跳转到登录页面
 * 重载方法
 * @param srequest
 * @param sresponse
 * @param chain
 * @throws IOException
 * @throws ServletException
 */
public void doFilter(ServletRequest srequest, ServletResponse sresponse, FilterChain chain)
    throws IOException, ServletException
{
    HttpServletRequest request = (HttpServletRequest) srequest;
    HttpServletResponse response = (HttpServletResponse) sresponse;
    HttpSession session = request.getSession();
    
    //获取工程路径
    String path = request.getContextPath();
    String requestURl = request.getRequestURI();
    
    if(requestURl.contains("/pages") &&null != session.getAttribute("user"))
        chain.doFilter(request, response);
    else
        response.sendRedirect(path + "/logout.jsp");
}
 
Example 10
Project: lams   File: ForgotPasswordServlet.java   Source Code and License 6 votes vote down vote up
@Override
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String method = request.getParameter("method");

if (method.equals("requestEmail")) {
    String selectType = request.getParameter("selectType");
    Boolean findByEmail = false;
    String param = "";
    if (selectType.equals("radioEmail")) {
	findByEmail = true;
	param = request.getParameter("email");
    } else {
	param = request.getParameter("login");
    }

    handleEmailRequest(findByEmail, param.trim(), response);
} else if (method.equals("requestPasswordChange")) {
    String newPassword = request.getParameter("newPassword");
    String key = request.getParameter("key");
    handlePasswordChange(newPassword, key, response);
} else {
    response.sendError(HttpServletResponse.SC_BAD_REQUEST);
}

   }
 
Example 11
Project: SpringTutorial   File: ControllerServlet.java   Source Code and License 6 votes vote down vote up
private void handleLogon(HttpServletRequest request,
		HttpServletResponse response) throws ServletException, IOException {

	String userName = request.getParameter("userName");
	String password = request.getParameter("password");

	LoginService loginService = new LoginService();

	if (loginService.isValidUser(userName, password)) {
		// UserBean user=loginService.getUser();
		// request.setAttribute("user", user);
		RequestDispatcher requestDispatcher = request
				.getRequestDispatcher("useraccounts.jsp");
		requestDispatcher.forward(request, response);
	} else {
		System.out.println("Wrong Login or Password");
		response.sendRedirect("logon.jsp");
	}

}
 
Example 12
Project: tomcat7   File: TestCorsFilter.java   Source Code and License 6 votes vote down vote up
/**
 * when a valid CORS Pre-flight request arrives, with empty
 * Access-Control-Request-Method
 *
 * @throws ServletException
 * @throws IOException
 */
@Test
public void testCheckPreFlightRequestTypeEmptyACRM()
        throws ServletException, IOException {
    TesterHttpServletRequest request = new TesterHttpServletRequest();
    request.setHeader(CorsFilter.REQUEST_HEADER_ORIGIN,
            TesterFilterConfigs.HTTP_TOMCAT_APACHE_ORG);
    request.setHeader(
            CorsFilter.REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD,
            "");
    request.setMethod("OPTIONS");
    CorsFilter corsFilter = new CorsFilter();
    corsFilter.init(TesterFilterConfigs
            .getDefaultFilterConfig());
    CorsFilter.CORSRequestType requestType =
            corsFilter.checkRequestType(request);
    Assert.assertEquals(CorsFilter.CORSRequestType.INVALID_CORS,
            requestType);
}
 
Example 13
Project: testee.fi   File: StaticServlet.java   Source Code and License 6 votes vote down vote up
@Override
protected void doGet(
        final HttpServletRequest req,
        final HttpServletResponse resp
) throws ServletException, IOException {
    for (final StaticResourceResolver resolver : staticResourceResolvers) {
        final StaticResourceResolver.ResolvedResource resource = resolver.resolve(req.getPathInfo());
        if (resource == null) {
            continue;
        }
        resp.setContentType(resource.getContentType());
        try {
            resource.getContent(resp.getOutputStream());
        }catch(final IOException e) {
            LOG.error("I/O error serving static resource", e);
            resp.setStatus(500);
        }
        return;
    }
    resp.setStatus(404);
}
 
Example 14
Project: joai-project   File: UcasProxyAction.java   Source Code and License 5 votes vote down vote up
/**
 *  Process the specified HTTP request, and create the corresponding HTTP
 *  response (or forward to another web component that will create it). Return
 *  an <code>ActionForward</code> instance describing where and how control
 *  should be forwarded, or <code>null</code> if the response has already been
 *  completed.
 *
 * @param  mapping               The ActionMapping used to select this instance
 * @param  request               The HTTP request we are processing
 * @param  response              The HTTP response we are creating
 * @param  form                  NOT YET DOCUMENTED
 * @return                       NOT YET DOCUMENTED
 * @exception  IOException       if an input/output error occurs
 * @exception  ServletException  if a servlet exception occurs
 */
public ActionForward execute(ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
	 throws IOException, ServletException {

	ActionErrors errors = new ActionErrors();

	UcasProxyForm ucasForm = (UcasProxyForm) form;

	// Query Args
	String command = request.getParameter("command");

	SchemEditUtils.showRequestParameters(request);

	try {
		return getUcasUserInfo(mapping, form, request, response);
	} catch (Throwable t) {
		t.printStackTrace();
		errors.add("error",
			new ActionError("generic.error", "System Error: " + t.getMessage()));
		saveErrors(request, errors);
	}

	// Forward control to the specified success URI
	return (mapping.findForward("error.page"));
}
 
Example 15
Project: cloud-s4-sdk-examples   File: HelloWorldServlet.java   Source Code and License 5 votes vote down vote up
@Override
public void doGet(final HttpServletRequest request, final HttpServletResponse response)
    throws ServletException,
        IOException
{
    logger.info("I am running!");
    response.getWriter().write("Hello World!");
}
 
Example 16
Project: lams   File: PageContextImpl.java   Source Code and License 5 votes vote down vote up
private void doForward(String relativeUrlPath) throws ServletException,
		IOException {

	// JSP.4.5 If the buffer was flushed, throw IllegalStateException
	try {
		out.clear();
	} catch (IOException ex) {
		IllegalStateException ise = new IllegalStateException(Localizer
				.getMessage("jsp.error.attempt_to_clear_flushed_buffer"));
		ise.initCause(ex);
		throw ise;
	}

	// Make sure that the response object is not the wrapper for include
	while (response instanceof ServletResponseWrapperInclude) {
		response = ((ServletResponseWrapperInclude) response).getResponse();
	}

	final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
	String includeUri = (String) request
			.getAttribute(Constants.INC_SERVLET_PATH);

	if (includeUri != null)
		request.removeAttribute(Constants.INC_SERVLET_PATH);
	try {
		context.getRequestDispatcher(path).forward(request, response);
	} finally {
		if (includeUri != null)
			request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
	}
}
 
Example 17
Project: tomcat7   File: TestCorsFilter.java   Source Code and License 5 votes vote down vote up
@Test(expected = ServletException.class)
public void testDoFilterRequestNullResponse() throws IOException,
        ServletException {
    TesterHttpServletRequest request = new TesterHttpServletRequest();
    CorsFilter corsFilter = new CorsFilter();
    corsFilter.init(TesterFilterConfigs.getDefaultFilterConfig());
    corsFilter.doFilter(request, null, filterChain);
}
 
Example 18
Project: Projeto_Integrador_3_Semestre   File: CadastrarSLAServlet.java   Source Code and License 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    RequestDispatcher dispatcher = request.getRequestDispatcher("WEB-INF/jsp/SLA.jsp");
    dispatcher.forward(request, response);

}
 
Example 19
Project: Android_Code_Arbiter   File: SpringSafeSessionFilter.java   Source Code and License 5 votes vote down vote up
@Override
protected void doFilterInternal(
        HttpServletRequest req, HttpServletResponse res, FilterChain chain)
        throws ServletException, IOException {

    ServletRequestAttributes attributes = new ServletRequestAttributes(req, res);

    try {

        if(1 + 1 == 2) {

            SecurityContext oldCtx = SecurityContextHolder.getContext();
            SecurityContextHolder.setContext(null); //
            try {
                super.doFilter(req, res, chain);
            } finally {
                SecurityContextHolder.setContext(oldCtx);
            }
        }
        else {
            super.doFilter(req, res, chain);
        }
    }
    finally {
        attributes.requestCompleted();
    }
}
 
Example 20
Project: comdor   File: CorsFilter.java   Source Code and License 5 votes vote down vote up
@Override
public void doFilter(
    final ServletRequest request,
    final ServletResponse response,
    final FilterChain chain
) throws IOException, ServletException {
    ((HttpServletResponse) response).addHeader(
        "Access-Control-Allow-Origin", "*"
    );
    chain.doFilter(request, response);
}
 
Example 21
Project: 112016.pizzeria-app   File: ListerUtilisateurController.java   Source Code and License 5 votes vote down vote up
@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
		String id = req.getParameter("code");
		String check = req.getParameter("action");
		if(check.equals("supprimer"))//pour mettre un peu de securite...
			uService.supprimerUtilisateur(id);
//		doGet(req, resp);
		resp.sendRedirect(req.getContextPath() + "/admin/users/list");
	}
 
Example 22
Project: spring-backend-boilerplate   File: AuthenticationSuccessHandlerRestImpl.java   Source Code and License 5 votes vote down vote up
@Override
public void onAuthenticationSuccess(HttpServletRequest request,
									HttpServletResponse response,
									Authentication authentication) throws IOException, ServletException {
	try {
		userAuditService.saveUserAuthEvent(AuthEventHelper.buildSucceedAuthEvent(request));
	}
	catch (Throwable e) {
		//do nothing
	}
	response.setStatus(HttpServletResponse.SC_OK);
	response.getWriter().append("{\"succeed\":true}");
	response.flushBuffer();
}
 
Example 23
Project: otus_java_2017_06   File: TimerServlet.java   Source Code and License 5 votes vote down vote up
public void doGet(HttpServletRequest request,
                  HttpServletResponse response) throws ServletException, IOException {
    Map<String, Object> pageVariables = new HashMap<>();
    pageVariables.put(REFRESH_VARIABLE_NAME, String.valueOf(PERIOD_MS));
    pageVariables.put(TIME_VARIABLE_NAME, getTime());

    response.getWriter().println(TemplateProcessor.instance().getPage(TIMER_PAGE_TEMPLATE, pageVariables));

    response.setContentType("text/html;charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);
}
 
Example 24
Project: NoMoreOversleeps   File: WebServlet.java   Source Code and License 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
	String PATH = request.getPathInfo();
	if (PATH.equals("/favicon.ico"))
	{
		this.sendFavicon(response);
	}
	else if (PATH.equals("/ui/log"))
	{
		this.sendLog(response);
	}
	else if (PATH.equals("/ui/json"))
	{
		this.sendJsonState(response);
	}
	else if (PATH.equals("/ui/"))
	{
		this.sendMainPage(response);
	}
	else if (PATH.equals("/validate-captcha"))
	{
		this.sendCaptchaValidation(request, response);
	}
	else if (PATH.equals("/captcha.png"))
	{
		this.getCaptchaImage(request, response);
	}
	else if (PATH.equals("/"))
	{
		response.sendRedirect("/ui/");
	}
	else
	{
		response.sendError(HttpServletResponse.SC_NOT_FOUND);
	}
}
 
Example 25
Project: apache-tomcat-7.0.73-with-comment   File: HostManagerServlet.java   Source Code and License 5 votes vote down vote up
/**
 * Process a GET request for the specified resource.
 *
 * @param request The servlet request we are processing
 * @param response The servlet response we are creating
 *
 * @exception IOException if an input/output error occurs
 * @exception ServletException if a servlet-specified error occurs
 */
@Override
public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
    throws IOException, ServletException {

    StringManager smClient = StringManager.getManager(
            Constants.Package, request.getLocales());

    // Identify the request parameters that we need
    String command = request.getPathInfo();
    if (command == null)
        command = request.getServletPath();
    String name = request.getParameter("name");
  
    // Prepare our output writer to generate the response message
    response.setContentType("text/plain; charset=" + Constants.CHARSET);
    PrintWriter writer = response.getWriter();

    // Process the requested command
    if (command == null) {
        writer.println(sm.getString("hostManagerServlet.noCommand"));
    } else if (command.equals("/add")) {
        add(request, writer, name, false, smClient);
    } else if (command.equals("/remove")) {
        remove(writer, name, smClient);
    } else if (command.equals("/list")) {
        list(writer, smClient);
    } else if (command.equals("/start")) {
        start(writer, name, smClient);
    } else if (command.equals("/stop")) {
        stop(writer, name, smClient);
    } else {
        writer.println(sm.getString("hostManagerServlet.unknownCommand",
                                    command));
    }

    // Finish up the response
    writer.flush();
    writer.close();

}
 
Example 26
Project: java-logging   File: RequestIdsSettingFilterTest.java   Source Code and License 5 votes vote down vote up
@Test
public void sessionIdShouldBeLoggedIfTheSessionExists() throws IOException, ServletException {
    HttpServletRequest request = requestWithSessionId("some-session-id");

    filter.doFilter(request, response, (req, resp) -> {
        assertThat(MdcFields.getSessionId()).isEqualTo("some-session-id");
    });

    assertThat(MdcFields.getSessionId()).isNull();
}
 
Example 27
Project: joai-project   File: OAIHarvesterServlet.java   Source Code and License 5 votes vote down vote up
/**
 *  Handle GET requests.
 *
 * @param  req                   Input request.
 * @param  resp                  Resulting response.
 * @exception  IOException       I/O error
 * @exception  ServletException  servlet error
 */
public void doGet(
                  HttpServletRequest req,
                  HttpServletResponse resp)
	 throws IOException, ServletException {

	// Set up output writer.
	PrintWriter respwtr = resp.getWriter();
	respwtr.print(" doGet() ");
	respwtr.close();

}
 
Example 28
Project: apache-tomcat-7.0.73-with-comment   File: ApplicationDispatcher.java   Source Code and License 5 votes vote down vote up
/**
 * Prepare the request based on the filter configuration.
 * @param request The servlet request we are processing
 * @param response The servlet response we are creating
 * @param state The RD state
 *
 * @exception IOException if an input/output error occurs
 * @exception ServletException if a servlet error occurs
 */
private void processRequest(ServletRequest request, 
                            ServletResponse response,
                            State state)
    throws IOException, ServletException {
            
    DispatcherType disInt = (DispatcherType) request.getAttribute(Globals.DISPATCHER_TYPE_ATTR);
    if (disInt != null) {
        boolean doInvoke = true;
        
        if (context.getFireRequestListenersOnForwards() &&
                !context.fireRequestInitEvent(request)) {
            doInvoke = false;
        }

        if (doInvoke) {
            if (disInt != DispatcherType.ERROR) {
                state.outerRequest.setAttribute(
                        Globals.DISPATCHER_REQUEST_PATH_ATTR,
                        getCombinedPath());
                state.outerRequest.setAttribute(
                        Globals.DISPATCHER_TYPE_ATTR,
                        DispatcherType.FORWARD);
                invoke(state.outerRequest, response, state);
            } else {
                invoke(state.outerRequest, response, state);
            }
            
            if (context.getFireRequestListenersOnForwards()) {
                context.fireRequestDestroyEvent(request);
            }
        }
    }
}
 
Example 29
Project: SpringTutorial   File: ControllerServlet.java   Source Code and License 5 votes vote down vote up
private void handleHome(HttpServletRequest request,
		HttpServletResponse response) throws ServletException, IOException {

	RequestDispatcher requestDispatcher = request
			.getRequestDispatcher("bankhomepage.jsp");
	requestDispatcher.forward(request, response);

}
 
Example 30
Project: apache-tomcat-7.0.73-with-comment   File: ChatServlet.java   Source Code and License 5 votes vote down vote up
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {
    // Compatibility method: equivalent method using the regular connection model
    response.setContentType("text/html; charset=" + CHARSET);
    PrintWriter writer = response.getWriter();
    writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
    writer.println("<html><head><title>JSP Chat</title></head><body bgcolor=\"#FFFFFF\">");
    writer.println("Chat example only supports Comet processing. ");
    writer.println("Configure a connector that supports Comet and try again.");
    writer.println("</body></html>");
}
 
Example 31
Project: tbschedule-wed   File: WebInitial.java   Source Code and License 5 votes vote down vote up
public void init() throws ServletException {
	super.init();
	try {
		ConsoleManager.initial();
	} catch (Exception e) {
		throw new ServletException(e);
	}
}
 
Example 32
Project: SSMFrameBase   File: SignFilter.java   Source Code and License 5 votes vote down vote up
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
    HttpServletResponse response = (HttpServletResponse) res;
    HttpServletRequest request = (HttpServletRequest) req;
    response.setHeader("Access-Control-Allow-Origin", "*");
    response.setHeader("Access-Control-Allow-Methods", "POST,OPTIONS,GET");
    response.setHeader("Access-Control-Max-Age", "3600");
    response.setHeader("Access-Control-Allow-Headers", "accept,x-requested-with,Content-Type");
    
    if("OPTIONS".equals(request.getMethod())){
    	//状态码204表示响应成功,但是没有返回响应信息
        response.setStatus(204);
        return;
    }
    chain.doFilter(req, res);
}
 
Example 33
Project: apache-tomcat-7.0.73-with-comment   File: DuplicateMappingParamServlet.java   Source Code and License 5 votes vote down vote up
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException {
    PrintWriter out = res.getWriter();
    out.print("<p>" + getInitParameter("foo") + " "
            + getInitParameter("bar") + "</p>");
}
 
Example 34
Project: tomcat7   File: TestCorsFilter.java   Source Code and License 5 votes vote down vote up
@Test(expected = ServletException.class)
public void testDoFilterNullRequestResponse() throws IOException,
        ServletException {
    TesterHttpServletResponse response = new TesterHttpServletResponse();
    CorsFilter corsFilter = new CorsFilter();
    corsFilter.init(TesterFilterConfigs.getDefaultFilterConfig());
    corsFilter.doFilter(null, response, filterChain);
}
 
Example 35
Project: apache-tomcat-7.0.73-with-comment   File: WebdavServlet.java   Source Code and License 5 votes vote down vote up
/**
 * OPTIONS Method.
 *
 * @param req The request
 * @param resp The response
 * @throws ServletException If an error occurs
 * @throws IOException If an IO error occurs
 */
@Override
protected void doOptions(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {

    resp.addHeader("DAV", "1,2");

    StringBuilder methodsAllowed = determineMethodsAllowed(resources,
                                                          req);

    resp.addHeader("Allow", methodsAllowed.toString());
    resp.addHeader("MS-Author-Via", "DAV");

}
 
Example 36
Project: ChronoBike   File: BaseCheckServiceServlet.java   Source Code and License 5 votes vote down vote up
protected final void doPost(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException
{
    resp.setContentType("text/xml; charset=iso-8859-1");
    PrintWriter pw = resp.getWriter();
    StringBuffer errCode = new StringBuffer();
    long mtdeb = System.currentTimeMillis();
    boolean serviceStatus = getServiceStatus(req, errCode);
    long tt = System.currentTimeMillis() - mtdeb;
    String xmlRes = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
    xmlRes = xmlRes + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xdt=\"http://www.w3.org/2004/07/xpath-datatypes\" xmlns:fn=\"http://www.w3.org/2004/07/xpath-functions\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soapenv:Body><checkserviceResponse xmlns=\"http://publigroupe.com/checkservice\"><checkserviceReturn xmlns=\"\">";
    xmlRes = xmlRes + "<name xsi:type=\"xsd:string\">";
    xmlRes = xmlRes + getServiceName();
    xmlRes = xmlRes + "</name>";
    xmlRes = xmlRes + "<status xsi:type=\"xsd:string\">";
    xmlRes = xmlRes + (serviceStatus ? "ok" : "nok");
    xmlRes = xmlRes + "</status>";
    xmlRes = xmlRes + "<returnCode xsi:type=\"xsd:string\">";
    xmlRes = xmlRes + errCode.toString();
    xmlRes = xmlRes + "</returnCode>";
    xmlRes = xmlRes + "<time_ms xsi:type=\"xsd:string\">";
    xmlRes = xmlRes + String.valueOf(tt);
    xmlRes = xmlRes + "</time_ms>";
    xmlRes = xmlRes + "</checkserviceReturn></checkserviceResponse></soapenv:Body></soapenv:Envelope>";
    pw.print(xmlRes);
    info(getServiceName(), serviceStatus, errCode.toString(), tt);
}
 
Example 37
Project: parabuild-ci   File: TestSampleServletConfig.java   Source Code and License 5 votes vote down vote up
/**
 * Verify that we can unit test a servlet that makes calls to
 * <code>getServletConfig()</code>, <code>getServletContext()</code>,
 * <code>log()</code>, ... (i.e. methods inherited from
 * <code>GenericServlet</code>).
 */
public void testServletConfig() throws ServletException
{
    SampleServletConfig servlet = new SampleServletConfig();

    // VERY IMPORTANT : Call the init() method in order to initialize the
    //                  Servlet ServletConfig object.
    servlet.init(config);

    assertEquals("value1 used for testing", servlet.getConfigData());
}
 
Example 38
Project: tomcat7   File: TestInternalInputBuffer.java   Source Code and License 5 votes vote down vote up
/**
 * Only interested in the request headers from a GET request
 */
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {
    // Just echo the header value back as plain text
    resp.setContentType("text/plain");

    PrintWriter out = resp.getWriter();

    processHeaders(invalidHeaderName, req, out);
    processHeaders("X-Bug51557", req, out);
}
 
Example 39
Project: apache-tomcat-7.0.73-with-comment   File: TestStandardWrapper.java   Source Code and License 5 votes vote down vote up
@Override
public void onStartup(Set<Class<?>> c, ServletContext ctx)
        throws ServletException {
    Servlet s;

    if (createServlet) {
        s = ctx.createServlet(servlet.getClass());
    } else {
        s = servlet;
    }
    ServletRegistration.Dynamic r = ctx.addServlet("servlet", s);
    r.addMapping("/");
}
 
Example 40
Project: tomcat7   File: TestResponse.java   Source Code and License 5 votes vote down vote up
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {
    HttpSession session = req.getSession(true);
    session.invalidate();
    req.getSession(true);
}
 
Example 41
Project: otus_java_2017_06   File: TimerServlet.java   Source Code and License 5 votes vote down vote up
public void doGet(HttpServletRequest request,
                  HttpServletResponse response) throws ServletException, IOException {
    Map<String, Object> pageVariables = new HashMap<>();
    pageVariables.put(REFRESH_VARIABLE_NAME, String.valueOf(PERIOD_MS));
    pageVariables.put(TIME_VARIABLE_NAME, getTime());

    response.getWriter().println(TemplateProcessor.instance().getPage(TIMER_PAGE_TEMPLATE, pageVariables));

    response.setContentType("text/html;charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);
}
 
Example 42
Project: bxbot-ui-server   File: JwtAuthenticationFilter.java   Source Code and License 5 votes vote down vote up
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
        throws ServletException, IOException {

    try {

        // Extract token after Bearer prefix if present
        String authorizationHeader = request.getHeader(AUTHORIZATION_HEADER);
        if (authorizationHeader != null && authorizationHeader.startsWith(BEARER_PREFIX)) {
            authorizationHeader = authorizationHeader.substring(BEARER_PREFIX_LENGTH);
        }

        // Might be null if client does not have a token yet
        if (authorizationHeader != null) {

            final Claims claims = jwtUtils.validateTokenAndGetClaims(authorizationHeader);
            final String username = jwtUtils.getUsernameFromTokenClaims(claims);
            LOG.info(() -> "Username in JWT: " + username);

            if (SecurityContextHolder.getContext().getAuthentication() == null) {

                // It is not compulsory to load the User details from the database.
                // We can just use the information in the token claims - this saves a repo lookup.
                //
                // final UserDetails userDetails = userDetailsService.loadUserByUsername(username);
                // if (userDetails != null && !(userDetails.getUsername().equals(username))) {
                //    final String errorMsg = "Username is token not found in User repository! Token username: " + username;
                //    throw new JwtAuthenticationException(errorMsg);
                // }

                LOG.info(() -> "JWT is valid");

                // final UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
                //        userDetails, null, userDetails.getAuthorities());
                final UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
                        username, null, jwtUtils.getRolesFromTokenClaims(claims));

                authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
                SecurityContextHolder.getContext().setAuthentication(authentication);

                LOG.info(() -> "Authenticated User: " + username + " has been set in Spring SecurityContext.");
            }
        }

        chain.doFilter(request, response);

    } catch (Exception e) {
        LOG.error("JWT Authentication failure! Details: " + e.getMessage(), e);
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
    }
}
 
Example 43
Project: TakeoutService   File: PayServlet.java   Source Code and License 5 votes vote down vote up
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
	Response res = new Response();
	String orderId = request.getParameter("orderId");
	
	if(StringUtils.isNotBlank(orderId)){
		OrderOverviewResponse orderOverviewResponse = new OrderOverviewResponse();
		orderOverviewResponse.payDownTime = 15;
		orderOverviewResponse.money=50.0f;
		orderOverviewResponse.paymentInfo = new ArrayList<>();
		
		// 支付宝,微信
		Payment zfb = new Payment();
		zfb.id = 1;
		zfb.name = "支付宝";
		zfb.url = ConstantValue.HOST+"/TakeoutService/imgs/payment/zfb.png";
		orderOverviewResponse.paymentInfo.add(zfb);

		Payment wx = new Payment();
		wx.id = 2;
		wx.name = "微信支付";
		wx.url = ConstantValue.HOST+"/TakeoutService/imgs/payment/wx.png";
		orderOverviewResponse.paymentInfo.add(wx);

	
		res.setCode("0");

		res.setData(JSON.toJSONString(orderOverviewResponse));

		CommonUtil.renderJson(response, res);
	}else {
		res.setCode("-1");
		res.setData("");
	}

	CommonUtil.renderJson(response, res);
}
 
Example 44
Project: AEM   File: ComponentContentModelToJSONServlet.java   Source Code and License 5 votes vote down vote up
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
        throws ServletException, IOException {
    PrintWriter out = response.getWriter();

    try {
        Resource resource = request.getResource();
        if (resource != null && configurationProvider.hasConfig(resource.getResourceType())) {
            JSONObject filteredContentMap = new JSONObject();
            TemplateContentModel templateContentModel = (TemplateContentModel) contentModelFactoryService.getContentModel(request, response);

            boolean clientAccessible =  (Boolean) templateContentModel.get(CONFIG_PROPERTIES_KEY + DOT + XK_CLIENT_ACCESSIBLE_CP);
            if (clientAccessible) {
                // get list of contexts
                Configuration configuration = configurationProvider.getFor(resource.getResourceType());
                Collection<String> props = configuration.asStrings(XK_CLIENT_MODEL_PROPERTIES_CP, Mode.MERGE);
                String[] contexts = props.toArray(new String[0]);

                // get content model json with the XK_CLIENT_MODEL_PROPERTIES_CP contexts
                filteredContentMap = templateContentModel.toJSONObject(contexts);

                // add component id
                String componentContentId = DigestUtils.md5Hex(resource.getPath());
                filteredContentMap.put(XK_CONTENT_ID_CP, componentContentId);
            }
            out.write(JSONObject.toJSONString(filteredContentMap));
        } else {
            out.write(new JSONObject().toJSONString());
        }
    } catch (Exception ew) {
        throw new ServletException(ew);
    }
}
 
Example 45
Project: fish-admin   File: JWTAuthenticationFilter.java   Source Code and License 5 votes vote down vote up
@Override
public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain filterChain)
        throws IOException, ServletException {
    Authentication authentication = TokenAuthenticationService
            .getAuthentication((HttpServletRequest)request);

    SecurityContextHolder.getContext().setAuthentication(authentication);
    filterChain.doFilter(request,response);
}
 
Example 46
Project: EARLGREY   File: AdminApi.java   Source Code and License 4 votes vote down vote up
/**
 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	// TODO Auto-generated method stub
	Gear engine = new Gear(request,response);
	engine.post(true);
}
 
Example 47
Project: lams   File: MonitoringAction.java   Source Code and License 4 votes vote down vote up
@Override
   public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException, JSONException {
request.setAttribute("initialTabId", WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true));

String param = mapping.getParameter();
if (param.equals("summary")) {
    return summary(mapping, form, request, response);
}
if (param.equals("userMasterDetail")) {
    return userMasterDetail(mapping, form, request, response);
}
if (param.equals("questionSummary")) {
    return questionSummary(mapping, form, request, response);
}
if (param.equals("userSummary")) {
    return userSummary(mapping, form, request, response);
}
if (param.equals("saveUserGrade")) {
    return saveUserGrade(mapping, form, request, response);
}
if (param.equals("setSubmissionDeadline")) {
    return setSubmissionDeadline(mapping, form, request, response);
}
if (param.equals("setActivityEvaluation")) {
    return setActivityEvaluation(mapping, form, request, response);
}
if (param.equals("getUsers")) {
    return getUsers(mapping, form, request, response);
}
if (param.equals("getUsersByQuestion")) {
    return getUsersByQuestion(mapping, form, request, response);
}
if (param.equals("exportSummary")) {
    return exportSummary(mapping, form, request, response);
}
if (param.equals("getMarkChartData")) {
    return getMarkChartData(mapping, form, request, response);
}
if (param.equals("statistic")) {
    return statistic(mapping, form, request, response);
}

return mapping.findForward(AssessmentConstants.ERROR);
   }
 
Example 48
Project: lams   File: LearningAction.java   Source Code and License 4 votes vote down vote up
public ActionForward viewAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException {
VoteUtils.cleanUpUserExceptions(request);
VoteLearningForm voteLearningForm = (VoteLearningForm) form;
VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO();

voteLearningForm.setNominationsSubmited(new Boolean(false).toString());
voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString());
voteLearningForm.setMinNominationCountReached(new Boolean(false).toString());

voteGeneralLearnerFlowDTO.setNominationsSubmited(new Boolean(false).toString());
voteGeneralLearnerFlowDTO.setMaxNominationCountReached(new Boolean(false).toString());
voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString());

IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext());
repopulateRequestParameters(request, voteLearningForm);

String toolSessionID = request.getParameter(TOOL_SESSION_ID);
logger.info("Tool session ID" + toolSessionID);
voteLearningForm.setToolSessionID(toolSessionID);

String userID = request.getParameter(USER_ID);
voteLearningForm.setUserID(userID);

VoteSession voteSession = voteService.getSessionBySessionId(new Long(toolSessionID));
VoteContent voteContent = voteSession.getVoteContent();

voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle());
voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions());

Long toolContentID = voteContent.getVoteContentId();

Long toolSessionUid = voteSession.getUid();

VoteQueUsr existingVoteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid());

existingVoteQueUsr.setFinalScreenRequested(true);
voteService.updateVoteUser(existingVoteQueUsr);

Set<String> userAttempts = voteService.getAttemptsForUserAndSession(existingVoteQueUsr.getUid(),
	toolSessionUid);
request.setAttribute(LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts);

voteService.prepareChartData(request, toolContentID, toolSessionUid, voteGeneralLearnerFlowDTO);

voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString());
//String reflectionSubject = VoteUtils.replaceNewLines(voteContent.getReflectionSubject());
voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject());

voteLearningForm.resetCommands();

request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO);

LearningWebUtil.putActivityPositionInRequestByToolSessionId(new Long(toolSessionID), request,
	getServlet().getServletContext());

return (mapping.findForward(ALL_NOMINATIONS));
   }
 
Example 49
Project: mm-system-2017   File: GetMenteeById.java   Source Code and License 4 votes vote down vote up
/**
 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	doGet(request,response);
}
 
Example 50
Project: lams   File: JspServlet.java   Source Code and License 4 votes vote down vote up
private void serviceJspFile(HttpServletRequest request,
                            HttpServletResponse response, String jspUri,
                            Throwable exception, boolean precompile)
    throws ServletException, IOException {

    JspServletWrapper wrapper =
        (JspServletWrapper) rctxt.getWrapper(jspUri);
    if (wrapper == null) {
        synchronized(this) {
            wrapper = (JspServletWrapper) rctxt.getWrapper(jspUri);
            if (wrapper == null) {
                // Check if the requested JSP page exists, to avoid
                // creating unnecessary directories and files.
                if (null == context.getResource(jspUri)) {
                    String includeRequestUri = (String)
                    request.getAttribute(
                            "javax.servlet.include.request_uri");
                    if (includeRequestUri != null) {
                        // This file was included. Throw an exception as
                        // a response.sendError() will be ignored
                        String msg = Localizer.getMessage("jsp.error.file.not.found", jspUri);
                        // Strictly, filtering this is an application
                        // responsibility but just in case...
                        throw new ServletException(SecurityUtil.filter(msg));
                    } else {
                        try {
                            response.sendError(
                                    HttpServletResponse.SC_NOT_FOUND,
                                    request.getRequestURI());
                        } catch (IllegalStateException ise) {
                            log.error(Localizer.getMessage(
                                    "jsp.error.file.not.found",
                                    jspUri));
                        }
                    }
                    return;
                }
                boolean isErrorPage = exception != null;
                wrapper = new JspServletWrapper(config, options, jspUri,
                                                isErrorPage, rctxt);
                rctxt.addWrapper(jspUri,wrapper);
            }
        }
    }

    wrapper.service(request, response, precompile);

}
 
Example 51
Project: full-javaee-app   File: LogoutServlet.java   Source Code and License 4 votes vote down vote up
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	response.setHeader("Cache-Control", "no-cache, no-store");
	response.setHeader("Pragma", "no-cache");
	request.getSession().invalidate();
	response.sendRedirect("http://www.workamerica.co");
}
 
Example 52
Project: DrugStoreManagement   File: LoginServlet.java   Source Code and License 4 votes vote down vote up
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
	doPost(request,response);
}
 
Example 53
Project: apache-tomcat-7.0.73-with-comment   File: TestErrorReportValve.java   Source Code and License 4 votes vote down vote up
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {
    resp.sendError(ERROR_STATUS, ERROR_MESSAGE);
}
 
Example 54
Project: apache-tomcat-7.0.73-with-comment   File: RequestInfoExample.java   Source Code and License 4 votes vote down vote up
@Override
public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
    throws IOException, ServletException
{
    response.setContentType("text/html");

    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");

    String title = RB.getString("requestinfo.title");
    out.println("<title>" + title + "</title>");
    out.println("</head>");
    out.println("<body bgcolor=\"white\">");

    // img stuff not req'd for source code html showing
    // all links relative!

    // XXX
    // making these absolute till we work out the
    // addition of a PathInfo issue

    out.println("<a href=\"../reqinfo.html\">");
    out.println("<img src=\"../images/code.gif\" height=24 " +
                "width=24 align=right border=0 alt=\"view code\"></a>");
    out.println("<a href=\"../index.html\">");
    out.println("<img src=\"../images/return.gif\" height=24 " +
                "width=24 align=right border=0 alt=\"return\"></a>");

    out.println("<h3>" + title + "</h3>");
    out.println("<table border=0><tr><td>");
    out.println(RB.getString("requestinfo.label.method"));
    out.println("</td><td>");
    out.println(HTMLFilter.filter(request.getMethod()));
    out.println("</td></tr><tr><td>");
    out.println(RB.getString("requestinfo.label.requesturi"));
    out.println("</td><td>");
    out.println(HTMLFilter.filter(request.getRequestURI()));
    out.println("</td></tr><tr><td>");
    out.println(RB.getString("requestinfo.label.protocol"));
    out.println("</td><td>");
    out.println(HTMLFilter.filter(request.getProtocol()));
    out.println("</td></tr><tr><td>");
    out.println(RB.getString("requestinfo.label.pathinfo"));
    out.println("</td><td>");
    out.println(HTMLFilter.filter(request.getPathInfo()));
    out.println("</td></tr><tr><td>");
    out.println(RB.getString("requestinfo.label.remoteaddr"));
    out.println("</td><td>");
    out.println(HTMLFilter.filter(request.getRemoteAddr()));
    out.println("</td></tr>");

    String cipherSuite=
            (String)request.getAttribute("javax.servlet.request.cipher_suite");
    if(cipherSuite!=null){
        out.println("<tr><td>");
        out.println("SSLCipherSuite:");
        out.println("</td><td>");
        out.println(HTMLFilter.filter(cipherSuite));
        out.println("</td></tr>");
    }

    out.println("</table>");
}
 
Example 55
Project: SimpleController   File: TotalController.java   Source Code and License 4 votes vote down vote up
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    doGet(request, response);
}
 
Example 56
Project: ChemistryAdministrativePortal   File: FacultyServlet.java   Source Code and License 4 votes vote down vote up
/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	// TODO Auto-generated method stub
	doPost(request,response);
}
 
Example 57
Project: convertigo-engine   File: GenericServlet.java   Source Code and License 4 votes vote down vote up
@Override
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException {
	doRequest(request, response);
}
 
Example 58
Project: tomcat7   File: TesterHttpServletRequest.java   Source Code and License 4 votes vote down vote up
@Override
public Part getPart(String name) throws IOException, ServletException {
    throw new RuntimeException("Not implemented");
}
 
Example 59
Project: full-javaee-app   File: FacebookSignupServlet.java   Source Code and License 4 votes vote down vote up
protected void doPost(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
	doGet(request, response);
}
 
Example 60
Project: lams   File: MonitoringAction.java   Source Code and License 4 votes vote down vote up
/**
    * Remove the original file created by the learner. Does not actually remove it from the content repository - merely
    * makes it as removed.
    */
   public ActionForward restoreLearnerFile(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws ServletException {
return removeRestoreLearnerFile(mapping, form, request, response, false);
   }