J2EE Learning Notes (1) Open http://blog.9cbs.net/smallfox/
Welcome everyone and I discuss with me YcmloveYou@yahoo.com has a good suggestion or have any questions about my notes, please point out. Thank you - the most basic common sense - cookie stores the dialog data to the client, send it to each request. Session stores the dialog data to the server side, only the sessionID is stored in cookie, this method has better security The server requirements are also higher. Based on this, Struts's default Scope is Request instead of session. The programmer should use the Request Scope to reduce the server burden when transmitting data between the program. - A common sense of common sense - - JSP built with Struts contains HTML, JavaScript, JSP Scriptlet, and Struts tags, execution time is JSP scriptlet -> tag library -> html js. So HTML and JS code can nested, in Struts Tag It is also possible to nested the Scriptlet code, but it is wrong. It is often used in the practical application to display Bean Property content in the case of HTML to display bean Property content. It is a typical example - the most important software engineering practice - application Struts JSP It is absolutely no longer doping with Strongly Discouraged, and the Scriptlet is only available for logic processing that is completely used for Presentation, and business logic should be put to Action / EJB / DAO layer processing. Write in JSP even a little business logic Will make the future maintenance pay a high price.
J2EE Learning Notes (2) JavaScript Discussion
In fact, JavaScript does not belong to strict J2EE categories, but because of its lightweight and powerful client function, we have to give three points to JavaScript. Below is some of my very limited JavaScript experience 1) JavaScript is mainly used to capture customers End event, data table verification, control page jump orientation. Each item has enough connotation can be excavated, here don't say 2) If you check it, it is generally said that the server is still doing again. One test to ensure the consistent and effectiveness of the data (prevent clients from deliiting JavaScript check) 3) JavaScript is very powerful, but not universal, for example, in many cases, it is not possible to use JS back to the previous page (History.back ()), The reason is mainly to prevent repeated submission forms, generally use Action to direct the initialization activity method for the current page (typical example is xxxaction.do?method=inityyy
J2EE Learning Notes (3) Struts Logic Tags
Logic tags
Grammar applications -
1) Value Comparison Value Comparison: Equal, Notequal, GreateRequal, Lessequal, Lessthan, Greaterthan comparison logic is trying to be a long double, and compare; if Parse fails, use string.equalto () comparison
1) Value Compare Value Comparison: Present, NotPresent, EMPTY, NOTEMPTYPRESENT is seen whether a variable / instance is existing in a qualified range, and EMPTY is NULL, "", or collection.isempty () == TRUE (ONLY for Collection)
2) Sub string matches Substring Matching: Match, notmatchmatch / notmatch also has an optional location to specify that the substring must appear on the start of the string or end (location = "start / end")
3) Presentation location: Forward, Redirect is unclear
4) Collection Utilities: iterate (common electrode)
The boss of J Dao Banq once said that the design model is to measure the high and low of the programmer level. Personally agree with this point of view, learn from this angle J2EE first to understand is a huge complex system, how is it assembled by each module and operates together. To warm up to a few definitions Definitions of Different Dimensions in J2EE Tiers:. A logical or physical organization of components into an ordered chain of service providers and consumers Components within a tier typically consume the services of those in an "adjacent" provider tier . and provide services to one or more "adjacent" consumer tiers Within a tier, services are grouped to like requirements, such as functionality, security, or load distribution Layers:. The hardware and software stack that hosts services within a given tier Physical. , network, and software platforms and standard API sets support the components that provide a service. Layers, like tiers, represent a well-ordered relationship across boundaries that are mediated by interfaces. Whereas tiers represent processing chains across components, layers represent container / component The concept of Relationships in Implementation and Deployment Of Services. The concept of tiers layer is what we are most often listened. Generally, it can be divided into (customer) <- interactive ---> [Client Interface --- Presentation tier --- BizLogic Tier --- Integration Tier --- Resource Tier] Client Interface typical customer interface is IE, Swing, Applet, WAP, etc., the customer is responsible for accepting customer requests and returning the corresponding processing result. Login, permission check, session management here, from the technical perspective, business logic tier, such as JSP HTML, responsible for handling business logic and data, is the core of J2EE, which also manages transaction Transaction, EJB, etc. Business logic layer and system resource layer, the most common JDBC database connection is an example resource tier responsible for providing resources required for the upper layer, such as database, file system, legacy system, etc. combined with practical applications and design patterns, we can further divide the hierarchy . Multi-level will reduce efficiency, which will also result in a lot of seemingly "unused" code, but these code achieve low coupling to reduce post-maintenance costs. 1) Presentation tier Apply MVC mode, separating the program process controller (VIEW), and data, such as Struts is one of them.
Filtering and User-Role-Priviledge-Resource are often used (specific to new stickers) 2) Business logic tier and presentation Tier's low coupling by Business delegate layer, typical example businessdelegate -> Businessmgr (EJB ) -> ... and FACADE mode often used here to make packages. Main reference: Software architecture mode In J2EE application Main reference items: Medlog logistic pace2 SCSJ2EE Learning Notes (5) Implementation of Role Permissions Resource Management
The article will be published in recent updates. Main reference: http://www.jdon.com/Jive/Article.jsp?forum=46&thread=2897 http://www.jdon.com/jive/Article.jsp?forum=46&thread=4110&Message=438816 http: //www.jdon.com/Jive/Article.jsp?forum=46&thread=10122
J2EE Learning Notes (6) Struts HTML Tags
HTML Tags
Some public Tag Attributes are consistent before and after the meaning of HTMLTaglib, they are name: Actionform Bean instance names, if Name does not exist,
Slowly add later. . .
Message (error) display
ActionMessages messages = new ActionMessages (); messages.add (ActionMessages.GLOBAL_MESSAGE, new ActionMessage ( "userForm.insert", info.getUserName ()); messages.add ( "activationDate", new ActionMessage ( "userForm.active", info .getdateLength ());
All messages can be displayed as follows, put them into one list, plus customizable header / footer
As can be specified as follows: only displays a Message