How to Integrate phonegap(client) with servlet(server) - ajax

using ajax how I integrate phonegap with servlet,if it is possible means what I have mentioned in URL
already I try this but server error is occured

Thanks very much for your reply,i find solution here I post my code it may useful for others
Servlet(server side):
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
Connection con = null;
ResultSet resultSet = null;
String uname = request.getParameter("uname");
String pwd = request.getParameter("pwd");
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:mysql://localhost/ROSE";
final String USER = "root";
final String PASS = "root";
con = DriverManager.getConnection(url,USER,PASS);
String query = null;
query = "SELECT uname,pwd from roobi";
PreparedStatement statement = con.prepareStatement(query);
resultSet = statement.executeQuery();
String db_uname="";
String db_pwd="";
while (resultSet.next()) {
db_uname = resultSet.getString("uname")
db_pwd = resultSet.getString("pwd");
if( (uname.equals(db_uname)) && (pwd.equals(db_pwd))){
out.write("SUCCESS");
} }
} catch (Exception e) {
e.printStackTrace();
} finally {
out.close();
} } }
Phonegap(client side)
<script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script>
<script>
function verifyLogin(){
var uname=document.getElementById("txt_username").value;
var pwd=document.getElementById("txt_pwd").value;
$.support.cors = true;
$.ajax({
type : 'POST',
url : 'http://10.0.2.2:8080/sam/Jdbc', // Servlet URL
data:{
uname:uname,
pwd:pwd,
},
success : function(data) {
if("SUCCESS"==data){
alert("Login Success!!");
} else {
alert("Invalid Login!!");
}
},
error: function (xhr, ajaxOptions, thrownError)
{
alert("errorstatus: " + xhr.status + " ajaxoptions: " + ajaxOptions + " throwError: " + thrownError);
}
});
}
</script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="content" id="input_login">
<ul data-role="listview" data-divider-theme="b" data-inset="true">
<li data-role="list-divider" role="heading">User Name</li>
<li data-role="list-divider" >
<input type="text" id="txt_username"/></li>
<li data-role="list-divider" role="heading">
Password
</li>
<li data-role="list-divider" >
<input type="password" id="txt_pwd"/>
</li>
<li data-role="list-divider" >
<input type="button" id="btn_login" value="Login" onclick="verifyLogin()"/>
</li>
</ul>
</div>
</div>
</body>

Related

i want to convert my gridview table into pdf

**when i tried to convert my grid-view data into PDF i got null reference exception grid-view header row but data is available in grid view.please help me to solve this error. i am using asp.net web API in this.. and i tried to on another grid-view to bind data..it shows same error null reference exception but when i tried on direct button click it works fine..only it shows error when i tried on using web API..please help me to solve this
i have attached my programming below data load and bind
public void GetData()
{
string conn = ConfigurationManager.ConnectionStrings["con"].ToString();
SqlConnection con = new SqlConnection(conn);
con.Open();
SqlCommand cmd = new SqlCommand("select * from api", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "api");
//DataTable dta = new DataTable();
//dta = ds.Tables["api"];
//da.Fill(dta);
GridView2.DataSource = ds;
GridView2.DataBind();
}
convert to pdf
public string Button3_Click()
{
PdfPTable pdfTable = new PdfPTable(GridView2.HeaderRow.Cells.Count);
foreach (TableCell headercell in GridView2.HeaderRow.Cells)
{
iTextSharp.text.Font font = new iTextSharp.text.Font();
font.Color = new Basecolor(GridView2.HeaderRow.ForeColor);
PdfPCell pdfcell = new PdfPCell(new Phrase(headercell.Text, font));
pdfcell.BackgroundColor = new Basecolor(GridView2.HeaderStyle.BackColor);
pdfTable.AddCell(pdfcell);
}
foreach (GridViewRow gridviewrow in GridView2.Rows)
{
foreach (TableCell tablecell in gridviewrow.Cells)
{
iTextSharp.text.Font font = new iTextSharp.text.Font();
font.Color = new Basecolor(GridView2.RowStyle.ForeColor);
PdfPCell pdfcell = new PdfPCell(new Phrase(tablecell.Text));
pdfcell.BackgroundColor = new Basecolor(GridView2.RowStyle.BackColor);
pdfTable.AddCell(pdfcell);
}
}
Document pdfdoc = new Document(PageSize.A4, 10f, 10f, 10f, 10f);
PdfWriter.GetInstance(pdfdoc, Response.OutputStream);
pdfdoc.Open();
pdfdoc.Add(pdfTable);
pdfdoc.Close();
Response.ContentType = "application/pdf";
Response.AppendHeader("content-disposition", "attachment;filename=Employyes.pdf");
Response.Write(pdfdoc);
Response.Flush();
Response.End();
return "success";
}
ajax function call
$(document).ready(function () {
$("#Button2").click(function () {
alert("ajax call");
$.ajax
({
method: "GET",
url: "api/Employees",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert("success");
},
error: function (responce) {
alert("error");
},
});
});
});
<asp:Button ID="Button1" runat="server" Style="width: 136px" Text="Export to Excel" Width="175px" />&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<asp:Button ID="Button2" runat="server" Text="Export to PDF" Width="175px" />
<br />
<br />
<div class="auto-style1" id="NewData">
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="true">
</asp:GridView>
</div>
here is my controller class
public class EmployeesController : ApiController
{
// success s = new success();
BusinessLogicLayer bal = new BusinessLogicLayer();
public string Get(string username, string password)
{
return bal.login(username, password);
}
[System.Web.Mvc.HttpPost]
public string POST(string firstname, string lastname, string username, string password, string email)
{
return bal.Register(firstname, lastname, username, password, email);
}
[System.Web.Http.HttpGet]
public string buttonclick()
{
// MessageBox.Show("come");
return bal.ExportConvert();
}
here is my business logic layer class method
public string ExportConvert()
{
success s = new success();
return s.Button3_Click();
}[enter image description here][1]
here my login page code
**<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
</head>
<body style="padding-top:20px;">
<div class="col-md-10 col-md-offset-1">
<div class="well">
<table class="table table-bordered">
<thead>
<tr class="success">
<th colspan="2">
Existing User Login
<a class="btn btn-success pull-right" href="Registration.html">Register</a>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>UserName</td>
<td>
<input type="text" id="username" placeholder="username"/>
</td>
</tr>
<tr>
<td>Password</td>
<td>
<input type="password" id="password" placeholder="Password" />
</td>
</tr>
<tr class="success">
<td colspan="2">
<input type="button" id="btnlogin" class="btn btn-success" value="login" />
</td>
</tr>
</tbody>
</table>
<div class="modal fade" tabindex="-1" id="successmodel"
data-keyboard="false" data-backdrop="static">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal">
×
</button>
<h4>Success</h4>
</div>
<div class="modal-body">
<h2>Registraton success</h2>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-success">
Close
</button>
</div>
</div>
</div>
</div>
<div id="divError" class="alert alert-danger collapse">
<a id="linkClose" class="close" href="#" >×</a>
<div id="divErrorText"></div>
</div>
</div>
<script src="Scripts/jquery-1.10.2.min.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<script type="text/javascript" >
$(document).ready(function () {
$('#linkClose').click(function () {
$('divError').hide('fade');
})
});
$('#btnlogin').click(function () {
$.ajax({
url: '/api/Employees/?username=' + $("#username").val() + '&password=' + $("#password").val(),
method: 'Get',
contentType: 'application/json',
data: { id: 1 },
dataType: 'json',
success: function (data) {
console.log(data);
//var data = data.d;
//alert("success " + data);
if (data == 'success') {
window.location = "/success.aspx";
}
else {
alert("Wrong Username and Password");
}
/* if (data != null) {
$.each(data, function (i, obj) {
var c = new WorkflowsEntity(data[i]); //logic
self.WorkflowList.push;
});
alert("success");
//window.location.href = "/success.html";
}*/
},
error: function (jqXHR, textStatus, errorThrown) {
alert(" un correct username password ");
$('#divErrorText').text(jqXHR.responceText);
$('#divError').show('fade');
}
});
});
</script>
</body>
</html>**

How to pass #ModelAttribtue to Controller and call POST method to insert the data in spring mvc using ajax call

I am using jstl and I need to get back the id upon insertion to jsp from controller. To achieve that I am using ajax and I am unable to pass the modelAttribute of the form.
JSP
<form:form method="POST" action="addCountry.html" name="form" modelAttribute="countryMaster" id="addCountryForm">
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group has-feedback" id="countryNameDiv">
<form:label path="countryName" for="countryName">Country Name</form:label>
<form:input placeholder="Enter country Name" path="countryName"
class="form-control" name="countryName"
value="${countryMaster.countryName}" required="true"
data-error="country Name cannot be empty" />
<form:errors path="countryName" cssClass="text-red" />
<div class="help-block with-errors"></div>
</div>
</div>
</div>
</div>
<div class="box-footer">
<form:button type="button" onclick="window.location.reload()" class="btn pull-left btn-primary">Clear</form:button>
<div class="pull-right">
<button onclick="submitTheForm()" class="btn btn-primary">Add Country</button>
Cancel
</div>
</div>
</form:form>
AJAX
function submitTheForm(){
var value = $("#addCountryForm").serialize();
$.ajax({
type : "post",
url : 'addSaveCountry.html',
dataType: "json"
data : {
countryMaster : value
},
success: function(result){
console.log(result);
if(resule.localeCompare("Some exception occured, try again.") == 0) {
/**
* Give a div where you display this message
**/
} else if(result.localeCompare("New Country Inserted")) {
var alert = "<div class=\"alert alert-success alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">x</span>";
alert += "</button>";
alert += "<strong>"+result+"!</strong>";
alert += "</div>";
var informationDiv = alert + "<br>";
document.getElementById("informationDiv").innerHTML = informationDiv;
} else {
var alert = "<div class=\"alert alert-success alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">x</span>";
alert += "</button>";
alert += "<strong>"+result+"!</strong>";
alert += "</div>";
var informationDiv = alert + "<br>";
document.getElementById("informationDiv").innerHTML = informationDiv;
}
}
});}
Controller Code
#RequestMapping(value="/addSaveCountry", method = RequestMethod.POST)
public #ResponseBody String addCountryPost(#Validated #ModelAttribute("countryMaster") Country country, BindingResult result){
try {
if (result.hasErrors()) {
Gson gson = new Gson();
String json = gson.toJson("Some exception occured, try again.");
return json;
}
int companyId = 1;
country.setCompanyId(companyId);
String createdBy, lastUpdatedBy;
createdBy = "IN129";
lastUpdatedBy = "IN129";
country.setCreatedBy(createdBy);
country.setLastUpdatedBy(lastUpdatedBy);
java.sql.Timestamp curTime = new java.sql.Timestamp(new java.util.Date().getTime());
country.setCreatedDate(curTime);
country.setLastUpdatedDate(curTime);
boolean status = countryService.addorupdateCountry(country);
if (status == true) {
Gson gson = new Gson();
String json = gson.toJson("New Country Inserted");
return json;
} else {
Gson gson = new Gson();
String json = gson.toJson("New Country Insertion Failed, Try Again Later");
return json;
}
}}
When I run it and try to insert, I am getting
"HTTP Status 405 - Request method 'POST' not supported"
message - Request method POST not supported
description - The specified HTTP method is not allowed for the requested resource.
Thanks in advance.
Change your URL from html suffix :
url : 'addSaveCountry.html',
To Path of RequestMapping
url : '/addSaveCountry',
also change to type: "POST" (uppercase)

How to delete multiple rows of database using ajax and spring mvc

I want to delete multiples rows using ajax and spring mvc but it always delete just one row.
//code controller
#RequestMapping(value = "/rmvclientserviceajax", method = RequestMethod.POST)
#ResponseBody
public void rmvclintServiceajax (HttpServletRequest request, Model model)
{
for(String serviceID: request.getParameterValues("idService"))
{ Long clientID = (long) Integer.parseInt(request.getParameter("idClient"));
metiersr.deleteClientToService(clientID,(long) Integer.parseInt(serviceID));}
}
//code js
function AjaxPostdelete() {
if ($('#idService').prop('checked')) {
var idService = $('#idService').val();
var idClient = $('#idClient').val();
$.ajax({
type : "POST",
url : "/cp/client/rmvclientserviceajax",
data : "idClient=" + idClient + "&idService=" + idService,
success : function(response) {
{
{
}
}
// code html
<form>
<ul class="liste_servch">
<input type="hidden" id="idClient" value="${client.idPersonne}" />
<c:forEach items="${listservclt}" var="servclt">
<li>
<input id="idService" type="checkbox" value="${servclt.idService}" />
<c:out value="${servclt.nomService}" />
</li>
</c:forEach>
</ul>
<input type="button" value="supp" onclick="AjaxPostdelete() ">
</form>
Try following;)
function AjaxPostdelete() {
var idServiceObjs = $('input[id=idService]');
var idServices = [];
for (var i = 0; i < idServiceObjs.length; i++) {
if(idServiceObjs[i].prop('checked')) {
idServices.push(idServiceObjs[i].value);
}
}
var idClient = $('#idClient').val();
$.ajax({
type : "POST",
url : "/cp/client/rmvclientserviceajax",
data : {idClient:idClient,idService:idServices},
success : function(response) {
}
}
}

Ajax each function response is blank

I am doing search a product example using spring and ajax.I try to display the result using each function in a table. But getting blank response with headings being displayed. On firebug response field shows [].
Controller
#RequestMapping(value="searchproduct", method=RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
public #ResponseBody List<Product> searchProduct(#RequestBody #RequestParam(required=false, defaultValue="productName") String productName,
Map model) {
List<Product> productResults = productService.searchProductByName(productName);
return productResults;
}
DAOImpl
public List<Product> searchProductByName(String productName) {
Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Product.class);
criteria.add(Restrictions.ilike("productName", "%"+productName+"%"));
return criteria.list();
}
ServiceImpl
#Transactional
public List<Product> searchProductByName(String productName) {
return productDAO.searchProductByName(productName);
}
JSP
<script type="text/javascript">
$(document).ready(function() {
$('#searchForm').submit(function(event) {
var productName = $('#productName').val();
var json = { "productName" : productName };
$.ajax({
url: $("#searchForm").attr( "action"),
data: JSON.stringify(json),
type: "POST",
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json");
},
success: function(productResults) {
$('#searchTable').
append("<thead><tr><th>Product Name</th><th>Price</th></tr></thead>");
$('#searchTable').append("<tbody>");
var tableContent = "";
$(productResults).each(function(index, product){
tableContent +=
'<tr><td> ' +
product.productName+' </td><td> ' +
product.price+' </td></tr>';
});
$('#searchTable').append(tableContent);
$('#searchTable').append("</tbody>");
}
});
event.preventDefault();
});
});
</script>
<form id="searchForm" action="searchproduct.json" >
Product Name: <input type="text" name="productName" value="${product.productName}"
id="productName" />
<input type="submit" value="Search" />
</form>
<div id="formResponse">
<table id="searchTable">
</table>
</div>

Form Sumbit action resulting into get request

I have simple form where on click of accpet button which of type resulting into GET requet rather than POST request. This is causing display of page twice and weired thing is form does generates POST request when you click on accept button again. This is mostly happening on IE8 and Chrome.
Current configuration :
<%#taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%#taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%# taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%# taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<title><spring:theme code="company"/><spring:theme code="title.companySetup.terms&conditions"></spring:theme></title>
<%-- <title><spring:message code="userRegistration.addNewEmployer.title"></spring:message></title> --%>
<!-- CONTENT START -->
<div class="canvasWrapper">
<div class="canvas" role="main">
<div class="contentWrapper clearfix">
<c:choose>
<c:when test="${whitelabellingfolder == 'ABC'}">
<h1>Welcome to </h1>
</c:when>
<c:when test="${whitelabellingfolder == 'PQR'}">
<h1 style="color:#6a2c91">Welcome to <i style="color:#6a2c91">BOND</i></h1>
</c:when>
<c:when test="${whitelabellingfolder == 'XYZ'}">
<h1>Welcome to </h1>
</c:when>
<c:when test="${whitelabellingfolder == 'LMN'}">
<h1>Welcome to </h1>
</c:when>
<c:when test="${whitelabellingfolder == 'QWE'}">
<h1>Welcome to </h1>
</c:when>
<c:when test="${whitelabellingfolder == 'POI'}">
<h1>Welcome to </h1>
</c:when>
<c:otherwise>
<h1>Welcome to Nothing</h1>
</c:otherwise>
</c:choose>
<h2>Terms and Conditions</h2>
<spring:message code="${whitelabellingfolder}.termsAndContion.body"></spring:message>
<form:form method="Post" commandName="userForm" >
<form:errors path="*" cssClass="formError" element="div" />
<div class="ruler"></div>
<div class="navHolder clearfix">
<!-- <script type="text/javascript">
document.write('<div class="floatLeft"><input type="button" class="btnBlue" value="Print this page" onClick="window.print()"></div>');
</script> -->
<div class="floatRight"><input class="btnBlue" name="accpet" type="submit" value="Accept" /></div>
<div class="floatRight"><input class="btnBlue" name="decline" type="submit" value="Decline" /></div>
</div>
</form:form>
</div>
</div>
</div>
<!-- CONTENT END -->
<!-- FOOTER START -->
<div class="footerWrapper2">
<div class="footerCanvasWrapper">
<div class="footerCanvas">
</div>
<div class="footerLinks">
</div>
</div>
</div>
<!-- FOOTER END -->
Controller----
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.theme.SessionThemeResolver;
import org.springframework.web.util.WebUtils;
#Controller
#RequestMapping("/TNC.html")
public class TNCControllerAnn {
private String className = "TNCControllerAnn";
#Autowired
private AppService appService;
#RequestMapping(method = RequestMethod.GET)
public String formbacking(#RequestHeader(value="Accept") String accept,
#RequestHeader(value="Accept-Language") String acceptLanguage,
#RequestHeader(value="User-Agent", defaultValue="foo") String userAgent,HttpServletRequest request,
HttpServletResponse response) {
CMULogger.enter(className, "formBackingObject >> In the get method");
String employerID = request.getHeader(UIConstant.EMP_ID);
CMULogger.debug(className, " ** employerID: " + employerID);
request.getSession().setAttribute(UIConstant.SELECTED_MODULE, "tnc");
String requestURL = request.getRequestURL().toString();
if (!requestURL.endsWith("/")) {
requestURL = requestURL.concat("/");
}
request.getSession().setAttribute(GlobalConstants.REQUEST_URL, requestURL);
CMULogger.debug(className, " ** Request_URL: " + request.getSession().getAttribute(GlobalConstants.REQUEST_URL));
ServiceContext serviceContext = new ServiceContext();
UserContext userContext = new UserContext(employerID, "", "", "", "", "", "", "", "");
serviceContext.setUserContext(userContext);
RegistrationSetupAppResponse appResponse = null;
try {
appResponse = registrationAppService.getThemeChange(serviceContext);
} catch (ApplicationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
AdviserDTO adviserDTO = appResponse.getAdviserDTO();
String companyAgencyCode = adviserDTO.getCoLegalAgencyCode();
Boolean isBranded = adviserDTO.isBrandedAccessRequired();
String requestURI = "/";
if (!isBranded) {
companyAgencyCode = "sam";
} else {
requestURI = "/" + adviserDTO.getBrandingURL() + "/";
}
request.getSession().setAttribute(GlobalConstants.REQUEST_URI, requestURI);
request.getSession().setAttribute("whitelabellingfolder", companyAgencyCode);
WebUtils.setSessionAttribute(request, SessionThemeResolver.THEME_SESSION_ATTRIBUTE_NAME, companyAgencyCode);
CMULogger.exit(className, "formBackingObject");
return "termsnCondition";
}
#RequestMapping(method = RequestMethod.POST)
public String onSumbit(HttpServletRequest request, HttpServletResponse response){
CMULogger.enter(className, "onSubmit >> In the post method");
String redirectTo = GlobalConstants.REDIRECT;
if (request.getParameter("accpet") != null) {
String cnUserID = request.getHeader(UIConstant.CNUSER_ID);
String email = request.getHeader(UIConstant.EMAIL);
if ((email == null) || (cnUserID == null)) {
String message = "Mandatory Field email or cnUserID is missing";
CMULogger.error(className, "Exception in creating context", message);
// throw new ApplicationException(message);
}
ServiceContext conext = new ServiceContext();
UpdateTNCDTO updateTNCDTO = new UpdateTNCDTO();
UpdateTNCRequest updateTNCRequest = new UpdateTNCRequest();
updateTNCDTO.setCnUserID(cnUserID);
updateTNCDTO.setEmail(email);
updateTNCRequest.setUpdateTNCDTO(updateTNCDTO);
try {
CMULogger.error(className, "Error******Error**** Before updating DB");
registrationAppService.updateTNC(conext, updateTNCRequest);
CMULogger.error(className, "Error******Error**** AFter updating DB");
} catch (ApplicationException ae) {
CMULogger.error(className, "Error******Error**** Ocuured during updating DB");
/*errors.reject("", ae.getMessage());
try {
return showForm(request, errors, this.getFormView());
} catch (Exception e) {
CMULogger.error(className, e.getMessage());
}*/
}
CMULogger.debug(className, "******" + PropertyReader.getEnvBasedProperty(GlobalConstants.TNC_ACCEPTED_URL));
String requestURI = (String) request.getSession().getAttribute(GlobalConstants.REQUEST_URI);
redirectTo =
PropertyReader.getEnvBasedProperty(GlobalConstants.TNC_ACCEPTED_URL)
+ ((requestURI.equals("/")) ? "" : requestURI.substring(0, (requestURI.length() - 1)));
} else if (request.getParameter("decline") != null) {
CMULogger.debug(className, "User declined T&C");
StringBuilder strbuilder = new StringBuilder();
strbuilder.append(redirectTo);
strbuilder.append(PropertyReader.getEnvBasedProperty(GlobalConstants.LOGOFF_URL));
String requestURI = (String) request.getSession().getAttribute(GlobalConstants.REQUEST_URI);
strbuilder.append("?advisor=" + ((requestURI.equals("/")) ? "" : requestURI.substring(1, (requestURI.length() - 1))));
redirectTo = strbuilder.toString();
}
CMULogger.debug(className, "User is redirected to following url:" + redirectTo);
CMULogger.exit(className, "onSubmit");
//return "redirect:" + redirectTo;`enter code here`
return redirectTo;
}
public AppService getAppService() {
return appService;
}
public void setAppService(
AppService appService) {
this.appService = appService;
}
}

Resources