Announcement Announcement Module
Collapse
No announcement yet.
static html page with no controller (using tiles) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • static html page with no controller (using tiles)

    I'm trying to adapt my spring/tiles project to show static HTML page.

    Fragment of my tiles.xml:

    Code:
        <definition name="about.html" template="/WEB-INF/static/about.html" />
    web.xml:

    Code:
        <display-name>
            lyricsBase
        </display-name>
        <servlet>
            <servlet-name>lyricsBaseApp</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>lyricsBaseApp</servlet-name>
            <url-pattern>*.html</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
            <welcome-file>list.html</welcome-file>
        </welcome-file-list>
        <error-page>
            <error-code>404</error-code>
            <location>/jsp/404.jsp</location>
        </error-page>
    spring servlet:

    Code:
        <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
    
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <props>
                    <prop key="/list.html">jukeboxController</prop>
                    <prop key="/display.html">songController</prop>
                    <prop key="/static/*">urlFilenameViewController</prop>
                </props>
            </property>
        </bean>
    When I try to access http://localhost:8084/lyricsBase/static/about.html I encounter following exception:

    Code:
    javax.servlet.ServletException: Could not resolve view with name 'about' in servlet with name 'lyricsBaseApp'
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1190)
    	org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    Probably I've messed something with view logical name - that's why the exception is thrown. But I can't find what's wrong...
Working...
X