Skip to content

Commit 30552c8

Browse files
author
Eugen Paraschiv
committed
formatting cleanup
1 parent dec95f5 commit 30552c8

26 files changed

Lines changed: 93 additions & 127 deletions

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/AttrListener.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ public class AttrListener implements ServletContextListener {
99

1010
@Override
1111
public void contextInitialized(ServletContextEvent servletContextEvent) {
12-
servletContextEvent
13-
.getServletContext()
14-
.setAttribute("servlet-context-attr", "test");
12+
servletContextEvent.getServletContext().setAttribute("servlet-context-attr", "test");
1513
System.out.println("context init");
1614
}
1715

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/EchoServlet.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ public class EchoServlet extends HttpServlet {
1616
@Override
1717
public void doPost(HttpServletRequest request, HttpServletResponse response) {
1818
try {
19-
Path path = File
20-
.createTempFile("echo", "tmp")
21-
.toPath();
19+
Path path = File.createTempFile("echo", "tmp").toPath();
2220
Files.copy(request.getInputStream(), path, StandardCopyOption.REPLACE_EXISTING);
2321
Files.copy(path, response.getOutputStream());
2422
Files.delete(path);

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloFilter.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ public void init(FilterConfig filterConfig) throws ServletException {
1818

1919
@Override
2020
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
21-
servletResponse
22-
.getOutputStream()
23-
.print(filterConfig.getInitParameter("msg"));
21+
servletResponse.getOutputStream().print(filterConfig.getInitParameter("msg"));
2422
filterChain.doFilter(servletRequest, servletResponse);
2523
}
2624

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/annotation/servletcomponentscan/components/HelloServlet.java‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@
88
import javax.servlet.http.HttpServletResponse;
99
import java.io.IOException;
1010

11-
@WebServlet(urlPatterns = "/hello", initParams = { @WebInitParam(name = "msg", value = "hello")})
11+
@WebServlet(urlPatterns = "/hello", initParams = { @WebInitParam(name = "msg", value = "hello") })
1212
public class HelloServlet extends HttpServlet {
1313

1414
private ServletConfig servletConfig;
1515

1616
@Override
17-
public void init(ServletConfig servletConfig){
17+
public void init(ServletConfig servletConfig) {
1818
this.servletConfig = servletConfig;
1919
}
2020

2121
@Override
2222
public void doGet(HttpServletRequest request, HttpServletResponse response) {
2323
try {
24-
response
25-
.getOutputStream()
26-
.write(servletConfig.getInitParameter("msg").getBytes());
24+
response.getOutputStream().write(servletConfig.getInitParameter("msg").getBytes());
2725
} catch (IOException e) {
2826
e.printStackTrace();
2927
}

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/intro/App.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55

66
@SpringBootApplication
7-
public class App
8-
{
9-
public static void main( String[] args )
10-
{
7+
public class App {
8+
public static void main(String[] args) {
119
SpringApplication.run(App.class, args);
1210
}
1311
}

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/intro/controller/HomeController.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
public class HomeController {
88

99
@RequestMapping("/")
10-
public String root(){
10+
public String root() {
1111
return "Index Page";
1212
}
13-
13+
1414
@RequestMapping("/local")
15-
public String local(){
15+
public String local() {
1616
return "/local";
1717
}
1818
}

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/servlets/configuration/WebMvcConfigure.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public void configureDefaultServletHandling(DefaultServletHandlerConfigurer conf
2626
configurer.enable();
2727
}
2828

29-
3029
@Override
3130
public void addResourceHandlers(ResourceHandlerRegistry registry) {
3231
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/").setCachePeriod(3600).resourceChain(true).addResolver(new PathResourceResolver());

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/servlets/props/PropertySourcesLoader.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
@Configuration
1212
@ComponentScan(basePackages = { "com.baeldung.*" })
13-
@PropertySource("classpath:custom.properties") public class PropertySourcesLoader {
13+
@PropertySource("classpath:custom.properties")
14+
public class PropertySourcesLoader {
1415

1516
private static final Logger log = LoggerFactory.getLogger(PropertySourcesLoader.class);
1617

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/servlets/servlets/javaee/AnnotationServlet.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
import javax.servlet.http.HttpServletResponse;
88
import java.io.IOException;
99

10-
@WebServlet(name = "AnnotationServlet",
11-
description = "Example Servlet Using Annotations",
12-
urlPatterns = { "/annotationservlet" })
10+
@WebServlet(name = "AnnotationServlet", description = "Example Servlet Using Annotations", urlPatterns = { "/annotationservlet" })
1311
public class AnnotationServlet extends HttpServlet {
1412
private static final long serialVersionUID = 1L;
1513

‎spring-custom-aop/spring-custom-aop/src/main/java/com/baeldung/utils/Application.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import org.springframework.context.annotation.ComponentScan;
88

99
@SpringBootApplication
10-
@ComponentScan(basePackages="com.baeldung.utils")
10+
@ComponentScan(basePackages = "com.baeldung.utils")
1111
public class Application {
1212

13-
@RolesAllowed("*")
14-
public static void main(String[] args) {
15-
SpringApplication.run(Application.class, args);
16-
}
13+
@RolesAllowed("*")
14+
public static void main(String[] args) {
15+
SpringApplication.run(Application.class, args);
16+
}
1717

1818
}

0 commit comments

Comments
 (0)