Announcement Announcement Module
Collapse
No announcement yet.
Problems while Configuring Tiles in Spring MVC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems while Configuring Tiles in Spring MVC

    Hi All,


    Im configuring spring mvc with tiles but unable to configure it. Would you please suggest me that If Im wrong anywhere in the config files in below.

    Actually Im calling tiles template from AuthenticationProcessingFilter when user provide correct credentials.

    After giving correct credentials Its showing 404 error on the page.


    The below is from spring security config files:-
    -----------------------------------------
    <bean id="authenticationProcessingFilter"
    class="org.acegisecurity.ui.webapp.AuthenticationP rocessingFilter">
    <property name="filterProcessesUrl" value="/j_acegi_security_check" />
    <property name="authenticationFailureUrl" value="/Failure.jsp?login_error=1" />
    <property name="defaultTargetUrl" value="/WEB-INF/jsp/template.jsp" />
    <property name="authenticationManager" ref="authenticationManager" />




    The below is from tiles definition file:-
    ---------------------------------------

    <definition name="template" page="/WEB-INF/jsp/template.jsp">
    <put-attribute name="title" value="Friday Technology" />
    <put-attribute name="header" value="/WEB-INF/jsp/header.jsp" />
    <put-attribute name="menu" value="/WEB-INF/jsp/menu.jsp" />
    <put-attribute name="body" value="/WEB-INF/jsp/body.jsp" />
    <put-attribute name="footer" value="/WEB-INF/jsp/footer.jsp" />
    </definition>
    </bean>




    The below is from spring config file to load definition files:-
    -----------------------------------------------

    <bean id="tilesConfigurer"
    class="org.springframework.web.servlet.view.tiles2 .TilesConfigurer">
    <property name="definitions">
    <list>
    <value>/WEB-INF/config/tiles/spring-tiles-definitions-config.xml
    </value>
    </list>
    </property>
    </bean>




    The below code is for view resolver and handler and controller:-
    ------------------------------------------------------------

    <bean id="viewResolver"
    class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass"
    value="org.springframework.web.servlet.view.tiles. TilesJstlView" />
    <property name="prefix" value="/WEB-INF/jsp/" />
    <property name="suffix" value=".jsp" />
    </bean>


    <!--<bean id="viewResolver2" class="org.springframework.web.servlet.view.UrlBas edViewResolver">
    <property name="requestContextAttribute" value="requestContext" /> <property
    name="viewClass" value="org.springframework.web.servlet.view.tiles2 .TilesView"
    /> </bean> -->
    <bean id="urlMapping"
    class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/template.jsp">templateController</prop>
    </props>
    </property>
    </bean>

    <bean id="templateController" class="HomeController" />


    HomeController.java:-
    ---------------------------

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.AbstractContro ller;
    import org.springframework.web.servlet.mvc.support.Contro llerBeanNameHandlerMapping;

    public class HomeController extends AbstractController {
    /*
    * (non-Javadoc)
    *
    * @see
    * org.springframework.web.servlet.mvc.AbstractContro ller#handleRequestInternal
    * (javax.servlet.http.HttpServletRequest,
    * javax.servlet.http.HttpServletResponse)
    */
    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest arg0,
    HttpServletResponse arg1) throws Exception {
    // TODO Auto-generated method stub
    return new ModelAndView("template");
    }

    }





    Im really thank full to you if you provide some info to fix this issue.

    And Thanks in advance..!
Working...
X