Webapplicationcontext Wac=webapplicationcontextutils.getwebapplicationcontext (This.getServletContext ()); The meaning of the sentence

Source: Internet
Author: User

appear in JSP

Extracted code:

<%
Webapplicationcontext WAC = Webapplicationcontextutils
. Getwebapplicationcontext (This.getservletcontext ());
Userdao Userdao = (Userdao) wac.getbean ("Userdaoimpl");
String in= (String) request.getparameter ("id");
System.out.println (in);
int Num=integer.parseint (in);
%>
<%=userdao.finduserbyid (num)%><br/>

Webapplicationcontext Wac=webapplicationcontextutils.getwebapplicationcontext (This.getServletContext ());
What is Webapplicationcontext?
What is Webapplicationcontextutils?
What is This.getservletcontext ()?

The meaning of this sentence is to get the ApplicationContext object through the Webapplicationcontextutils tool class. This object is obtained through the. Getservletcontext () method, The obtained ApplicationContext object is then assigned to WAC.

Webapplicationcontext is a class in the spring package
Webapplicationcontextutils is a tool class in the spring package
Getservletcontext () is a method of obtaining parameters in Struts2

Webapplicationcontext Wac=webapplicationcontextutils.getwebapplicationcontext (This.getServletContext ()); The meaning of the sentence

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.