Skip to content

Commit 894f14c

Browse files
author
patched.codes[bot]
committed
Patched src/main/java/io/shiftleft/controller/SearchController.java
1 parent 3f70ace commit 894f14c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/io/shiftleft/controller/SearchController.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import org.springframework.expression.Expression;
66
import org.springframework.expression.ExpressionParser;
77
import org.springframework.expression.spel.standard.SpelExpressionParser;
8+
import org.springframework.expression.spel.support.StandardEvaluationContext;
89
import org.springframework.stereotype.Controller;
910
import org.springframework.web.bind.annotation.RequestMapping;
1011
import org.springframework.web.bind.annotation.RequestMethod;
1112
import org.springframework.web.bind.annotation.RequestParam;
1213

13-
1414
/**
1515
* Search login
1616
*/
@@ -22,8 +22,10 @@ public String doGetSearch(@RequestParam String foo, HttpServletResponse response
2222
java.lang.Object message = new Object();
2323
try {
2424
ExpressionParser parser = new SpelExpressionParser();
25-
Expression exp = parser.parseExpression(foo);
26-
message = (Object) exp.getValue();
25+
StandardEvaluationContext context = new StandardEvaluationContext();
26+
context.setVariable("foo", foo);
27+
Expression exp = parser.parseExpression("#foo");
28+
message = exp.getValue(context);
2729
} catch (Exception ex) {
2830
System.out.println(ex.getMessage());
2931
}

0 commit comments

Comments
 (0)