org.appops.service.client.handler.WebClientHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appops-br-service-base Show documentation
Show all versions of appops-br-service-base Show documentation
appops black rhino service base
/*
* AppOps is a Java framework to develop, deploy microservices with ease and is available for free
* and common use developed by AinoSoft ( www.ainosoft.com )
*
* AppOps and AinoSoft are registered trademarks of Aino Softwares private limited, India.
*
* Copyright (C) <2016>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version along with applicable additional terms as
* provisioned by GPL 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License and applicable additional terms
* along with this program.
*
* If not, see and
*/
package org.appops.service.client.handler;
import com.google.inject.Inject;
import javax.servlet.http.HttpSession;
import org.appops.service.client.WebClientResponse;
/**
* handles the operations if the client is of type web.
*
* @author [email protected]
* @version $Id: $Id
*/
public class WebClientHandler implements ClientHandler {
private HttpSession session;
/** {@inheritDoc} */
@Override
public Object constructResult(Object result) {
String redirectUrl = (String) session.getAttribute("redirectUrl");
if (redirectUrl != null && !redirectUrl.isEmpty()) {
WebClientResponse responseClient = new WebClientResponse(result, redirectUrl);
session.removeAttribute("redirectUrl");
return responseClient;
} else {
return result;
}
}
/**
*
* Getter for the field session
.
*
*
* @return a {@link javax.servlet.http.HttpSession} object.
*/
public HttpSession getSession() {
return session;
}
/**
*
* Setter for the field session
.
*
*
* @param session a {@link javax.servlet.http.HttpSession} object.
*/
@Inject
public void setSession(HttpSession session) {
this.session = session;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy