- 浏览: 488333 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (672)
- 随便写写 (3)
- javascript (16)
- Java exam (58)
- JSP exam (25)
- Servlet exam (25)
- Struts exam (24)
- Spring exam (24)
- Hibernate exam (19)
- EJB exam (25)
- SOA exam (6)
- AJAX exam (25)
- Web开发 exam (25)
- 软件工程 exam (25)
- 项目管理 exam (25)
- .NET exam (23)
- ASP.NET exam (24)
- C# exam (24)
- C++ exam (25)
- C语言 exam (13)
- ASP exam (0)
- PHP exam (0)
- Ruby exam (0)
- Python exam (0)
- Delphi exam (0)
- Linux exam (0)
- UNIX exam (25)
- 数据库 exam (24)
- Oracle exam (25)
- SQL Server exam (20)
- MySQL exam (16)
- Mobile开发 exam (10)
- 嵌入式开发 exam (6)
- 网络安全 exam (0)
- 网络技术 exam (0)
- 综合技术 exam (0)
- HR面试 exam (0)
- 英语面试 exam (0)
- 外企面试 exam (0)
- 软件测试 exam (0)
- QTP exam (0)
- LoadRunner exam (0)
- 网友面经 exam (0)
- 应届生 exam (0)
- 面试指导 exam (0)
- IQ测试 exam (0)
- Flex exam (2)
- uml-ea (1)
最新评论
-
dxking100:
远光没有笔式题的说..
最新远光软件笔试题面试题内容(1) -
heming_way:
谢谢,正在复习软件工程考试呢,呵呵
《软件工程》选择题 -
梅玲达:
可以更详细点吗?
Hibernate中Criteria 和DetachedCriteria的作用是什么? -
buptjian:
学习下,试试看,谢谢啊~
Prototype如何实现页面局部定时刷新? -
bubblegum89:
这个。。。和我笔试时候做的 感觉完全不一样
最新远光软件笔试题面试题内容(3)
Question: Why cant we overide create method in StatelessSessionBean?
Answer: From the EJB Spec : - A Session bean's home interface defines one or morecreate(…) methods. Each create method must be named create and must match one of the ejbCreate methods defined in the enterprise Bean class. The return type of a create method must be the enterprise Bean's remote interface type. The home interface of a stateless session bean must have one create method that takes no arguments.
Question: Is struts threadsafe?Give an example?
Answer: Struts is not only thread-safe but thread-dependant. The response to a request is handled by a light-weight Action object, rather than an individual servlet. Struts instantiates each Action class once, and allows other requests to be threaded through the original object. This core strategy conserves resources and provides the best possible throughput. A properly-designed application will exploit this further by routing related operations through a single Action.
Question: Can we Serialize static variable?
Answer: Serialization is the process of converting a set of object instances that contain references to each other into a linear stream of bytes, which can then be sent through a socket, stored to a file, or simply manipulated as a stream of data. Serialization is the mechanism used by RMI to pass objects between JVMs, either as arguments in a method invocation from a client to a server or as return values from a method invocation. In the first section of this book, There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are
1. Serialization ignores static fields, because they are not part of any particular object's state.
2. Base class fields are only handled if the base class itself is serializable.
3. Transient fields. There are four basic things you must do when you are making a class serializable. They are:
1. Implement the Serializable interface.
2. Make sure that instance-level, locally defined state is serialized properly.
3. Make sure that superclass state is serialized properly.
4. Override equals( )and hashCode( ).
it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process …. (Source: http://www.oreilly.com/catalog/javarmi/chapter/ch10.html)
Question: What are the uses of tiles-def.xml file, resourcebundle.properties file, validation.xml file?
Answer: tiles-def.xml is is an xml file used to configure tiles with the struts application. You can define the layout / header / footer / body content for your View. See more at http://www.roseindia.net/struts/using-tiles-defs-xml.shtml.
The resourcebundle.properties file is used to configure the message (error/ other messages) for the struts applications.
The file validation.xml is used to declare sets of validations that should be applied to Form Beans. Fpr more information please visit http://www.roseindia.net/struts/address_struts_validator.shtml.
Question: What is the difference between perform() and execute() methods?
Answer: Perform method is the method which was deprecated in the Struts Version 1.1. In Struts 1.x, Action.perform() is the method called by the ActionServlet. This is typically where your business logic resides, or at least the flow control to your JavaBeans and EJBs that handle your business logic. As we already mentioned, to support declarative exception handling, the method signature changed in perform. Now execute just throws Exception. Action.perform() is now deprecated; however, the Struts v1.1 ActionServlet is smart enough to know whether or not it should call perform or execute in the Action, depending on which one is available.
Question: What are the various Struts tag libraries?
Answer: Struts is very rich framework and it provides very good and user friendly way to develop web application forms. Struts provide many tag libraries to ease the development of web applications. These tag libraries are:
* Bean tag library - Tags for accessing JavaBeans and their properties.
* HTML tag library - Tags to output standard HTML, including forms, text boxes, checkboxes, radio buttons etc..
* Logic tag library - Tags for generating conditional output, iteration capabilities and flow management
* Tiles or Template tag library - For the application using tiles
* Nested tag library - For using the nested beans in the application
Question: What do you understand by DispatchAction?
Answer: DispatchAction is an action that comes with Struts 1.1 or later, that lets you combine Struts actions into one class, each with their own method. The org.apache.struts.action.DispatchAction class allows multiple operation to mapped to the different functions in the same Action class.
For example:
A package might include separate RegCreate, RegSave, and RegDelete Actions, which just perform different operations on the same RegBean object. Since all of these operations are usually handled by the same JSP page, it would be handy to also have them handled by the same Struts Action.
A very simple way to do this is to have the submit button modify a field in the form which indicates which operation to perform.
<html:hidden property=”dispatch” value=”error”/>
<SCRIPT>function set(target) {document.forms[0].dispatch.value=target;}</SCRIPT>
<html:submit onclick=”set('save');”>SAVE</html:submit>
<html:submit onclick=”set('create');”>SAVE AS NEW</html:submitl>
<html:submit onclick=”set('delete);”>DELETE</html:submit>
Then, in the Action you can setup different methods to handle the different operations, and branch to one or the other depending on which value is passed in the dispatch field.
String dispatch = myForm.getDispatch();
if (”create”.equals(dispatch)) { …
if (”save”.equals(dispatch)) { …
The Struts Dispatch Action [org.apache.struts.actions] is designed to do exactly the same thing, but without messy branching logic. The base perform method will check a dispatch field for you, and invoke the indicated method. The only catch is that the dispatch methods must use the same signature as perform. This is a very modest requirement, since in practice you usually end up doing that anyway.
To convert an Action that was switching on a dispatch field to a DispatchAction, you simply need to create methods like this
public ActionForward create(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { …
public ActionForward save(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { …
Cool. But do you have to use a property named dispatch? No, you don't. The only other step is to specify the name of of the dispatch property as the “parameter” property of the action-mapping. So a mapping for our example might look like this:
<action
path=”/reg/dispatch”
type=”app.reg.RegDispatch”
name=”regForm”
scope=”request”
validate=”true”
parameter=”dispatch”/>
If you wanted to use the property “o” instead, as in o=create, you would change the mapping to
<action
path=”/reg/dispatch”
type=”app.reg.RegDispatch”
name=”regForm”
scope=”request”
validate=”true”
parameter=”o”/>
Again, very cool. But why use a JavaScript button in the first place? Why not use several buttons named “dispatch” and use a different value for each?
You can, but the value of the button is also its label. This means if the page designers want to label the button something different, they have to coordinate the Action programmer. Localization becomes virtually impossible. (Source: http://husted.com/struts/tips/002.html).
Question: How Struts relates to J2EE?
Answer: Struts framework is built on J2EE technologies (JSP, Servlet, Taglibs), but it is itself not part of the J2EE standard.
Question: What is Struts actions and action mappings?
Answer: A Struts action is an instance of a subclass of an Action class, which implements a portion of a Web application and whose perform or execute method returns a forward.
An action can perform tasks such as validating a user name and password.
An action mapping is a configuration file entry that, in general, associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.
An action servlet is a servlet that is started by the servlet container of a Web server to process a request that invokes an action. The servlet receives a forward from the action and asks the servlet container to pass the request to the forward's URL. An action servlet must be an instance of an org.apache.struts.action.ActionServlet class or of a subclass of that class. An action servlet is the primary component of the controller.
Answer: From the EJB Spec : - A Session bean's home interface defines one or morecreate(…) methods. Each create method must be named create and must match one of the ejbCreate methods defined in the enterprise Bean class. The return type of a create method must be the enterprise Bean's remote interface type. The home interface of a stateless session bean must have one create method that takes no arguments.
Question: Is struts threadsafe?Give an example?
Answer: Struts is not only thread-safe but thread-dependant. The response to a request is handled by a light-weight Action object, rather than an individual servlet. Struts instantiates each Action class once, and allows other requests to be threaded through the original object. This core strategy conserves resources and provides the best possible throughput. A properly-designed application will exploit this further by routing related operations through a single Action.
Question: Can we Serialize static variable?
Answer: Serialization is the process of converting a set of object instances that contain references to each other into a linear stream of bytes, which can then be sent through a socket, stored to a file, or simply manipulated as a stream of data. Serialization is the mechanism used by RMI to pass objects between JVMs, either as arguments in a method invocation from a client to a server or as return values from a method invocation. In the first section of this book, There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are
1. Serialization ignores static fields, because they are not part of any particular object's state.
2. Base class fields are only handled if the base class itself is serializable.
3. Transient fields. There are four basic things you must do when you are making a class serializable. They are:
1. Implement the Serializable interface.
2. Make sure that instance-level, locally defined state is serialized properly.
3. Make sure that superclass state is serialized properly.
4. Override equals( )and hashCode( ).
it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process …. (Source: http://www.oreilly.com/catalog/javarmi/chapter/ch10.html)
Question: What are the uses of tiles-def.xml file, resourcebundle.properties file, validation.xml file?
Answer: tiles-def.xml is is an xml file used to configure tiles with the struts application. You can define the layout / header / footer / body content for your View. See more at http://www.roseindia.net/struts/using-tiles-defs-xml.shtml.
The resourcebundle.properties file is used to configure the message (error/ other messages) for the struts applications.
The file validation.xml is used to declare sets of validations that should be applied to Form Beans. Fpr more information please visit http://www.roseindia.net/struts/address_struts_validator.shtml.
Question: What is the difference between perform() and execute() methods?
Answer: Perform method is the method which was deprecated in the Struts Version 1.1. In Struts 1.x, Action.perform() is the method called by the ActionServlet. This is typically where your business logic resides, or at least the flow control to your JavaBeans and EJBs that handle your business logic. As we already mentioned, to support declarative exception handling, the method signature changed in perform. Now execute just throws Exception. Action.perform() is now deprecated; however, the Struts v1.1 ActionServlet is smart enough to know whether or not it should call perform or execute in the Action, depending on which one is available.
Question: What are the various Struts tag libraries?
Answer: Struts is very rich framework and it provides very good and user friendly way to develop web application forms. Struts provide many tag libraries to ease the development of web applications. These tag libraries are:
* Bean tag library - Tags for accessing JavaBeans and their properties.
* HTML tag library - Tags to output standard HTML, including forms, text boxes, checkboxes, radio buttons etc..
* Logic tag library - Tags for generating conditional output, iteration capabilities and flow management
* Tiles or Template tag library - For the application using tiles
* Nested tag library - For using the nested beans in the application
Question: What do you understand by DispatchAction?
Answer: DispatchAction is an action that comes with Struts 1.1 or later, that lets you combine Struts actions into one class, each with their own method. The org.apache.struts.action.DispatchAction class allows multiple operation to mapped to the different functions in the same Action class.
For example:
A package might include separate RegCreate, RegSave, and RegDelete Actions, which just perform different operations on the same RegBean object. Since all of these operations are usually handled by the same JSP page, it would be handy to also have them handled by the same Struts Action.
A very simple way to do this is to have the submit button modify a field in the form which indicates which operation to perform.
<html:hidden property=”dispatch” value=”error”/>
<SCRIPT>function set(target) {document.forms[0].dispatch.value=target;}</SCRIPT>
<html:submit onclick=”set('save');”>SAVE</html:submit>
<html:submit onclick=”set('create');”>SAVE AS NEW</html:submitl>
<html:submit onclick=”set('delete);”>DELETE</html:submit>
Then, in the Action you can setup different methods to handle the different operations, and branch to one or the other depending on which value is passed in the dispatch field.
String dispatch = myForm.getDispatch();
if (”create”.equals(dispatch)) { …
if (”save”.equals(dispatch)) { …
The Struts Dispatch Action [org.apache.struts.actions] is designed to do exactly the same thing, but without messy branching logic. The base perform method will check a dispatch field for you, and invoke the indicated method. The only catch is that the dispatch methods must use the same signature as perform. This is a very modest requirement, since in practice you usually end up doing that anyway.
To convert an Action that was switching on a dispatch field to a DispatchAction, you simply need to create methods like this
public ActionForward create(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { …
public ActionForward save(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException { …
Cool. But do you have to use a property named dispatch? No, you don't. The only other step is to specify the name of of the dispatch property as the “parameter” property of the action-mapping. So a mapping for our example might look like this:
<action
path=”/reg/dispatch”
type=”app.reg.RegDispatch”
name=”regForm”
scope=”request”
validate=”true”
parameter=”dispatch”/>
If you wanted to use the property “o” instead, as in o=create, you would change the mapping to
<action
path=”/reg/dispatch”
type=”app.reg.RegDispatch”
name=”regForm”
scope=”request”
validate=”true”
parameter=”o”/>
Again, very cool. But why use a JavaScript button in the first place? Why not use several buttons named “dispatch” and use a different value for each?
You can, but the value of the button is also its label. This means if the page designers want to label the button something different, they have to coordinate the Action programmer. Localization becomes virtually impossible. (Source: http://husted.com/struts/tips/002.html).
Question: How Struts relates to J2EE?
Answer: Struts framework is built on J2EE technologies (JSP, Servlet, Taglibs), but it is itself not part of the J2EE standard.
Question: What is Struts actions and action mappings?
Answer: A Struts action is an instance of a subclass of an Action class, which implements a portion of a Web application and whose perform or execute method returns a forward.
An action can perform tasks such as validating a user name and password.
An action mapping is a configuration file entry that, in general, associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.
An action servlet is a servlet that is started by the servlet container of a Web server to process a request that invokes an action. The servlet receives a forward from the action and asks the servlet container to pass the request to the forward's URL. An action servlet must be an instance of an org.apache.struts.action.ActionServlet class or of a subclass of that class. An action servlet is the primary component of the controller.
发表评论
-
一组Struts的选择测试题附答案(1)
2010-08-12 16:34 342(1)在Struts应用的视图中包含哪些组件?(多选)选项:( ... -
如何在struts中配置数据源在,什么文件?用什么标签?如何取出DataSource?
2010-08-12 16:34 703Struts-config.xml<data-sourc ... -
Struts中最核心的类和包有哪些?
2010-08-12 16:34 5961. org.apache.struts.action基本上, ... -
国外的一些struts面试题(2)
2010-08-12 16:34 648Question: What is RequestProces ... -
Difference between Chain and Redirect Action result types
2010-08-12 16:34 345Chain result type is used for A ... -
如何提高Struts2的性能?
2010-08-12 16:34 5831. 关闭logging和开发模式(devMode), dev ... -
Spring和Struts的区别?
2010-08-12 16:34 687strusts:是一种基于MVC模式的一个web层的处理。Sp ... -
struts+spring面试题
2010-08-12 16:34 6541.strutsAction是不是线程安全的?如果不是,有什么 ... -
Struts中如何基于validation.xml来启用客户端验证?
2010-08-12 16:34 369可以使用<html:javascript>标签来进 ... -
国外的一些struts面试题(4)
2010-08-12 16:34 365Question: Can I setup Apache St ... -
介绍一下Struts的ActionServlet类
2010-08-12 16:34 717ActionServlet继承自javax.servlet.h ... -
Struts,Spring,Hibernate面试题总结
2010-08-12 16:34 379转载地址:http://blog.csdn.net/David ... -
一组Struts的选择测试题附答案(2)
2010-08-12 16:34 418(1)假设在helloapp应用中有一个hello.jsp,它 ... -
如何用Struts实现国际化?
2010-08-12 16:34 885国际化:不用修改代码,就适用于不同的语言国家本地化:如果要适应 ... -
介绍一下Struts的Action类
2010-08-12 16:34 390ActionServlet把全部提交的请求都被控制器委托到Re ... -
如何配置spring+struts?
2010-08-12 16:34 431在struts-config.xml加入一个插件,通过它加载a ... -
Struts中DispatchAction和Action类有什么不同?
2010-08-12 16:34 722DispatchAction是Struts包含的另一个能大量节 ... -
Struts框架如何取得消息资源文件中的信息?
2010-08-12 16:34 669消息资源文件是一些简单的.properties文件,这些文件包 ... -
国外的一些struts面试题(1)
2010-08-12 16:34 642Q: What is ActionServlet?A: The ... -
如何实现struts的validator框架?
2010-08-12 16:34 614手动: public class my ...
相关推荐
struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试题大全.doc struts面试...
Struts2面试题及答案,Struts2面试题及答案,Struts2面试题及答案,Struts2面试题及答案。
struts面试题详解,Struts1框架以ActionServlet作为核心控制器,整个应用由客户端请求驱动。
Struts面试题 Struts面试必备 很全 很经典的
struts2面试题(个人四处搜集_吐血推荐)
struts1面试题对于采用Struts框架的Web应用,在Web应用启动时就会加载并初始化控制器ActionServlet ActionServlet从struts-config.xml文件中读取配置信息,把它们存放到ActionMappings对象中。
JAVA笔试面试资料JDBC HTTP、JSP、Servlet、Struts面试题汇总资料: 2014年最新Java笔试题及答案.docx 225道Java面试题 学会了Java面试随你问.docx Ant和Maven的作用是什么?...遇到的一些Java面试题回顾.docx
Struts2面试题
struts2框架面试题,还有答案,有兴趣的小伙伴可以看看,谢谢大家的支持
JAVA struts2 框架 常见面试题 绝对有用!
2014年整理的最详细的java方面的面试题,包括servelt面试题,jdbcd面试题,java基础面试题,struts2面试题。
struts spring hibernate面试题 struts spring hibernate面试题 struts spring hibernate面试题 struts spring hibernate面试题 struts spring hibernate面试题 struts spring hibernate面试题 struts spring ...
struts面试题
持续更新ing Struts2 框架面试题汇总。 Struts2 基于 MVC 架构,框架结构清晰,使用 OGNL,提供了全局范围、包范围和Action范围的国际化资源文件管理实现。
struts2框架面试题及答案02,几道精华的struts2框架面试题,有兴趣的小伙伴可以看看
详细记载了我自己面试过程中遇到的关于strus2的问题
大量的Struts面试题集合 适合Java程序员应对面试或者检查自己对Strust的掌握程度
包括structs2的基础知识,面试中常常被问到的问题大汇总
面试知识点总结--struts面试题大全.pdf
1 在Struts1中,核心控制器是ActionServlet,它是一个Servlet。在Struts2中哪个类是核心控制器,它也是一个Servlet么?(StrutsPrepareAndExecuteFilter) 2 在web.xml文件中如何部署Struts2。