' Alguem poderia me dar um exemplo de como importar o java script para a jsp usando a expression language.
No caso o professor importou para a jss, o bootstrap e o tema básico só que estou precisando do java script em um projeto meu e não funcionou.
Bootstrap min:
Tema bootstrap:
JavaScript (Não funcionou comigo):
Se alguem puder ajudar eu agradeço
'
Aqui tá a classe que o spring usa para autorizar o acesso:
''' import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.support.ReloadableResourceBundleMessageSource; import org.springframework.format.datetime.DateFormatter; import org.springframework.format.datetime.DateFormatterRegistrar; import org.springframework.format.support.DefaultFormattingConversionService; import org.springframework.format.support.FormattingConversionService; import org.springframework.web.multipart.MultipartResolver; import org.springframework.web.multipart.support.StandardServletMultipartResolver; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver;
import br.com.projetoimobiliaria.sisgi.controllers.HomeController; import br.com.projetoimobiliaria.sisgi.daos.ClientesDAO;
@EnableWebMvc // Habilita Web MVC Spring @ComponentScan(basePackageClasses={HomeController.class, ClientesDAO.class}) //MapeiaClassesControllers do Spring, public class AppWebConfigurantion extends WebMvcConfigurerAdapter{
@Bean //Classe gerenciada pelo spring InternalResourceViewResolver internalResourceViewResolver(){ InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp");
return resolver; }
@Bean public MessageSource messageSource(){ ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("/WEB-INF/message"); messageSource.setDefaultEncoding("UTF-8"); messageSource.setCacheSeconds(1); return messageSource; }
//Formata datas no padrão brasileiro @Bean public FormattingConversionService mvcConversionService(){ DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(); DateFormatterRegistrar registrar = new DateFormatterRegistrar(); registrar.setFormatter(new DateFormatter("dd/MM/yyyy")); registrar.registerFormatters(conversionService);
return conversionService; }
@Bean public MultipartResolver multipartResolver(){ return new StandardServletMultipartResolver(); }
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } '''