1. Use of technology
Java JSP JS Shiro CAs SOLR
2. Arrangement of programming ideas
1) Login
1. Login with SSO:
A): SSO performs login verification, login page Sso,sso through user name, password, verification code to find out if the database validation is valid
b): Login successful, SSO carry ticket jump to target project (service= "Http:xxxxx")
c): The Myrealm class (login, permission validation) is then executed in the project for login verification.
d): Login verification succeeded or failed to execute mycasfilter after successful login or after failure of the corresponding method.
E): In the successful login method, get the user name, through the user name to find out the user's other information and into the session
F): The method of successful login also needs to query the current (user, System) permissions menu.
2. Normal Login:
Perform OnStart session--Perform the Createtoken
Logon authentication performed---Login successful (failed execution)
2) New
A) First write the controller, jump to input.jsp (New page). Now the button binds the Add () method, location.href= "xxxxx".
b) Modify the static page, add the <form></form> tag, add the Name property to the field input to fill, and the field receive attribute corresponding to the Save method
c) Write Valide form verification method (non-empty, format, etc.)
d) Write the Commit method and submit
Attention:
Sometimes after the new page has the Add Attachment button, this needs to be the ID of Mr., with the generated ID passed to the Attachment management module. The input property is typically defined by the ID and name, and the ID is used for the JS location operation (DOM). Hidden the hidden field with the input property, which does not need to be displayed but needs to be passed.
3) Modify
A) The general operation process is, in the list Operation column, click the Modify button, get the information ID to access the controller layer, and then the ID to the service layer, based on the ID query
Change the information object, bind the object with Requeset, and upload to edit.jsp (Modify page).
b) Using the EL expression, parse the object into the input box, and the ID value is stored in the Hidden hidden field.
c) Click the "Save" button, you can use the Ajax method, call the controller layer in the update methods, return TRUE or Fasle.
e) The return value is true, the page jumps, and the return value is false, prompting for an error message.
4) Query
A) List of page display page, generally have a specific field fuzzy query, the main fields, time, etc., the general time is segmented query, and other for fuzzy query
5) Delete
A) The deletion method is usually used AJAX based on the ID to delete, after the successful deletion, re-refresh the table.
b) Before deleting the general prompt confirm, "whether delete", after deleting the prompt "whether delete succeeded."
c) Similar function module, the information to submit, publish, call back.
6) Full Text Search
A) Full-text search is generally used in Web project platform display, commonly used framework: LUCENE/SOLR;
b) SOLR is a full-text retrieval server based on Lucene and is very easy to use
c) First download the Solr,linux or Windows version on the Apacha website
b) configuration deployment in Tomcat or directly publish SOLR (built-in jetty server)
d) Create the core with command-line Operations (Control Panel creation Core sometimes fails)
e) Run SOLR, default port 8983, whether browser access is successful
f) Configure SOLR fields: Core/conf/managed-schema republish
g) Java-side writing: Requires Jar package Solrj/jsoup (for removing HTML tags), writing class Solrhandler.java
f) Control class: Reset index, delete index, add index, query
h) Summary: The use of SOLR is the need to create an index of the list to SOLR processing, need to use when the query from SOLR, SOLR provides the API call method (set the address. Core_name), the current rebuild index is to delete all the original indexes in the re-created process (can be optimized), general settings automatically create indexes at night, using the scheduler.
7) News Approval
A:ajax loading the message All instructions information, pagination display
B: Pinned, unpin, modify operation using AJAX, successful operation, reload data
C: If not logged in the user can not see, for this judgment, do not load data, hide change div
D: Information List page title to add the label "signed" text can be in the background splicing
E: Shiro label for permission control
7) Data Check
Foreground check:
Refers to the use of JS, to determine whether it is empty, cell phone, mailbox and other formats are correct
A) define Validate.js
b) The method first defines n flag = false;
c) Each verification (according to the rules, not NULL, etc.), by flag= True, does not pass flag= false.
e) Finally, returns true if the defined flag is true, otherwise false;
f) Verifying phone and mailbox regular expressions
var Telephoneregex =/^ (13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]) [0-9]{8}$/;
var Mailregex =/^\s*\w+ (?: \. {0,1} [\w-]+) *@[a-za-z0-9]+ (?: [-.] [a-za-z0-9]+] *\. [a-za-z]+\s*$/;
Background check
A) custom check: the need to check the database query, such as: whether duplicate, and so on.
b) Data Verification framework: Oval can be used to define the VO on the receiving data, such as: null, format, byte length, etc.
8) Front End Components Summary:
a) Table: DataTables
B) Rich text: Kindeditor (easy to configure), editor
c) Popup: Layer
D) Beautify the dropdown box, Radio box: Select-or-die
E) Time class: My97datepicker
&nbs p; f) Tree: Ztree
g) Paging: Jqpaginator, pagination
h) Chart class: Echart