mozzy
(Moses Mutesasira)
May 3, 2018, 8:54am
1
iam trying to customise a new module.
but wherever i click the module link in the admin page…
it gives me this error
HTTP Status 404 - /openmrs/WEB-INF/view/module/conceptName/viewconceptNames.jsp
type Status report
message /openmrs/WEB-INF/view/module/conceptName/viewconceptNames.jsp
description The requested resource is not available.
Apache Tomcat/7.0.37
here is my tocat error-log
https://hastebin.com/otupabohen.sql
@k.joseph @tendomart @dkayiwa @ssmusoke @wyclif
mozzy
(Moses Mutesasira)
May 3, 2018, 8:57am
2
here is my controller class
@Controller
public class BasicModuleFormController {
@ModelAttribute
public Concept getConcept(@RequestParam(required = false, value = "conceptId") Concept concept) {
return concept;
}
@RequestMapping(value = "module/conceptName/viewconceptNames.form", method = RequestMethod.GET)
public void showForm() {
}
}
and here is my class which defines the link
public class AdminList extends AdministrationSectionExt {
/**
* @see org.openmrs.module.web.extension.AdministrationSectionExt#getMediaType()
*/
public Extension.MEDIA_TYPE getMediaType() {
return Extension.MEDIA_TYPE.html;
}
/**
* @see org.openmrs.module.web.extension.AdministrationSectionExt#getTitle()
*/
public String getTitle() {
return "CONCEPT NAME MANAGEMENT";
}
/**
* @see org.openmrs.module.web.extension.AdministrationSectionExt#getLinks()
*/
public Map<String, String> getLinks() {
Map<String, String> map = new LinkedHashMap<String, String>();
map.put("module/conceptName/viewconceptNames.form", "CONCEPT MANAGEMENT");
return map;
}
}
dkayiwa
(Daniel Kayiwa)
May 4, 2018, 10:21am
3
Try change the return type of showForm() to String.
And then return module/conceptName/viewconceptNamesForm
1 Like
mozzy
(Moses Mutesasira)
May 4, 2018, 10:26am
4
now shoudi leave the extension link as
module/conceptName/viewconceptNames.form
or i also change it to module/conceptName/viewconceptNamesForm
mozzy
(Moses Mutesasira)
May 4, 2018, 11:17am
5
it still fails
here is my jsp named “viewconceptNames”
<%@ include file="/WEB-INF/template/include.jsp"%>
<%@ include file="/WEB-INF/template/header.jsp"%>
<form method = GET>
CHOOSE A CONCEPT : <openmrs_tag:conceptField formFieldName= "conceptId"/>
<input type ="submit" value = "view"> </input>
</form>
<br/>
<table>
<tr>
<th>CONCEPT ID</th>
<th>${concept.conceptId} </th>
</tr>
<tr>
<th>UUID</th>
<th>${concept.uuid}</th>
</tr>
<tr>
<th> NAMES</th>
<td>
<table border="1">
<tr>
<th>Locale </th>
<th>Prefered</th>
<th>Type</th>
<th>Nmae</th>
<th>Tags</th>
</tr>
<c:forEach var="cn" items="${concept.names}">
<tr>
<td>${cn.locale } </td>
<td>${ cn.localePreferred } </td>
<td>${ cn.conceptNameType } </td>
<td> <c:out escapeXml ="true" value="${cn,name}"/></td>
<td>
<c:forEach var="t" items="${cn.tags}">
<c:out escapeXml ="true" value="${t.tag}"/>
<c:if test = "${not status.last }"> ,</c:if>
</c:forEach>
</td>
</tr>
</c:forEach>
</table>
</td>
</tr>
</table>
<%@ include file="/WEB-INF/template/footer.jsp"%>
and here is my error log
https://hastebin.com/ikowodiwat.sql
dkayiwa
(Daniel Kayiwa)
May 4, 2018, 11:23am
6
Put your entire module on github for inspection.
1 Like
dkayiwa
(Daniel Kayiwa)
May 4, 2018, 12:25pm
8
The problem is that you did more than i told you.
mozzy
(Moses Mutesasira)
May 4, 2018, 12:27pm
9
oh am very sorry sir, i first tried out wat u told me, probably worngly, and i got an error,so i kept on adjusting slighty…
mozzy
(Moses Mutesasira)
May 4, 2018, 1:15pm
10
u can look at my last commit. i tried to do it as per the instruction. but it still failed
wyclif
(Wyclif Luyima)
May 4, 2018, 1:27pm
11
The module id seems like the problem, what is your module id? I see basicmodule in the pom file but you are using conceptName in your URL, can you please clean all this up.
1 Like
mozzy
(Moses Mutesasira)
May 5, 2018, 5:23pm
12