:@RequestMapping ("/json") @ResponseBody public list json () { return userservice.getallusernames ();}Spring's role here is to inject the userservice needed by HomeController, run the program, and access the Http://localhost:8080/demo4springmvc-spring/json:["Zhangsan", "Lisi", "Wangwu"]SOURCE downloadAnother feature of spring is that AOP is not needed, and so on when the log is required to write, of course, spring itself has a lot of complex mechanisms, and later in the specific problem slow
action to judge whether there is ink is not human, it is contrary to the idea of object-oriented program design.If you use spring's AOP, it is to write the action as a facet, before each call different pen to write the method, call to determine whether there is ink method. It is defined by the label in the spring configuration file, in the form of:Here, Com.baidu.dao all the way to the beginning of the write to do a tangent, do the operation is to do with the following pointcut-ref= "Allmanager
, Fifth Floor, Boston, MA ~02110-1301USA,orSee theFSF site:http://www.fsf.org. -"urn:jboss:module:1.0"Name="Calculate"> "Calculate.jar"/> --Insert resources here--The emphasis is on the following Name property and the Resources child node and dependecies, which place the jar package file name, which places the dependency of this jar package.Once the above several files are ready, go to the Standalone\configuration folder and open the Standalone.xmlFind (113 rows or so), add code to this node,The
frame: jQuery1.9.CSS Framework: Bootstrap 4 MetronicClient authentication: Jqueryvalidation Plugin.Rich Text: CkecitorFile Management: CkfinderDynamic tab: JerichotabData table: Jqgriddialog box: JQuery jboxTree structure controls: JQuery ZtreeOther components: Bootstrap 4 metronic3. SupportServer middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source sw
frame: jQuery1.9.CSS Framework: Bootstrap 4 MetronicClient authentication: Jqueryvalidation Plugin.Rich Text: CkecitorFile Management: CkfinderDynamic tab: JerichotabData table: Jqgriddialog box: JQuery jboxTree structure controls: JQuery ZtreeOther components: Bootstrap 4 metronic3. SupportServer middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source sw
1. Jdk5.0-jdk.
JDK5 annotation, generics, variable parameters and autoboxing, it is difficult to give up after. and annotation more and more applications, if Springside still cling to JDK1.4, will be more and more limitations. If the user's application server only supports JDK1.4, you can use the Retrotranslator compatibility scheme.
2. Spring 2-j2ee Framework.
The Java EE full-stack Framework for the te
J2ee|web|web Services This article discusses how to reference Web services in the Java EE component and find Web services through Jndi. On the content organization, a EJB2.1 stateless session Bean is first published as a Web service, then a Web service client based on JSP is developed, and finally, it focuses on how to reference the Web service in JSP deployment, and discusses how to find and invoke Web ser
The Eclipse Java EE Development Environment Eclipse is an open source, powerful IDE development environment, plus his extension functionality, making it widely available. Java EE has several development environments, Eclipse+lomboz or eclipse+myeclipse. MyEclipse is a commercial product that is more powerful than the
Eclipse is an open source, powerful IDE development environment, plus his extended plug-in capabilities, making it widely available.Java EE has several development environments, Eclipse+lomboz or eclipse+myeclipse.MyEclipse is a commercial product that is more powerful than the Lomboz feature, especially in MVC development such as struts.To be able to test, you need to install a Web server, I'm using tomcatThe installation and configuration (Win32 pla
);//set the current date ACalendar.add (Calendar.day_of_month, 1);//days plus One - returnFormat.format (Calendar.gettime ()); -}Seven: Convert a JSON string to a Java object1 /** 2 * Get an array of Java objects from a JSON array, such as:3 * [{"id": Idvalue, "name": Namevalue}, {"id": Idvalue, "name": Namevalue}, ...] 4 * @paramObject5 * @paramClazz6 * @return 7 *
Definition of JDBC:Java Data Base Connectivity,java database connection; is a Java API for executing SQL statements;The steps of the JDBC operation: 1. Registration DriverClass.forName ();2. Get the connectionConnection xxx=drivermanager.getconnection ();3. Writing SQLString sql= "";4. Create PRECOMPILED statement performersPreparestatement yyy=xxx.preparestatement (Sql,username,password);5. Setting paramet
First, change the JDK default encoding to UTF-8, guaranteed to start the JVM does not appear Chinese garbled problem1, at compile time, if we do not specify the encoding format of our Java source program with the-encoding parameter, then Javac.exe first obtains the encoding format that our operating system uses by default.The JDK first obtains the operating system's file.encoding parameter (it holds the ope
relationships to achieve cascading saving7 customer.getorders (). Add (order);8 //the order object must be associated with the customer object for inverse to work9 Order.setcustomer (customer);Ten One ATransaction trans =session.begintransaction (); - Session.save (customer); - trans.commit (); the hibernateutils.closesession (); - - } -}In the preceding code, the statement "Order.setcustomer (Customer)" is used to implement the Associ
{pool.wait (); } Catch(interruptedexception e) {e.printstacktrace (); } returnGetconn (); }Else{//If there is a connection in the connection pool, the connection is assigned. Connection Con=Pool.removefirst (); System.err.println ("A few more:" +pool.size ()); returncon; } } }}5. The core class of the dynamic agent.(1) proxy class: Provides a dynamic method for creating dynamic proxy classes and instances, or a superclass of all dynamic proxy classes created by these met
space will occupy a lot of communication bandwidth, so the appropriate time also to compress the data. The separator parameter can play the role of a tuple that contains a string that splits the object.Print Json.dumps ([1,2,3,{' 4 ': 5, ' 6 ': 7}],separators= (', ', ': '))#indent参数是缩进的意思, it can make the format of data storage more elegant.Print Json.dumps ([1,2,3,{' 4 ': 5, ' 6 ': 7}],separators= (', ', ': '), indent = 4)2.decoding JSONJson.load (fp[, encoding[, cls[, object_hook[, parse_floa
In Java EE, the MODEL1 model is centered on JSP pages, the JSP is not only to make logical processing of the browser request (using JavaBean), access to the database to display the relevant pages.In the MODEL1 model, there is no servlet.The MODEL1 results are shown below:
Model1 maintainability Scalability is poor only for small projects.
Run the results first
goods.jsp
Picture of a product
); String SQL = "SELECT * from user" ; Map new Maphandler ()); // The result of the execution encapsulates only the first row. System.out.println (map); /* {id=0001, name=, age=12} */ Ix. Maplisthandler: Encapsulates each row of data into a map and saves it to a list. (Key to Master) Public voidTestselect_maplisthandler ()throwsSQLException {Queryrunner run=NewQueryrunner (DS); String SQL= "SELECT * from User"; ListNewMaplisthandler ()); /*** The result of this statem
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.