Skip to content

Commit

Permalink
#459 and #460: Avoid feature version in spring boot starter name and …
Browse files Browse the repository at this point in the history
…upgrade to latest spring boot version (#461)

Signed-off-by: Eric Bussieres <[email protected]>
  • Loading branch information
ebussieres authored and Eric Bussieres committed Aug 19, 2019
1 parent 9b9217a commit 59b9c28
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package com.mitchellbosecke.pebble.spring4.extension.function;

import com.mitchellbosecke.pebble.extension.Function;
import com.mitchellbosecke.pebble.spring4.util.ViewUtils;
import com.mitchellbosecke.pebble.template.EvaluationContext;
import com.mitchellbosecke.pebble.template.PebbleTemplate;

import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
* Pebble function which adds the context path to the given url
Expand Down Expand Up @@ -57,12 +62,16 @@ private void addUrlParameter(Map<String, Object> args, StringBuffer result) {

private String getContextPath() {
if (this.contextPath == null) {
this.contextPath = ViewUtils.getRequest().getContextPath();
this.contextPath = this.getRequest().getContextPath();
}

return this.contextPath;
}

private HttpServletRequest getRequest() {
ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
return attr.getRequest();
}

/**
* {@inheritDoc}
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package com.mitchellbosecke.pebble.spring.extension.function;

import com.mitchellbosecke.pebble.extension.Function;
import com.mitchellbosecke.pebble.spring.util.ViewUtils;
import com.mitchellbosecke.pebble.template.EvaluationContext;
import com.mitchellbosecke.pebble.template.PebbleTemplate;

import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
* Pebble function which adds the context path to the given url
Expand Down Expand Up @@ -56,12 +61,16 @@ private void addUrlParameter(Map<String, Object> args, StringBuffer result) {

private String getContextPath() {
if (this.contextPath == null) {
this.contextPath = ViewUtils.getRequest().getContextPath();
this.contextPath = this.getRequest().getContextPath();
}

return this.contextPath;
}

private HttpServletRequest getRequest() {
ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
return attr.getRequest();
}

/**
* {@inheritDoc}
*
Expand Down

This file was deleted.

0 comments on commit 59b9c28

Please sign in to comment.