ArticleDirectory
Java syntax
// Example of a wildcard, call // bar OBJ = new bar <videoinfo> (); // arraylist <videoinfo> List = obj. render (Service, album. GETID (); Class bar <t> {public arraylist <t> render (Service, int albumid) {albuminfoservice videolist_service = (albuminfoservice) service. getserviceincache (); Map <string, Object> videolist = videolist_service.findvideosbyalbum (albumid, 0, 10 ). getvideos (); arraylist <t> List = (arraylist <t>) videolist. get ("Results"); return list; // long totalcount = (long) videolist. get ("totalcount ");}}
Traverse map:
For (Java. util. Map. Entry mapentry: responsedata. entryset () {key = mapentry. getkey (); Value value = mapentry. getvalue ();}
Reflection requires java. Lang. Reflect .*
Class article extends baseservice <articleinfo> {public void F () {class clazz = This. getclass (); method [] Methods = clazz. getmethods (); For (method: Methods) {If (method. getname (). equals ("findbyid") {system. out. println ("---"); system. out. print (method. getreturntype (). getname () + "" + method. getname () + ""); Class <?> [] Types = method. getparametertypes (); For (class <?> Type: types) {system. Out. Print (type. getname () + "") ;}system. Out. println ();}}}}
Struts
From webwork to version 2.0, It is struts. Now the company's WAP project is in use, and finally let me have a learning opportunity.
The learning is mainly based on the template language.
Basic Flow statement:
<S: If test = "% {false}"> <div> will not be executed </div> </S: If> <s: elseif test = "% {true}"> <div> will be executed </div> </S: elseif> <s: else> <div> will not be executed </div> </S: else>
The character length exceeds the limit. If the number exceeds 28, it is automatically intercepted and displayed .......
<P class = "listdescription"> <s: If test = "description. length ()> 28 "> <s: property value =" description. substring (0, 28) + '...... '"/> </S: If> <s: else> <s: property value =" Description "/> </S: else> </P>
How do I transmit PARAMETERS ON THE include page?
<! -- Return entry --> <s: Set Name = "variable" value = "'album '"/> <s: set Name = "variable2" value = "'details'"/> <% @ include file = "public_new/returnbar. JSP "%> <! -- // Return result -->
The introduced page is as follows:
<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8" pageencoding = "UTF-8" %> <! -- Return entry --> <Div class = "returnbar"> <Div class = "gobackbtn" Title = "back to previous page" onclick = "history. go (-1); "> </div> <a href = ". "Title =" back to home "> <Div class =" homebtn "> </div> </a> <s: property value =" # variable "/> <s: property value = "# variable2"/> </div> <! -- // Return result -->