Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


spring servlet mapping url pattern working but cant display


spring servlet mapping url pattern working but cant display  using -'java,spring,jsp,spring-mvc,servlets'

web.xml

<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/webmvc-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>/</welcome-file>
</welcome-file-list>


/WEB-INF/spring/webmvc-config.xml

<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="mediaTypes">
        <map>
            <entry key="atom" value="application/atom+xml" />
            <entry key="html" value="text/html" />
            <entry key="json" value="application/json" />
        </map>
    </property>
    <property name="viewResolvers">
        <list>
            <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
            <bean
                class="org.springframework.web.servlet.view.InternalResourceViewResolver">
                <property name="prefix" value="/WEB-INF/views/" />
                <property name="suffix" value=".jsp" />
            </bean>
        </list>
    </property>
    <property name="defaultViews">
        <list>
            <bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
        </list>
    </property>
</bean>


Controller

@Controller
@RequestMapping ( "/" )
public class IndexController extends BaseController
{
    @RequestMapping ( "/" )
    public String index ( Model model ){
        System.out.println("AA");
        return index2(model);
    }

    @RequestMapping ( "/index" )
    public String index2 ( Model model ){
        System.out.println("BB");
        return "index";
    }
}


And exist index.jsp File



I guess that is very good working

BBBBBBBBBBBUUUUUUUUUTTTTTTTTT, BUT!



WHY????
WHY????
WHY????
WHY????

And More strange



??????????????????????????????????????????????????????????????????

Controller work it!! but don't display browser

What's going on?

Please help me.



And Log

DispatcherServlet with name 'dispatcher' processing GET request for [/WEB-INF/views/index.jsp]

No mapping found for HTTP request with URI [/WEB-INF/views/index.jsp] in DispatcherServlet with name 'dispatcher'
    

asked Oct 13, 2015 by kinnari
0 votes
8 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...