Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: only send twice can submit success via mobile device(both ios and andro
i use liferay 6.2.
i create a sample mvc project, it work fine via PC.but if i use mobile device, cell phone or pad, first time submit, i will get green successful message, second time, the green successful message will gone and all fields be cleared, back end server(my portlet) got nothing. and I have to send again, than the green successful message shows again.
i try disable cookies from browser, yes, it work, every time i sent message , my portlet get the request, but the green successful message shows no more.
how can i make it success every time and show success message?
thank you.
i create a sample mvc project, it work fine via PC.but if i use mobile device, cell phone or pad, first time submit, i will get green successful message, second time, the green successful message will gone and all fields be cleared, back end server(my portlet) got nothing. and I have to send again, than the green successful message shows again.
i try disable cookies from browser, yes, it work, every time i sent message , my portlet get the request, but the green successful message shows no more.
how can i make it success every time and show success message?
thank you.
Bwi Scarletake:
how can i make it success every time and show success message?
Please post (simplified) code
my view.jsp
my portliet
thank you.and now i try re-open the cookies. doesn't work.
<liferay-ui:success key="<%=Constant.ETR_RI_RECORD_SUCESS_MESSAGE_KEY %>" message="<%=descriptionRecordSuccessSB.toString() %>" />
<portlet:actionurl var="etrRecordFunctionURL" name="record" />
<aui:form id="<%=Constant.ETR_RI_FORM_ID%>" action="<%=etrRecordFunctionURL%>" method="post">
<aui:layout>
<aui:column>
<aui:input name="<%=Constant.ETR_RI_EMPLOYEE_ID%>" label="<%=descriptionEmployeeId%>" value="">
<aui:validator name="required" />
<aui:validator name="minLength">9</aui:validator>
<aui:validator name="maxLength">10</aui:validator>
</aui:input>
</aui:column>
<aui:column>
<aui:input name="<%=Constant.ETR_RI_TEMPERATURE%>" label="<%=descriptionTemperature%>" value="">
<aui:validator name="required" />
<aui:validator name="number"></aui:validator>
</aui:input>
<aui:select name="<%=Constant.ETR_RI_MEASUREMENT_TYPE%>" id="<%=Constant.ETR_RI_MEASUREMENT_TYPE%>" label="<%=descriptionMeasurementType%>">
<aui:option value="1" label="<%=descriptionEarTemperature%>" />
<aui:option value="2" label="<%=descriptionForehead %>" />
</aui:select>
</aui:column></aui:layout></aui:form>
<aui:button-row>
<aui:button type="submit" value="<%=descriptionSubmit%>" />
</aui:button-row>
my portliet
public class RecrodInterfacePortlet extends com.liferay.util.bridges.mvc.MVCPortlet {
public static final String PORTLET_NAME = Constant.DEFAULT_PORTLET_NAME_PREFIX + "RecrodInterfacePortlet";
private static Log LOGGER = LogFactoryUtil.getLog(RecrodInterfacePortlet.class);
public void record(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
String employeeId = ParamUtil.getString(actionRequest, Constant.ETR_RI_EMPLOYEE_ID).trim().toUpperCase();
double temperature = ParamUtil.getDouble(actionRequest, Constant.ETR_RI_TEMPERATURE);
String employeeName = RecordLocalServiceUtil.getEmployeeName(employeeId);
int measurementType = ParamUtil.getInteger(actionRequest, Constant.ETR_RI_MEASUREMENT_TYPE);
String measurementTypeStr = Constant.ETR_RI_MEASUREMENT_TYPE_EAR_DEFAULT;
if (measurementType == 2) {
measurementTypeStr = Constant.ETR_RI_MEASUREMENT_TYPE_FOREHEAD_DEFAULT;
}
if (employeeName == null || employeeName.trim().length() == 0) {
LOGGER.info("employeeId:" + employeeId + "it not correct.");
SessionErrors.add(actionRequest, "employeeId:" + employeeId + "it not correct.");
return;
} else {
LOGGER.info("employeeId:" + employeeId + " temperature:" + temperature);
}
try {
RecordLocalServiceUtil.record(employeeId, employeeName, temperature, measurementTypeStr);
SessionMessages.add(actionRequest, Constant.ETR_RI_RECORD_SUCESS_MESSAGE_KEY);
actionRequest.setAttribute(Constant.ETR_RI_RECORD_SUCESS_TIME, CalendarHelper.getTimeDescriptionSubLong(new Date()));
} catch (Exception ex) {
LOGGER.error(ex);
}
}
as you can see, it's very simple mvc, and it's work fine, only in mobile device, we have to submit twice.thank you.and now i try re-open the cookies. doesn't work.
i fix this issue. i added session.enable.persistent.cookies=false
in my portal-ext.properties
thank you.
in my portal-ext.properties
thank you.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™