First of all, it is a coincidence that JSF learns the same. To reprint, please help yourself, if there is a mistake, please forgive me!
Encountered the same problem as STRUTS2---how to get the value passed over
Because JSF, like STRUTS2, can directly use a bin as an action-handling business logic without inheriting the framework. So we can't just introduce it in the parameters.
Get the Request object in Struts2
HttpServletRequest request = Servletactioncontext.getrequest ();
Get Sessioon object in struts
HttpSession session = Request.getsession ();
JSF to get the request object to take value
String Name= (String) facescontext.getcurrentinstance (). Getexternalcontext (). Getrequestparametermap (). Get ("name") ;
Get Sessioon object in JSF
Map Session=context.getexternalcontext (). Getsessionmap ();
Note that the JSF is all map types. This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20130724/39297.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.