2013年10月30日星期三

We love to share --- most often meet questions (SSH aspect ) , " a "

 This post last edited by the zl3450341 on 2011-08-30 12:28:01
memories of the original interview , SSH aspects , asked many of the same problems , followed , it will be summed up by these interview questions , give some small children's shoes will summarize the interview , did not do the contrary, now is still so fire SSH .
we are forced to !
Struts1 works
Struts1 operating principle

1, initialize : struts framework for overall controller ActionServlet is a Servlet, which in web.xml configured to automatically start the Servlet, the overall controller reads the startup configuration file (struts-config.xml) configuration information for the struts in different modules initialize the corresponding object. ( Object-oriented )

2, sending a request : The user submits the form to the WEB server via a URL or submits a request , the requested data is passed to the web server using the HTTP protocol .

3, form filling : struts ActionServlet total control when the user submits the request data into the corresponding form object member variable.

4, the payment request : the controller according to the configuration information object ActionConfig distribute the request to a specific Action, corresponding formBean be passed in this Action excute () method .

5, handling business : Action generally only contain an excute () method, which is responsible for implementing the appropriate business logic ( call other business module ) returns after an ActionForward object . ActionForward object server forwards through the work .

6, returns the response : Action to different business processes result returns a response object to the total target controller .

7, find the response : The total processing operations controller based Action response object returned by the target , find the corresponding resource object , under normal circumstances for the jsp page .

8, in response to user : Target response object passes the results to resource object , the results presented to the user .
Struts1 advantages and disadvantages ( why use strust1)
1. Advantages:
① open source framework , a clear structure
② is the classic implementation of MVC (MVC is an idea , not a technology )
③ exception handling mechanism to achieve international
④ with powerful tag library
⑤ solve the JSP page there are a lot of JAVA code , easy to maintain them
⑥ in formBean will automatically submit , not to use the traditional get, set method to get the value , the value

2. Disadvantages:
① configure complex
② test is inconvenient
③ web container dependency
④ action is a single mode , you must set the thread-safe
Struts2 works
struts2 operating principle

1 client initializes a pointer to the Servlet container ( eg Tomcat) request
2 the request through a series of filters (Filter) ( These filters have a filter called ActionContextCleanUp optional , this filter Struts2 and other frameworks for the integration of helpful, for example : SiteMesh Plugin)
3 Next FilterDispatcher is called , FilterDispatcher please ask ActionMapper to decide whether you need to call this an Action
4 ActionMapper decide if you need to call an Action, FilterDispatcher processing of the request to ActionProxy
5 ActionProxy asking framework through Configuration Manager configuration file, find the need to call the Action class
6 ActionProxy create a ActionInvocation instance.
7 ActionInvocation instance naming scheme used to call , after the call to Action process , involving relevant interceptor (Intercepter) call.
8 Once the Action is finished , ActionInvocation responsible for the configuration struts.xml find the corresponding return results. Return result is usually ( but not always , it could be another one Action chain ) need to be expressed in a JSP or FreeMarker template . In that the process can be used Struts2 framework inherited label. In this process, the need to address ActionMapper

In the process all objects (Action, Results, Interceptors, etc. ) to create through ObjectFactory
Struts2 advantages and disadvantages ( ie why use struts2)
Struts2 will automatically validated. There are many, such as the International Resource files.
Struts2 development in the past, if you have not used any framework again , you can also quickly learn , adding to the Struts2 application development in the past, because it is simple enough .
large number of interceptors :
Struts2 itself provides a lot of reusable interceptors, such as type conversion interceptors, many times we get from the page parameter , this time it is of type String , we need to manually .
plug-in based framework :
Struts2 is a plug-in based framework , the community provides a lot of useful plug-ins, such as jfreechat / json , etc. Using these plug-ins can simplify our development , speed up the development progress.
struts2 greatest disadvantage than in a lot of web server to support the poor , for example, in websphere5.5, weblogic8.1 and earlier support is very investigation, the need to use the latest .
multiple views are supported:
support multiple views : jsp, freemarker, Veloctiy, as long as you wish, you can even make it easy to support the transformation pdf, with a project you can support a variety of views.
more modular :
compared with Struts1.X , Struts2 more modular , you can easily configure the information by function boundaries split into multiple files , easy to manage and develop teamwork .
integration with Spring :
compared with Struts1.x , Struts2 do not have to write your own singleton, further reducing the coupling between programs on Struts2 within itself, reducing the coupling of the framework itself .
based pojo easy to test :
In Struts1.x , I need out of this two Http Mock objects , makes it difficult to write unit tests for Action , compared with Struts1.x , Struts2 in Action is no longer dependent on the

HttpServletRequest and HttpServletResponse object that allows us to more easily write unit tests for Action .
Hibernate works
1. read and parse the configuration file
2. reads and parses the mapping information , create a SessionFactory
3. Open Sesssion
4. Creating Transaction Transation
5. persistence operations
6. commit the transaction
7. Close Session
8. closed SesstionFactory

Hibernate advantages and disadvantages
Benefits:
1: hibernate is based on open source technology ORMapping framework for lightweight JDBC package, using object-oriented thinking to manipulate the database .
2: hibernate provides session cache and secondary cache, the system does not require complex queries , the performance has improved.
3: Low -intrusive design

Disadvantages:
1: hibernate learning cost is too high .
2: not suitable for complex sql query ( statistics ) .
3: not suitable for a large number of aggregation operations ( stored procedure )
disadvantages added:
1, without writing SQL statements ( without editing JDBC), only need to operate the corresponding object on it, you can be able to store , update, delete , load objects that can improve production efficiency ;
2, because the use of Hibernate objects only need to operate on it, so we develop more objectified ;
3, using Hibernate, portability is good ( as long as the use of Hibernate standards development, replacing the database , you only need to configure the appropriate configuration files can, and do not need to do other tasks operation ) ;
4, Hibernate implements transparent persistence : When you save an object, the object does not inherit any class in Hibernate , implement any interface , just a pure simple object - called POJO objects ( object purest - this object does not inherit any third-party frameworks to achieve any of its classes and interfaces )
5, Hibernate is a framework without invasive , no invasive framework commonly known as lightweight framework
6, Hibernate code testing convenient.

------ Solution ------------------------------------ --------
good about struts1, 2 processes are talking about very fine . Recommended
------ For reference only ------------------------------------ ---
learned
------ For reference only ------------------------------ ---------

3Q beard ! ! !
------ For reference only ---------------------------------------
top one !
------ For reference only -------------------------------------- -
learning , thank you ! ! !
------ For reference only -------------------------------------- -
beard !!!
------ For reference only ----------------------------- ----------

------ For reference only ------------------------------------ ---
taught , thank you sharing
------ For reference only -------------------------- -------------
current projects as well as with the development of Struts1 thing ?
------ For reference only -------------------------------------- -
good ! lz good ah ! ! !
------ For reference only -------------------------------------- -
rare written in such full , help recommend .
------ For reference only -------------------------------------- -
struts1 and struts2 described here is very good , , , top, , , for the hibernate advantages and disadvantages , but also to do a summary , it is worth learning
------ For reference only ---------------------------------------
do not agree with some of the views
------ For reference only --------------------------------------- < br> top one
------ For reference only ---------------------------------- -----
such sharing is really good !
------ For reference only -------------------------------------- -

---- - For reference only ---------------------------------------
works are written very clearly . Under study .
------ For reference only -------------------------------------- -
see bearded to slightly
------ For reference only ----------------------------- ----------
learned
------ For reference only ----------------------- ----------------
....
------ For reference only --------------- ------------------------
 spare
------ For reference only --------------------- ------------------
really more to share ah ha ha
------ For reference only -------- -------------------------------
summarized in great detail !
------ For reference only -------------------------------------- -
direct collection
------ For reference only ------------------------------- --------
good ~ very powerful ~ ~
------ For reference only -------------------- -------------------
collection .
------ For reference only -------------------------------------- -
so hard Yeah , so hard Yeah
------ For reference only --------------------------- ------------
to score from
------ For reference only ------------------- --------------------
studied Thank landlord
------ For reference only --------- ------------------------------
SSH cattle ~
------ For reference only - --------------------------------------
problem is that you repeat the last part of it . . . . .
------ For reference only -------------------------------------- -
lz large cattle ......
------ For reference only ----------------- ----------------------
learned
------ For reference only ----------- ----------------------------
mark under study
------ For reference only --- ------------------------------------
good things, 3ks
--- --- For reference only ---------------------------------------
  The reply on 2011-08-30 09:49:25 deleted by moderator

------ For reference only ---------------------------------- -----
mark
------ For reference only ----------------------------- ----------
understanding.
------ For reference only -------------------------------------- -
learning , but the last paragraph of the landlord is not able to edit it , hibernate is repeated many , :)
------ For reference only ------------ ---------------------------
learn
------ For reference only ------ ---------------------------------
taught , thank you sharing
----- - For reference only ---------------------------------------
learn every day up
------ For reference only ------------------------------------- -
learn !
------ For reference only -------------------------------------- -

---- - For reference only ---------------------------------------
very detailed, I like !
------ For reference only -------------------------------------- -
Thank you ~
------ For reference only -------------------------------- -------
  The reply on 2011-08-30 16:20:26 deleted by moderator

------ For reference only ---------------------------------- -----
learned ......
------ For reference only -------------------------- -------------
Xiela , I 'm learning
------ For reference only ---------------- -----------------------
Thank you to share !
------ For reference only -------------------------------------- -
bearded V5 ~ finally can see the Java version active again .
------ For reference only -------------------------------------- -
how it did not spring this is the highlight !
------ For reference only -------------------------------------- -
detailed study of the Struts framework ~ ~ ~
------ For reference only ------------------------ ---------------
learn it
------ For reference only ------------------ ---------------------
top of it.
------ For reference only -------------------------------------- -
Good top up ! ! !
------ For reference only -------------------------------------- -
mark ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
------ For reference only -------------- -------------------------
good things to Favorites
------ For reference only ---------------------------------------
Kazakhstan this very well. .
------ For reference only ------------------------------------ ---
write very detailed, thank you !
------ For reference only -------------------------------------- -
marked, after the quasi lingua franca
------ For reference only --------------------------- ------------
good!
------ For reference only -------------------- -------------------
Good , worth recommending
------ For reference only ----------- ----------------------------
summary very good
------ For reference only --- ------------------------------------
gray often good
----- - For reference only ---------------------------------------
gray often thanks add up to increase their experience
------ For reference only ------------------------------ ---------
good post
------ For reference only ------------------------ ---------------
well studied
------ For reference only --------------- ------------------------
some
------ For reference only --------- ------------------------------
mark
------ For reference only ---- -----------------------------------
working principle is very important ah
---- - For reference only ---------------------------------------
study was made , top
------ For reference only ------------------------------------- -
up up
------ For reference only ---------------------------------------
thank lz look at the reinforcement
------ For reference only -------------------------------------- -
grateful. . .
------ For reference only -------------------------------------- -
learning , thank
------ For reference only ------------------------------ ---------
taught up ! ! ! ! ! ! ! ! ! ! Thank
------ For reference only ------------ ---------------------------
  This reply was moderator deleted at 2011-11-09 09:44:51

------ For reference only ---------------------------------- -----
O (∩ _ ∩) O Thank you, worry about what to what , these two days I was in the cold cold pine pine interview this
------ For reference only --- ------------------------------------
good, worth to learn . .
------ For reference only -------------------------------------- -
ready for work , and very useful !
------ For reference only -------------------------------------- -
quit after this time can be estimated to see
------ For reference only ------------------------- --------------
quit after this time can be estimated to see
------ For reference only ------------ ---------------------------
good ! Although long useless to SSH the
------ For reference only ------------------------------- --------
Thank you to share ! Taught up !
------ For reference only -------------------------------------- -
  This reply was moderator deleted at 2012-02-23 11:51:04

------ For reference only ---------------------------------- -----
right ah no SPRING Thank you for sharing

------ For reference only ---------------------------------- -----
I am cooking ! ! !
------ For reference only -------------------------------------- -
  This reply was moderator deleted at 2012-03-15 14:54:47

------ For reference only ---------------------------------- -----
  This reply was withheld at 2012-03-19 17:30:15 Delete

------ For reference only ---------------------------------- -----
learning , and keep for future use !
------ For reference only -------------------------------------- -
landlord hard
------ For reference only ------------------------------- --------
Oh things to remember to close
there are mistakes to be rolled back
Whether it ibatis also to introduce the next ah
------ For reference only ----------------------- ----------------
  This reply was moderator deleted at 2012-04-19 09:28:07

------ For reference only ---------------------------------- -----
are learning Struts2, read the works , he found himself to learn the details as well.
------ For reference only -------------------------------------- -
alas just out of school when the interview questions by these old pits
------ For reference only ---------------------------------------
  This reply was moderator deleted at 2012-06-11 09:16:02

------ For reference only ---------------------------------- -----
thanks for sharing !
------ For reference only -------------------------------------- -
top one thanks for sharing !
------ For reference only -------------------------------------- -
also write about spring thing

没有评论:

发表评论