我正在编写一个jsp文件来调用带有一些参数的控制器。从这个控制器我想通过从控制器传递值来调用servlet。在servlet中我应该可以访问参数。是否可以通过控制器将值从jsp转发到servlet?
答案 0 :(得分:0)
Yes it's possible in Spring controller,
Try this in Spring controller:
public void requestedURL(HttpServletRequest req, HttpServletResponse res){
String jspParameter = request.getParameter("param_name");
req.getRequestDispatcher("your servlet url pattern?param1="+jspParameter)
.forward(req, res);
}