- 浏览: 490029 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (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)
Q: What is ActionServlet?
A: The class org.apache.struts.action.ActionServlet is the called the ActionServlet. In the the Jakarta Struts Framework this class plays the role of controller. All the requests to the server goes through the controller. Controller is responsible for handling all the requests.
Q: How you will make available any Message Resources Definitions file to the Struts Framework Environment?
A: Message Resources Definitions file are simple .properties files and these files contains the messages that can be used in the struts project. Message Resources Definitions files can be added to the struts-config.xml file through <message-resources /> tag.
Example:
<message-resources parameter=”MessageResources” />
Q: What is Action Class?
A: The Action is part of the controller. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to Subclass and overwrite the execute() method. The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. There should be no database interactions in the action. The action should receive the request, call business objects (which then handle database, or interface with J2EE, etc) and then determine where to go next. Even better, the business objects could be handed to the action at runtime (IoC style) thus removing any dependencies on the model. The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.
Q: Write code of any Action Class?
A: Here is the code of Action Class that returns the ActionForward object.
TestAction.java
package roseindia.net;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class TestAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
return mapping.findForward(”testAction”);
}
}
Q: What is ActionForm?
A: An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.
Q: What is Struts Validator Framework?
A: Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser as well as on the server side. Struts Framework emits the java scripts
and it can be used validate the form data on the client browser. Server side validation of form can be accomplished by sub classing your From Bean with DynaValidatorForm class.
The Validator framework was developed by David Winterfeldt as third-party add-on to Struts. Now the Validator framework is a part of Jakarta Commons project and it can be used with or without Struts. The Validator framework comes integrated with the Struts Framework and can be used without doing any extra settings.
Q. Give the Details of XML files used in Validator Framework?
A: The Validator Framework uses two XML configuration files validator-rules.xml and validation.xml. The validator-rules.xml defines the standard validation routines, these are reusable and used in validation.xml. to define the form specific validations. The validation.xml defines the validations applied to a form bean.
Q. How you will display validation fail errors on jsp page?
A: Following tag displays all the errors:
<html:errors/>
Q. How you will enable front-end validation based on the xml in validation.xml?
A: The <html:javascript> tag to allow front-end validation based on the xml in validation.xml. For example the code: <html:javascript formName=”logonForm” dynamicJavascript=”true” staticJavascript=”true” /> generates the client side java script for the form “logonForm” as defined in the validation.xml file. The <html:javascript> when added in the jsp file generates the client site validation script.
A: The class org.apache.struts.action.ActionServlet is the called the ActionServlet. In the the Jakarta Struts Framework this class plays the role of controller. All the requests to the server goes through the controller. Controller is responsible for handling all the requests.
Q: How you will make available any Message Resources Definitions file to the Struts Framework Environment?
A: Message Resources Definitions file are simple .properties files and these files contains the messages that can be used in the struts project. Message Resources Definitions files can be added to the struts-config.xml file through <message-resources /> tag.
Example:
<message-resources parameter=”MessageResources” />
Q: What is Action Class?
A: The Action is part of the controller. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to Subclass and overwrite the execute() method. The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. There should be no database interactions in the action. The action should receive the request, call business objects (which then handle database, or interface with J2EE, etc) and then determine where to go next. Even better, the business objects could be handed to the action at runtime (IoC style) thus removing any dependencies on the model. The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.
Q: Write code of any Action Class?
A: Here is the code of Action Class that returns the ActionForward object.
TestAction.java
package roseindia.net;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class TestAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
return mapping.findForward(”testAction”);
}
}
Q: What is ActionForm?
A: An ActionForm is a JavaBean that extends org.apache.struts.action.ActionForm. ActionForm maintains the session state for web application and the ActionForm object is automatically populated on the server side with data entered from a form on the client side.
Q: What is Struts Validator Framework?
A: Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser as well as on the server side. Struts Framework emits the java scripts
and it can be used validate the form data on the client browser. Server side validation of form can be accomplished by sub classing your From Bean with DynaValidatorForm class.
The Validator framework was developed by David Winterfeldt as third-party add-on to Struts. Now the Validator framework is a part of Jakarta Commons project and it can be used with or without Struts. The Validator framework comes integrated with the Struts Framework and can be used without doing any extra settings.
Q. Give the Details of XML files used in Validator Framework?
A: The Validator Framework uses two XML configuration files validator-rules.xml and validation.xml. The validator-rules.xml defines the standard validation routines, these are reusable and used in validation.xml. to define the form specific validations. The validation.xml defines the validations applied to a form bean.
Q. How you will display validation fail errors on jsp page?
A: Following tag displays all the errors:
<html:errors/>
Q. How you will enable front-end validation based on the xml in validation.xml?
A: The <html:javascript> tag to allow front-end validation based on the xml in validation.xml. For example the code: <html:javascript formName=”logonForm” dynamicJavascript=”true” staticJavascript=”true” /> generates the client side java script for the form “logonForm” as defined in the validation.xml file. The <html:javascript> when added in the jsp file generates the client site validation script.
发表评论
-
一组Struts的选择测试题附答案(1)
2010-08-12 16:34 344(1)在Struts应用的视图中包含哪些组件?(多选)选项:( ... -
如何在struts中配置数据源在,什么文件?用什么标签?如何取出DataSource?
2010-08-12 16:34 706Struts-config.xml<data-sourc ... -
Struts中最核心的类和包有哪些?
2010-08-12 16:34 5981. org.apache.struts.action基本上, ... -
国外的一些struts面试题(2)
2010-08-12 16:34 651Question: What is RequestProces ... -
Difference between Chain and Redirect Action result types
2010-08-12 16:34 347Chain result type is used for A ... -
如何提高Struts2的性能?
2010-08-12 16:34 5851. 关闭logging和开发模式(devMode), dev ... -
Spring和Struts的区别?
2010-08-12 16:34 694strusts:是一种基于MVC模式的一个web层的处理。Sp ... -
struts+spring面试题
2010-08-12 16:34 6551.strutsAction是不是线程安全的?如果不是,有什么 ... -
Struts中如何基于validation.xml来启用客户端验证?
2010-08-12 16:34 371可以使用<html:javascript>标签来进 ... -
国外的一些struts面试题(4)
2010-08-12 16:34 368Question: Can I setup Apache St ... -
介绍一下Struts的ActionServlet类
2010-08-12 16:34 721ActionServlet继承自javax.servlet.h ... -
Struts,Spring,Hibernate面试题总结
2010-08-12 16:34 382转载地址:http://blog.csdn.net/David ... -
一组Struts的选择测试题附答案(2)
2010-08-12 16:34 420(1)假设在helloapp应用中有一个hello.jsp,它 ... -
如何用Struts实现国际化?
2010-08-12 16:34 887国际化:不用修改代码,就适用于不同的语言国家本地化:如果要适应 ... -
介绍一下Struts的Action类
2010-08-12 16:34 392ActionServlet把全部提交的请求都被控制器委托到Re ... -
如何配置spring+struts?
2010-08-12 16:34 432在struts-config.xml加入一个插件,通过它加载a ... -
Struts中DispatchAction和Action类有什么不同?
2010-08-12 16:34 725DispatchAction是Struts包含的另一个能大量节 ... -
Struts框架如何取得消息资源文件中的信息?
2010-08-12 16:34 673消息资源文件是一些简单的.properties文件,这些文件包 ... -
国外的一些struts面试题(3)
2010-08-12 16:34 339Question: Why cant we overide c ... -
如何实现struts的validator框架?
2010-08-12 16:34 616手动: 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作为核心控制器,整个应用由客户端请求驱动。
struts1面试题对于采用Struts框架的Web应用,在Web应用启动时就会加载并初始化控制器ActionServlet ActionServlet从struts-config.xml文件中读取配置信息,把它们存放到ActionMappings对象中。
Struts面试题 Struts面试必备 很全 很经典的
struts2面试题(个人四处搜集_吐血推荐)
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的掌握程度
1 在Struts1中,核心控制器是ActionServlet,它是一个Servlet。在Struts2中哪个类是核心控制器,它也是一个Servlet么?(StrutsPrepareAndExecuteFilter) 2 在web.xml文件中如何部署Struts2。
包括structs2的基础知识,面试中常常被问到的问题大汇总
面试知识点总结--struts面试题大全.pdf