|
1 | 1 | package io.shiftleft.controller; |
2 | 2 |
|
| 3 | +import java.lang.Object; |
3 | 4 | import javax.servlet.http.HttpServletRequest; |
4 | 5 | import javax.servlet.http.HttpServletResponse; |
5 | 6 | import org.springframework.expression.Expression; |
|
10 | 11 | import org.springframework.web.bind.annotation.RequestMethod; |
11 | 12 | import org.springframework.web.bind.annotation.RequestParam; |
12 | 13 |
|
13 | | - |
14 | 14 | /** |
15 | 15 | * Search login |
16 | 16 | */ |
17 | 17 | @Controller |
18 | 18 | public class SearchController { |
19 | 19 |
|
20 | | - @RequestMapping(value = "/search/user", method = RequestMethod.GET) |
21 | | - public String doGetSearch(@RequestParam String foo, HttpServletResponse response, HttpServletRequest request) { |
22 | | - java.lang.Object message = new Object(); |
23 | | - try { |
24 | | - ExpressionParser parser = new SpelExpressionParser(); |
25 | | - Expression exp = parser.parseExpression(foo); |
26 | | - message = (Object) exp.getValue(); |
27 | | - } catch (Exception ex) { |
28 | | - System.out.println(ex.getMessage()); |
| 20 | + @RequestMapping(value = "/search/user", method = RequestMethod.GET) |
| 21 | + public String doGetSearch(@RequestParam String foo, HttpServletResponse response, HttpServletRequest request) { |
| 22 | + java.lang.Object message = new Object(); |
| 23 | + try { |
| 24 | + ExpressionParser parser = new SpelExpressionParser(); |
| 25 | + Expression exp = parser.parseExpression("String.valueOf(" + foo + ")"); |
| 26 | + message = (Object) exp.getValue(); |
| 27 | + } catch (Exception ex) { |
| 28 | + System.out.println(ex.getMessage()); |
| 29 | + } |
| 30 | + return message.toString(); |
29 | 31 | } |
30 | | - return message.toString(); |
31 | | - } |
32 | 32 | } |
| 33 | +``` |
0 commit comments