Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 9a901190 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

set UrlPathHelper - set decode to false

test SQL doctype  for null  - oracle issue
parent 4c37fbff
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ import java.util.Objects;
@NamedNativeQuery(name = "DBServiceMetadata.getBySGIdentifierAndSMDdentifier", query = "SELECT md.* FROM SMP_SERVICE_METADATA md INNER JOIN SMP_SERVICE_GROUP_DOMAIN sgd ON sgd.ID = md.FK_SG_DOM_ID \n" +
" INNER JOIN SMP_SERVICE_GROUP sg ON sg.ID = sgd.FK_SG_ID\n" +
" where sg.PARTICIPANT_IDENTIFIER = :partcId AND sg.PARTICIPANT_SCHEME=:partcSch" +
" AND md.DOCUMENT_IDENTIFIER=:docId AND md.DOCUMENT_SCHEME=:docSch", resultClass=DBServiceMetadata.class),
" AND md.DOCUMENT_IDENTIFIER=:docId AND (:docSch IS NULL OR md.DOCUMENT_SCHEME=:docSch)", resultClass=DBServiceMetadata.class),
@NamedNativeQuery(name = "DBServiceMetadata.getBySGIdentifier", query = "SELECT md.* FROM SMP_SERVICE_METADATA md INNER JOIN SMP_SERVICE_GROUP_DOMAIN sgd ON sgd.ID = md.FK_SG_DOM_ID \n" +
" INNER JOIN SMP_SERVICE_GROUP sg ON sg.ID = sgd.FK_SG_ID\n" +
" where sg.PARTICIPANT_IDENTIFIER = :partcId AND sg.PARTICIPANT_SCHEME=:partcSch", resultClass=DBServiceMetadata.class)
......
......@@ -29,6 +29,7 @@ import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.util.UrlPathHelper;
import java.util.List;
......@@ -47,37 +48,6 @@ import static org.springframework.core.Ordered.HIGHEST_PRECEDENCE;
"eu.europa.ec.edelivery.smp.ui"})
@Import({GlobalMethodSecurityConfig.class, ErrorMappingControllerAdvice.class})
public class SmpWebAppConfig implements WebMvcConfigurer {
/*
@Override
public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
// There is no clean way of replacing the default Jackson 2 HttpMessageConverter while keeping the other
// default converters (@EnableWebMvc disables auto-configuration and most of the default converters are
// not available as Spring beans
// org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.addDefaultHttpMessageConverters)
converters.removeIf(httpMessageConverter -> httpMessageConverter instanceof MappingJackson2HttpMessageConverter);
converters.add(jackson2HttpMessageConverter());
}
@Bean
public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() {
return new MappingJackson2HttpMessageConverter(objectMapper());
}
@Bean
@Primary
public ObjectMapper objectMapper() {
return Jackson2ObjectMapperBuilder.json()
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.build();
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("/index.html");
registry.addViewController("/ui/").setViewName("/ui/index.html");
//Home page used by SMP 2.x and 3.x - needed for backward compatibility in some EC's environments
registry.addViewController("/web/index.html").setViewName("/index.html");
}*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
......@@ -95,5 +65,13 @@ public class SmpWebAppConfig implements WebMvcConfigurer {
public void configurePathMatch(PathMatchConfigurer configurer) {
//Default value (true) would break @PathVariable Identifiers containing dot character "."
configurer.setUseSuffixPatternMatch(false);
// do not decode path before mapping - that cause problems to identifiers with /
UrlPathHelper urlPathHelper =configurer.getUrlPathHelper();
if (urlPathHelper==null) {
urlPathHelper = new UrlPathHelper();
configurer.setUrlPathHelper(urlPathHelper);
}
urlPathHelper.setUrlDecode(false);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment