Overriding a jsp page in new module

Hi All,

I am trying to Override existing jsp page in new module i followed steps from the link.


<bean id="myModuleMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
	<property name="order"><value>10</value></property>
	<property name="mappings">
			<prop key="admin/patients/newPatient.form">myNewPatientFormController</prop>

<bean id="myNewPatientFormController" class="org.openmrs.module.basicexample.web.controller.MyNewPatientFormController" />

<context:component-scan base-package="org.openmrs.module.basicexample.web.controller" />


public class MyNewPatientFormController
	@RequestMapping( method = RequestMethod.GET )
	public void showThePage()

	@RequestMapping( method = RequestMethod.POST )
	public String savePatient( @ModelAttribute( "patient" ) Patient newPatient )
		System.out.println( newPatient );
		return newPatient.getGivenName();

when i tried to access http://localhost:8080/openmrs/admin/patients/newPatient.form end point HTTP Status 404 - /openmrs/WEB-INF/view/admin/patients/newPatient.jsp error i have placed newPatient.jsp file under /webapp/newPatient.jsp & /webapp/admin/patients/newPatient.jsp and tried.

Are you doing this from the basic module? Because I see the fully qualified java class names contain ‘basicexample’. If you’re overriding a jsp, the assumption is that you want to display your module’s jsp, so your showThePage() method should return the view name of your jsp instead and not void as shown in the example page which would be something like ‘module/module_id/path_to_jsp’.

@wyclif Thanks for reply.after giving the qualified path it is working.