Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
5d4dc120
Commit
5d4dc120
authored
Jul 15, 2019
by
Sascha Herzinger
Browse files
fixed redirect issue
parent
2410790a
Pipeline
#11752
failed with stage
in 8 minutes and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
web/src/main/java/lcsb/mapviewer/web/config/SpringWebConfig.java
View file @
5d4dc120
...
...
@@ -2,11 +2,14 @@ package lcsb.mapviewer.web.config;
import
lcsb.mapviewer.api.SpringRestApiConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
org.springframework.web.servlet.ViewResolver
;
import
org.springframework.web.servlet.config.annotation.*
;
import
org.springframework.web.servlet.view.InternalResourceViewResolver
;
import
java.util.List
;
...
...
@@ -23,14 +26,26 @@ public class SpringWebConfig implements WebMvcConfigurer {
this
.
interceptors
=
interceptors
;
}
@Bean
public
ViewResolver
viewResolver
()
{
InternalResourceViewResolver
resolver
=
new
InternalResourceViewResolver
();
resolver
.
setPrefix
(
"/"
);
resolver
.
setSuffix
(
".xhtml"
);
return
resolver
;
}
@Override
public
void
addViewControllers
(
ViewControllerRegistry
registry
)
{
registry
.
addRedirectViewController
(
"/"
,
"/index.xhtml"
);
registry
.
addViewController
(
"/"
)
.
setViewName
(
"index"
);
}
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
registry
.
addResourceHandler
(
"/resources/**"
).
addResourceLocations
(
"/resources/"
);
registry
.
addResourceHandler
(
"/resources/**"
)
.
addResourceLocations
(
"/resources/"
);
}
@Override
...
...
web/src/main/webapp/index.html
deleted
100644 → 0
View file @
2410790a
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
http-equiv=
"refresh"
content=
"0; url=index.xhtml"
/>
<p><a
href=
"index.xhtml"
>
Redirect
</a></p>
</head>
<body>
</body>
</html>
\ No newline at end of file
web/src/test/java/lcsb/mapviewer/web/SpringSecurityGeneralIntegrationTest.java
View file @
5d4dc120
...
...
@@ -135,7 +135,7 @@ public class SpringSecurityGeneralIntegrationTest extends ControllerIntegrationT
public
void
testAllowCacheForRootReuqest
()
throws
Exception
{
RequestBuilder
request
=
get
(
"/"
);
MockHttpServletResponse
response
=
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is
3
xx
Redirection
())
.
andExpect
(
status
().
is
2
xx
Successful
())
.
andReturn
().
getResponse
();
assertFalse
(
response
.
getHeaderNames
().
contains
(
"Pragma"
));
assertFalse
(
response
.
getHeaderNames
().
contains
(
"Vary"
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment