M
M
melikbekyan2016-04-18 11:28:44
Java
melikbekyan, 2016-04-18 11:28:44

Why doesn't it return jsp page?

It enters the control, but does not return the page, what should I do?
Controller:
12ae5b556c7f4a189588f14d5e02d67d.png
694e66f339c1465796f45ae0d930ed96.png
75b4f4c4b1bb4352b065e2a390cf148b.png
0b9ae7c38ac647c9a9fbd1857beb89a0.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Kosarev, 2016-04-20
@melikbekyan

If you need mapping to the root of the application, then /* replace with /:

<servlet-mapping>
    <servlet-name>HelloWeb</servlet-name>
    <url-pattern>/<url-pattern>
</servlet-mapping>

Spring can't find the view because of this.
Plus, check for jstl in dependencies.

K
Konstantin Malyarov, 2016-04-18
@Konstantin18ko

Write your URL? How do you prescribe it?

E
Evhen, 2016-04-18
@EugeneP2

<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
  
  <!-- Enables the Spring MVC @Controller programming model -->
  <annotation-driven />

  <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
  <resources mapping="/resources/**" location="/resources/" />
  <resources mapping="/images/**" location="/resources/images/" />
  <resources mapping="/css/**" location="/resources/css/" />
  <resources mapping="/js/**" location="/resources/js/" />

  <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
  <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <beans:property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <beans:property name="prefix" value="/WEB-INF/views/" />
    <beans:property name="suffix" value=".jsp" />
  </beans:bean>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question