;This is a dependency injection on Sessionfactory, which is configured in spring, and then our service annotations@Service//is equivalent to defining a bean in spring, which is the way of annotating This is not configured, this is annotated, but has been given to spring hosting, so in the test class we can use directly, like thisProductservice Productservice = (productservice) cxt.getbean ("Productservicebean"); Take out an objectBecause annotated spring will help us manage this class."
One: garbledReason:Because the other classmates in the same group MyEclipse the default encoding method is GBK, and my default is UTF-8. So when I use SVN to submit the other students to the leader of the code to download down, it is all garbled!Solve the problem:I'm right here in window---"preferences-->general-->workspace--> here.I don't like to bring my cell phone in class. So my classmates helped me to check it!The result is a change of window---"
JSP directive:jsp Instruction (directive) is designed for the JSP engine, they do not directly produce any visible output, Instead, tell the engine how to handle the JSPOther parts of the pagePage instruction on the headerpageencoding= "Utf-8"%>Configuration Error page:XmlSolve Chinese garbled characters:pageencoding= "Utf-8"%>The page contains:The nine implicit objects of the JSP:After the JSP page is tra
)throwsioexception, servletexception { $ //gets the configuration parameters for the filterPanax NotoginsengString Encoding=config.getinitparameter ("encoding"); -String Loginpage=config.getinitparameter ("loginpage"); theString Prologin=config.getinitparameter ("prologin"); + //set the character set for request encoding a servletrequest.setcharacterencoding (encoding); theHttpServletRequest hreq=(httpservletrequest) servletrequest; +HttpSession Session=hreq.getsession (true); -
. println (""); out. println (""); out. println (""); //the data can be verified here.//pretending to have a databaseChectdao dao=NewChectdao (); if(Dao.check (userName, password)) { out. println ("Landing Success"); }Else{ out. println ("user name or password is wrong, please re-login"); } out. println (""); out. Flush (); out. Close (); } /** * The DoPost method of the servlet. */ Public voidDoPost (httpservletrequest request, httpservletresponse response) thr
database design of purchasing system9 Project information Setup and empowerment10 Procurement Type Management11 Tender Template Management12 Supplier Classification Management13 Examination Questions Management14 Examination Paper Management15 Supplier Management: Supplier base information, order management, supplier assessment16 Development of purchasing plan and procurement processSecond quarter: Customer relationship sales System1 Demand Analysis2 Database Design3 Sales project management an
RequestHandler returns between Response.client and server after processing is complete Communication: There are many communication protocols and technologies, such as Web SERVICE,EJB,JMS, where single Java NIO-based sockets are used, because of their asynchrony and high concurrency. The two basic criteria for using sockets are: 1. The number of threads on the server can be controlled, and the number of requests should not be linearly increased by 2
), according to the total score from high to low output to the console. Scanner sc = new Scanner (system.in); System.out.println ("Please enter 5 student grades are: (Name, language score, Math score, English score)"); Treesetts = new Treeset while (Ts.size ()
20. Summary
1.List
A. Normal for loop, using get ()
B. Call the iterator () method to get iterator, using the Hasnext () and Next () methods
C. Enhance for loop, as long as the class that ca
(String str) (temporarily not available)
int comparetoignorecase (String str) (Learn)
15. Common objects (string inversion)
A: Case Demo
Requirements: Reverse the string
Example: Keyboard entry "ABC"
Output result: "CBA"
16, common objects (in the large string to find the number of occurrences of the sequence of ideas)
A: Drawing Demo
Requirements: Count the number of occurrences of a large string
Method methods
17. Object-Oriented (learn the random number function of math class)
Open the help documentation provided by the JDK to learn
A:math class overview
class contains methods for performing basic mathematical operations
B:math class Characteristics
Because the math class is under the Java.lang package, there is no need for a guide package.
Because its members are all static, private construction methods
C: Method
=Servletcontextattributeevent.getservletcontext (); in //get the added property name and property value -String name=servletcontextattributeevent.getname (); toObject value=Servletcontextattributeevent.getvalue (); +System.out.println (application+ ") has removed the attribute" +name+ "with the value" +value+ "); - } the * $ @OverridePanax Notoginseng Public voidattributereplaced (servletcontextattributeevent servletcontextattributeevent) { -ServletContext application=Servletc
information in a map - Online.put (sessionid,user); theApplication.setattribute ("Online", online); * } $ }Panax Notoginseng } - the //This method is triggered when the session disconnects between the user and the server + @Override A Public voidsessiondestroyed (httpsessionevent httpsessionevent) { theHttpSession session=httpsessionevent.getsession (); +ServletContext application=Session.getservletcontext (); -String sessionid=Session.getid (); $Map"Online");
= Factory.newdocumentbuilder ();Parses the XML document and returns the file objectDocument document = Builder.parse ("src/book2.xml");* Write back* Get back to write factory class* Get Write-back Object* Callback method is called to write Back.Create a factory that writes back classesTransformerfactory transformerfactory = transformerfactory.newinstance ();Get Write-back ClassTransformer Transformer = Transformerfactory.newtransformer ();Method of calling write backTransformer.transform (new d
F.controller @RequestMapping ("/user" public Span style= "COLOR: #0000ff" >class Hellocontroller { // http://127.0.0.1 :8080/MYRESTFUL/USER/UPDATE/3 @RequestMapping (path="/update/{id} ", Method=requestmethod.put) public void upuser (@PathVariable ("id") int id,string name,string Location,printwriter pt) { // user modified System.out.println ("User performed update" +id+ "" +name+ "" +location); Pt.println ( "Hello World" G. Note: The Put method also needs to be configured in Web
1. Get the Project path: Request.getcontextpath ();2. Get the requested parameter: Request.getquerystring ();3. Specify the character encoding format for the request: Urlencoder.encode (text, "UTF-8");Configure the servlet parameter in 4.web.xml,To read this parameter in the servlet, override the Init method5.${} represents a JSP built-in object6.7.java.lang.threadlocal.get () method returns the value in the current thread copy of this thread's local
, configuring pointcuts and notifications There are very many types of configuration notifications insidethree. The proxy class and its own active annotation class Four. To import our classes as slicesThe configuration file is complete.Five, the class that is imported as a slice public class Myadvisor {public void test1 () {System.out.println ("This is Test ...");}}A very common category. The method name is in the configuration slice, and the notification time is complete. This will enable yo
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.