bgevam
(Georg Bernold)
May 30, 2016, 1:38pm
1
OpenMRS Version: 1.11.4
Module: openmrs-module-radiology
Hi everyone
I am currently experiencing an issue when using the “requireConfiguration” Tag. The intetion of the tag is to redirect the user to a different page when a specific property is not configured.
The redirection part works great. But the downside is, I do not get the WebConstants.OPENMRS_ERROR_ATTR Attribute displayed, which informs the user, why the redirection happened.
See the Tag:
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
AdministrationService as = Context.getAdministrationService();
for (String propName : propertyList.split(",")) {
propName = propName.trim();
GlobalProperty p = as.getGlobalPropertyObject(propName);
if (p == null || StringUtils.isBlank(p.getPropertyValue())) {
pageContext.getSession().setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "error.configurationRequired");
try {
log.info("Configuration not complete, missing property (" + p.getProperty()
+ "). Redirecting to page: " + request.getContextPath() + configurationPage);
response.sendRedirect(request.getContextPath() + configurationPage);
return SKIP_PAGE;
}
catch (IllegalStateException ise) {
log.warn("Unable to forward request. It is likely that a response was already committed.", ise);
}
catch (IOException e) {
This is my current branch:
https://github.com/bgeVam/openmrs-module-radiologydcm4chee/tree/RAD-254
Any suggestion, why this could happen?
dkayiwa
(Daniel Kayiwa)
May 31, 2016, 2:16pm
2
If one wants to try this out, which exact url should they access to reproduce?
bgevam
(Georg Bernold)
May 31, 2016, 2:35pm
3
dkayiwa
(Daniel Kayiwa)
June 1, 2016, 4:14pm
4
I have just tried this out by simply pasting this line in one of the jps in my module: https://github.com/bgeVam/openmrs-module-radiologydcm4chee/blob/RAD-254/omod/src/main/webapp/radiologyOrderForm.jsp#L8
Clicking on the link which loads this jsp shows the settings page with the error message: “All configuration parameters must be specified prior to using this module”.
bgevam
(Georg Bernold)
June 1, 2016, 4:39pm
5
Sounds fine!
Thank you for trying. What was your testing environment (OpenMRS Version + Module)?
dkayiwa
(Daniel Kayiwa)
June 1, 2016, 5:41pm
6
OpenMRS platform 2.0 and xforms module.