I need to call my controller directly when the application is started, to paint the html with the data, but I do not know how it is done - >
<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
<!--
Most controllers will use the ControllerClassNameHandlerMapping above, but
for the index controller we are using ParameterizableViewController, so we must
define an explicit mapping for it.
-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<!-- Spring -->
<prop key="index.htm">indexController</prop>
<!-- Funciones del Sistema -->
<prop key="Form_CrearCuenta.htm">SistemaController</prop>
<prop key="CrearCuenta.htm">SistemaController</prop>
<prop key="Cerrar_sesion.htm">SistemaController</prop>
<prop key="Corregir_Examen.htm ">SistemaController</prop>
<!-- Funciones Comunes de usuarios-->
<prop key="Home.htm">UsuarioController</prop>
<prop key="Login.htm">UsuarioController</prop>
<prop key="Hacer_examen.htm">UsuarioController</prop>
<!-- Funciones Comunes Administrador-->
<prop key="AdministrarUsuarios.htm">AdminController</prop>
</props>
</property>
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<!-- The index controller. -->
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index" />
<!-- Controlador del Sistema -->
<bean name="SistemaController" class="Controladores.ControladorSistema"/>
<!-- Controlador del usuario -->
<bean name="UsuarioController" class="Controladores.ControladorUsuario"/>
<!-- Controlador del admin -->
<bean name="AdminController" class="Controladores.ControladorAdministrador"/>
You put forms that call controllers and forward the data to a page and paint the data, but call my controller directly when I start my program, I'm having problems.
I tried to do
<bean id="viewResolver" class="SistemaController" />
But I can not do it, thanks.