??xml version="1.0" encoding="utf-8" standalone="yes"?>蜜臀精品久久久久久蜜臀,国产91精品一区二区麻豆网站 ,久久99精品久久久久久园产越南http://www.aygfsteel.com/HsiangYu/category/48417.htmlzh-cnFri, 29 Apr 2011 02:02:16 GMTFri, 29 Apr 2011 02:02:16 GMT60求职面试的六大自杀式回{?/title><link>http://www.aygfsteel.com/HsiangYu/archive/2011/04/29/349250.html</link><dc:creator>HsiangYu</dc:creator><author>HsiangYu</author><pubDate>Fri, 29 Apr 2011 01:52:00 GMT</pubDate><guid>http://www.aygfsteel.com/HsiangYu/archive/2011/04/29/349250.html</guid><wfw:comment>http://www.aygfsteel.com/HsiangYu/comments/349250.html</wfw:comment><comments>http://www.aygfsteel.com/HsiangYu/archive/2011/04/29/349250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/HsiangYu/comments/commentRss/349250.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/HsiangYu/services/trackbacks/349250.html</trackback:ping><description><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">很多人应聘不上去Q不是由于自׃够优UQ而是q个Z头到N而不舍的自杀所致?nbsp; <br /> <br /> 很多人应聘不上去Q不是由于自׃够优UQ而是q个Z头到N而不舍的自杀所致。这L人大概占C人数?0%?0%!</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">摘录一些最单的自杀式问题,希望有帮助?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">珍爱面试Q远自杀!</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">1.自杀式一Q奋不顾w?/strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">L单介l一下你自己Q?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我是一个很普通的?#8230;…</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">l你一个机会,是让你证明自己的优U?每一个都有闪光点Q关键是你如何寻找。但是这L回答让h觉得你连想都不想?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">L单介l一下你自己Q?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我今天准备得不太?#8230;… 你的意思是Q我q可以更好的。面试官听到的意思是Q没准备好还来干嘛,太不重我啦!(当年在新东方培训教师的时候,每当我听到这句话Q我们就_那请你准备好再来Q不要浪费大家的旉……)</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">2.自杀式二Q天׃ؕ?/strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">说说你的优点Q?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">(用一U熟l无比的不过大脑的声?我团l同学、尊重老师、热qzR兴多PU极d……</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">中国教育很多要求是变态的Q比如严肃活|在我看来是典型的精分裂。我自己在面试期_最郁闷的就是看到那些云集了中华文明5000q所有传l文化的人。优点不是越多越好,而是真实和独特好。很难想象一个h如何可以“团结同学”同时“独立研究Q刻苦钻?#8221;q要“U极投nC֛”?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">什么优炚w有的?= 没有优点</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">3.自杀式之三:我要学习</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">你希望通过q䆾工作获得什么呢?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我希望通过q䆾工作ȝ自己Q提升自q能力?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">同学Q公司又不是学校Q是希望你过来干zȝQ学习的目的也是更好的工作。你居然准备拿我们的工作Zl手和锻D?我们q是找一些更靠谱的h吧?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">4.自杀式之四:前途钱?/strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">你还有什么问题么?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我想问一下工资大概是多少?q能高些?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">一般来_工资完全可以在公司的|站、一般的行业|站扑ֈ。或者私下沟通。在大公叔R试的时候问q个问题不太合适。因为很多HR会认为,׃是一U双向选择Q你q没有展CZ的能力呢?我凭什么买?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">可以在基本意向确定以后再问。当Ӟp个问题,有不同意见。有说当场问昑־自己很有信心。在职h士的话,一定要谈薪酬?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">5.自杀式之五:我会努力!</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">你会如何面对你的新工?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">(眼神坚定Q满脔R红)我会认真努力Q尽全力做好?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">商业C会Q态度不等于能力。不你是全力以赴还是认真努力,没有辑ֈ目标Q也是无用。不你是心不在焉还是,只要最后达C公司要的l果Q那是好员工?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">你可以尝试提供你准备的具体的行动步骤和目标,否则q个问题基本{于没有回答?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; "><strong style="font-weight: bold; ">6.自杀式之六:我应?/strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">如果你给一?#8230;…的Q务,你会怎么?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我应该能够做?#8230;…</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">我应该能够做好,反过来说是Q做不好也不怪我?</p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">企业是用l果说话的,应该做好…… 那还有应该做不好地方怎么?q是一个责d的测试。但?#8220;应该”者失败了?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, sans-serif, Helvetica, Tahoma; font-size: 12px; line-height: 18px; ">你可以尝试谈谈,你会怎么做。如果做C会怎么P如果做不刎ͼ你会如何调整。保证在DEADLINE前获得底U结果?/p> <img src ="http://www.aygfsteel.com/HsiangYu/aggbug/349250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/HsiangYu/" target="_blank">HsiangYu</a> 2011-04-29 09:52 <a href="http://www.aygfsteel.com/HsiangYu/archive/2011/04/29/349250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SSH 常见面试?2http://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349162.htmlHsiangYuHsiangYuThu, 28 Apr 2011 02:55:00 GMThttp://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349162.htmlhttp://www.aygfsteel.com/HsiangYu/comments/349162.htmlhttp://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349162.html#Feedback0http://www.aygfsteel.com/HsiangYu/comments/commentRss/349162.htmlhttp://www.aygfsteel.com/HsiangYu/services/trackbacks/349162.html1.struts
Action是不是线E安全的Q如果不是,有什么方式可以保证Action的线E安全?如果是,说明原因

2.MVCQ分析一下struts是如何实现MVC?/p>

3.struts中的几个关键对象的作?说说几个关键对象的作?

4.spring
说说AOP和IOC的概念以及在spring中是如何应用?/p>

5.Hibernate有哪几种查询数据的方?/p>

6.load()和get()的区?/p>

回答Q?br /> 1.Struts1 Action是单例模式ƈ且必LU程安全的,因ؓ仅有Action的一个实例来处理所有的h。单例策略限制了Struts1 Action能作的事Qƈ且要在开发时特别心。Action资源必须是线E安全的或同步的?br /> Struts2 Action对象为每一个请求生一个实例,因此没有U程安全问题。(实际上,servlet容器l每个请求生许多可丢弃的对象,q且不会D性能和垃圑֛攉题)

2.struts是用一l类,servlet 和jsp规范实现mvc?/p>

3.ActionFrom ActionServlet Action struts-config.xml

4.spring的核心就是IOC,通过指定对象的创建办?描述对象与服务之间的关系,而不生成对象

5.3U?hql 条g查询() 原生sql

6.load()Ҏ认ؓ该数据一定存?可以攑ֿ的用代理来延时加蝲 ,如果使用q程中发C问题,抛出异?
get()Ҏ一定要获取到真实的数据,否则q回null

一些Spring和Hibernate的面试题(附答?

HibernateJava/J2EESpring

1?qC对IoCQInversion of ControlQ的理解Q描qC下Spring中实现DIQDependency InjectionQ的几种方式?/p>

2?Spring的Bean有多U作用域Q包括:

singleton、prototype、request、session、global session、application、自定义

3?单描qSpring framework与Struts的不同之处,整合Spring与Struts有哪些方法,哪种最好,Z么?

4?Hibernate中的update()和saveOrUpdate()的区?/p>

5?Spring对多UORM框架提供了很好的支持Q简单描q在Spring中用Hibernate的方法,q结合事务管理?/p>

{案Q?/p>

1、好莱坞原则€€€€不要打电话找我,我会打给你的。IoC创建的职责从应用程序代码搬C框架中。Spring对Setter注入和构造方法注入提供支持。(详见http://martinfowler.com/articles/injection.htmlQ以及http: //www.redsaga.com/spring_ref/2.0/html/beans.html#beans-factory- collaboratorsQ?/p>

2?除applicationQ详见Spring framework 2.0 Reference?.4节bean的作用域Q?/p>

3?Spring是完整的一站式框架Q而Struts仅是MVC框架Q且着重于MVC中的C。Spring有三U方式整合StrutsQ?Spring ?ActionSupport cL?StrutsQ?Spring ?DelegatingRequestProcessor 覆盖 Struts ?RequestProcessorQ将 Struts Action 理委托l?Spring 框架Q动作委托最好。(详见使用Spring 更好地处理Struts 动作Q?/p>

Spring 2.0新增一U方式:AutowiringRequestProcessor。(详见http://www.iteye.com/topic/24239Q?/p>

4?saveOrUpdate()Ҏ可以实现update()的功能,但会多些步骤Q具体如下:

如果对象在该session中已l被持久化,不进行操作;

对象的标识符属?identifier property)在数据库中不存在或者是个暂时的|调用save()Ҏ保存它;

如果session中的另一个对象有相同的标识符抛出一个异常;

以上皆不W合则调用update()更新之?/p>

5、在context中定义DataSourceQ创建SessionFactoyQ设|参敎ͼDAOcȝ承HibernateDaoSupportQ实现具体接口,从中获得HibernateTemplateq行具体操作?/p>

在用中如果遇到OpenSessionInView的问题,可以dOpenSessionInViewFilter或OpenSessionInViewInterceptor。(详见Spring framework 2.0 Reference?2.2节HibernateQ?/p>

声明式事务需声明事务理器,在context中设|指定属性,用确定和?/p>

请你谈谈SSH整合

HibernateJava/J2EESpringStruts

SSHQ?br /> StrutsQ表C层Q?SpringQ业务层Q?HibernateQ持久层Q?br /> StrutsQ?br /> Struts是一个表C层框架Q主要作用是界面展示Q接收请求,分发h?br /> 在MVC框架中,Struts属于VC层次Q负责界面表玎ͼ负责MVC关系的分发。(ViewQ沿用JSPQHTTPQFormQTagQResourse QControllerQActionServletQstruts-config.xmlQActionQ?br /> HibernateQ?br /> Hibernate是一个持久层框架Q它只负责与关系数据库的操作?br /> SpringQ?br /> Spring是一个业务层框架Q是一个整合的框架Q能够很好地黏合表示层与持久层?/p>

Spring如何创徏一个数据连接池

Java/J2EESpring

<bean id=”dataSource” class=”org.apache.commons.dbcp.BasicDataSource”>
<property name=”driver”>
<value>${db.driver}</value>
</property>
<property name=”url”>
<value>${db.url}</value>
</property>
<property name=”username”>
<value>${db.username}</value>
</property>
<property name=”password”>
<value>${db.password}</value>
</property>
</bean>

Spring如何获取Bean

Java/J2EESpring

通过xml配置文g

bean配置在xml里面Qspring提供多种方式d配置文g得到ApplicationContext.

W一U方式:FileSystemXmlApplicationContext

通过E序在初始化的时候,导入Bean配置文gQ然后得到Bean实例:
ApplicationContext ac = new FileSystemXmlApplicationContext(”applicationContext.xml”)
ac.getBean(”beanName”);

W二U方式:WebApplicationContextUtil

在B/Spȝ?通常在web.xml初始化bean的配|文Ӟ然后由WebAppliCationContextUtil得到ApplicationContext.例如Q?br /> ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletContext sc);
ApplicationContext ctx =   WebApplicationContextUtils.getWebApplicationContext(ServletContext sc);

其中 servletContext sc 可以具体 换成 servlet.getServletContext()或?this.getServletContext() 或?request.getSession().getServletContext();

另外Q由于spring是注入的对象攑֜ServletContext中的Q所以可以直接在ServletContext取出WebApplicationContext 对象Q?/p>

WebApplicationContext webApplicationContext = (WebApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

Spring框架有哪几部分组成?

Java/J2EESpring

Spring框架有七个模块组成组成,q?个模?或组?均可以单独存在,也可以与其它一个或多个模块联合使用Q主要功能表现如下:

?/strong> Spring 核心容器QCoreQ:提供Spring框架的基本功能。核心容器的主要lg是BeanFactoryQ她是工厂模式的实现。BeanFactory使用控制反{QIocQ模式将应用E序的配|和依赖性规范与实际的应用代码程序分开?/p>

?/strong> Spring AOPQ?/strong>通过配置理Ҏ,Spring AOP模块直接面向斚w的编E功能集成到了Spring框架中,所以可以很Ҏ的Spring框架理的Q何对象支?AOP。Spring AOP模块为基于Spring的应用程序中的对象提供了事务理服务。通过使用Spring AOPQ不用依赖于EJBlgQ就可以声明性事务管理集成到应用E序中?/p>

?/strong> Spring ORMQ?/strong>Spring框架集成了若qORM框架,从而提供了ORM的对象关pd?其中包括 JDO、Hibernate、iBatis和TopLink。所有这些都遵从Spring的通用事务和DAO异常层结构?/p>

?/strong> Spring DAOQ?/strong>JDBC DAO抽象层提供了有意义的异常层次的结构,可用该结构来理异常处理和不同数据供应商抛出的异帔R误信息。异常层ơ结构简化了错误处理Qƈ且大大的降低了需要编写的异常代码数量Q例如,打开和关p连接)。Spring DAO的面向JDBC的异帔R从通用的DAO异常层结构?/p>

?/strong> Spring WEBQ?/strong>Web上下文模块徏立在上下文模块(ContextQ的基础之上QؓZWeb服务的应用程序提供了上下文的服务。所以Spring框架支持 Jakarta Struts的集成。Web模块q简化了处理多部分请求及请求参数绑定到域对象的工作?/p>

?/strong> Spring上下文(ContextQ:Spring上下文是一个配|文Ӟ向Spring框架提供上下文信息。Spring上下文包括企业服务,例如 JNDI、EJB、电子邮件、国际化校验和调度功能?/p>

?/strong> Spring MVCQ?/strong>Spring的MVC框架是一个全功能的构建Web应用E序的MVC实现。通过{略接口QMVC框架变成为高度可配置的,MVC容纳的大量视图技术,包括JSP、Velocity、Tiles、iText和Pol

用Spring有什么好?/strong>

Java/J2EESpring

◆Spring能有效地l织你的中间层对?无论你是否选择使用了EJB。如果你仅仅使用了Struts或其他的包含了J2EEҎAPIs的frameworkQ你会发现Springx了遗留下的问题,?/p>

◆Spring能消除在许多工程上对Singleton的过多用。根据我的经验,q是一个主要的问题Q它减少了系l的可测试性和面向对象Ҏ?br /> ◆Spring能消除用各U各h式的属性定制文件的需?在整个应用和工程中,可通过一U一致的Ҏ来进行配|。曾l感到迷惑,一个特定类要查找迷q般的属性关键字或系l属?为此不得不读Javadoc乃至源编码吗Q有了SpringQ你可很单地看到cȝJavaBean属性。倒置控制的?在下面讨?帮助完成q种化?br /> ◆Spring能通过接口而不是类促进好的~程习惯Q减编E代价到几乎为零?br /> ◆Spring被设计ؓ让用它创徏的应用尽可能的依赖于他的APIs。在Spring应用中的大多C务对象没有依赖于Spring?br /> ◆用Spring构徏的应用程序易于单元测试?br /> ◆Spring能EJB的用成Z个实现选择,而不是应用架构的必然选择。你能选择用POJOs或local EJBs来实C务接口,却不会媄响调用代码?br /> ◆Spring帮助你解册多问题而无需使用EJB。Spring能提供一UEJB的替换物Q它们适于许多web应用。例?Spring能用AOP提供声明性事务而不通过使用EJB容器Q如果你仅仅需要与单个的数据库打交道,甚至不需要JTA实现?br /> ■Spring为数据存取提供了一致的框架,不论是用JDBC或O/R mapping产品Q如HibernateQ?br /> Spring实使你能通过最单可行的解决办法解决你的问题。这些特性是有很大h值的?br /> ȝhQSpring有如下优点:
◆低侵入式设计,代码污染极低
?独立于各U应用服务器Q可以真正实现Write Once,Run Anywhere的承?br /> ◆Spring的DI机制降低了业务对象替换的复杂?br /> ◆Springq不完全依赖于SpringQ开发者可自由选用Spring框架的部分或全部

Spring面试Q什么是Spring, 它有什么特?/strong>

Java/J2EESpring

Spring是一个轻量的控制反?IoC)和面向切?AOP)的容器框架?/p>

?strong style="font-weight: bold; ">轻量——从大小与开销两方面而言Spring都是轻量的。完整的Spring框架可以在一个大只?MB多的JAR文g里发布。ƈ且Spring所需的处理开销也是微不道的。此外,Spring是非侵入式的Q典型地QSpring应用中的对象不依赖于Spring的特定类?/p>

?strong style="font-weight: bold; ">控制反{——Spring通过一U称作控制反转(IoCQ的技术促q了松耦合。当应用了IoCQ一个对象依赖的其它对象会通过被动的方式传递进来,而不是这个对象自己创建或者查找依赖对象。你可以认ؓIoC与JNDI相反——不是对象从容器中查找依赖,而是容器在对象初始化时不{对象请求就d依赖传递给它?br /> ?strong style="font-weight: bold; ">面向切面——Spring提供了面向切面编E的丰富支持Q允讔R过分离应用的业务逻辑与系l服务Q例如审计(auditingQ和事务Q)理Q进行内聚性的开发。应用对象只实现它们应该做的——完成业务逻辑——仅此而已。它们ƈ不负责(甚至是意识)其它的系lx点,例如日志或事务支持?br /> ?strong style="font-weight: bold; ">容器——Spring包含q管理应用对象的配置和生命周期,在这个意义上它是一U容器,你可以配|你的每个bean如何被创建——基于一个可配置原型QprototypeQ,你的bean可以创徏一个单独的实例或者每ơ需要时都生成一个新的实例——以及它们是如何怺兌的。然而,Spring不应该被混同于传l的重量U的EJB容器Q它们经常是庞大与笨重的Q难以用?br /> ?strong style="font-weight: bold; ">框架——Spring可以简单的lg配置、组合成为复杂的应用。在Spring中,应用对象被声明式地组合,典型地是在一个XML文g里。Spring也提供了很多基础功能Q事务管理、持久化框架集成{等Q,应用逻辑的开发留l了你?/p>

HsiangYu 2011-04-28 10:55 发表评论
]]>
SSH 常见面试?1http://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349160.htmlHsiangYuHsiangYuThu, 28 Apr 2011 02:47:00 GMThttp://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349160.htmlhttp://www.aygfsteel.com/HsiangYu/comments/349160.htmlhttp://www.aygfsteel.com/HsiangYu/archive/2011/04/28/349160.html#Feedback0http://www.aygfsteel.com/HsiangYu/comments/commentRss/349160.htmlhttp://www.aygfsteel.com/HsiangYu/services/trackbacks/349160.htmlHibernate工作原理及ؓ什么要用?   
原理Q?nbsp;    
1.dq解析配|文?nbsp;    
2.dq解析映信息,创徏SessionFactory     
3.打开Sesssion     
4.创徏事务Transation     
5.持久化操?nbsp;    
6.提交事务     
7.关闭Session     
8.关闭SesstionFactory     
  
Z么要用:     
1. 对JDBC讉K数据库的代码做了装Q大大简化了数据讉K层繁琐的重复性代码?nbsp;    
2. Hibernate是一个基于JDBC的主持久化框架Q是一个优U的ORM实现。他很大E度的简化DAO层的~码工作     
3. hibernate使用Java反射机制Q而不是字节码增强E序来实现透明性?nbsp;    
4. hibernate的性能非常好,因ؓ它是个轻量框架。映的灉|性很。它支持各种关系数据库,从一对一到多对多的各U复杂关pR?nbsp;    
  
2Q?Hibernate是如何gq加?     
1. Hibernate2延迟加蝲实现Qa)实体对象 b)集合QCollectionQ?nbsp;    
2. Hibernate3 提供了属性的延迟加蝲功能Q当Hibernate在查询数据的时候,数据q没有存在与内存中,当程序真正对数据的操作时Q对象才存在与内存中Q就实现了gq加载,他节省了服务器的内存开销Q从而提高了服务器的性能?nbsp;    
3QHibernate中怎样实现cM间的关系?(如:一对多、多对多的关p?     
cMcM间的关系主要体现在表与表之间的关p进行操作,它们都市对对象进行操作,我们E序中把所有的表与c都映射在一P它们通过配置文g中的many-to-one、one-to-many、many-to-many?nbsp;    
  
4Q?说下Hibernate的缓存机?nbsp;    
1. 内部~存存在Hibernate中又叫一U缓存,属于应用事物U缓?nbsp;    
2. 二~存Q?nbsp;    
a) 应用及缓?nbsp;    
b) 分布式缓?nbsp;    
条gQ数据不会被W三方修攏V数据大在可接受范围、数据更新频率低、同一数据被系l频J用、非 关键数据     
c) W三方缓存的实现     
  
5Q?Hibernate的查询方?nbsp;    
Sql、Criteria,object comptosition     
HqlQ?nbsp;    
1?属性查?nbsp;    
2?参数查询、命名参数查?nbsp;    
3?兌查询     
4?分页查询     
5?l计函数     
  
6Q?如何优化HibernateQ?nbsp;    
1.使用双向一对多兌Q不使用单向一对多     
2.灉|使用单向一对多兌     
3.不用一对一Q用多对一取代     
4.配置对象~存Q不使用集合~存     
5.一对多集合使用Bag,多对多集合用Set     
6. l承cM用显式多?nbsp;    
7. 表字D要,表关联不要怕多Q有二~存撑腰     
  
  
7Q?Struts工作机制Qؓ什么要使用StrutsQ?nbsp;    
工作机制Q?nbsp;    
Struts的工作流E?     
在web应用启动时就会加载初始化ActionServlet,ActionServlet?nbsp;    
struts-config.xml文g中读取配|信?把它们存攑ֈ各种配置对象     
当ActionServlet接收C个客戯求时,执行如下流E?     
  -(1)索和用户h匚w的ActionMapping实例,如果不存?p回请求\径无效信?     
  -(2)如果ActionForm实例不存?创Z个ActionForm对象,把客h交的表单数据保存到ActionForm对象?     
  -(3)Ҏ配置信息军_是否需要表单验?如果需要验?p用ActionForm的validate()Ҏ;     
  -(4)如果ActionForm的validate()Ҏq回null或返回一个不包含ActionMessage的ActuibErrors对象, pC单验证成?     
  -(5)ActionServletҎActionMapping所包含的映信息决定将h转发l哪个Action,如果相应?Action实例不存?先创徏q个实例,然后调用Action的execute()Ҏ;     
  -(6)Action的execute()Ҏq回一个ActionForward对象,ActionServlet在把客户h转发l?ActionForward对象指向的JSPlg;     
  -(7)ActionForward对象指向JSPlg生成动态网?q回l客?     
  
Z么要用:     
JSP、Servlet、JavaBean技术的出现l我们构建强大的企业应用pȝ提供了可能。但用这些技术构建的pȝ非常的繁乱,所以在此之上,我们需要一个规则、一个把q些技术组lv来的规则Q这是框架QStruts便应q而生?nbsp;    
ZStruts开发的应用?cȝ件构成:控制器组件、模型组件、视囄?nbsp;    
  
8Q?Struts的validate框架是如何验证的Q?nbsp;    
在struts配置文g中配|具体的错误提示Q再在FormBean中的validate()Ҏ具体调用?nbsp;    
  
9Q?说下Struts的设计模?nbsp;    
MVC模式: web应用E序启动时就会加载ƈ初始化ActionServler。用h交表单时Q一个配|好的ActionForm对象被创建,q被填入表单相应的数据,ActionServlerҎStruts-config.xml文g配置好的讄军_是否需要表单验证,如果需要就调用ActionForm的ValidateQ)验证后选择请求发送到哪个ActionQ如果Action不存在,ActionServlet会先创徏q个对象Q然后调用Action的executeQ)Ҏ。ExecuteQ)从ActionForm对象中获取数据,完成业务逻辑Q返回一个ActionForward对象QActionServlet再把客户h转发lActionForward对象指定的jsplgQActionForward对象指定的jsp生成动态的|页Q返回给客户?nbsp;    
  
10Q?spring工作机制及ؓ什么要?     
1.spring mvch有的h都提交给DispatcherServlet,它会委托应用pȝ的其他模块负责负责对hq行真正的处理工作?nbsp;    
2.DispatcherServlet查询一个或多个HandlerMapping,扑ֈ处理h的Controller.     
3.DispatcherServlet误求提交到目标Controller     
4.Controllerq行业务逻辑处理后,会返回一个ModelAndView     
5.Dispathcher查询一个或多个ViewResolver视图解析?扑ֈModelAndView对象指定的视囑֯?nbsp;    
6.视图对象负责渲染q回l客L?nbsp;    
  
Z么用Q?nbsp;    
{AOP 让开发h员可以创建非行ؓ性的x点,UCؓ横切x点,q将它们插入到应用程序代码中。?AOP 后,公共服务 Q比 如日志、持久性、事务等Q就可以分解成方面ƈ应用到域对象上,同时不会增加域对象的对象模型的复杂性?nbsp;    
  IOC 允许创徏一个可以构造对象的应用环境Q然后向q些对象传递它们的协作对象。正如单?倒置 所表明的,IOC 像?q来?JNDI。没有用一堆抽象工厂、服务定位器、单元素QsingletonQ和直接构造(straight constructionQ,每一个对象都是用其协作对象构造的。因此是由容器管理协作对象(collaboratorQ?nbsp;    
Spring即一个AOP框架Q也是一IOC容器?Spring 最好的地方是它有助于您替换对象。有?SpringQ只要用 JavaBean 属性和配置文g加入依赖性(协作对象Q。然后可以很Ҏ地在需要时替换hcM接口的协作对象。}  

HsiangYu 2011-04-28 10:47 发表评论
]]>
վ֩ģ壺 ƽ| | | | лͨ| | ֹ| | Ϫ| | ԭ| | | Զ| | | ̨| | | | ʵ| տ| | ԣ| | | | ɽ| ԭ| | | | ƽԶ| ľ| ʮ| | | Ϫ| | | ³|