What is difference between Html tags and Struts specific HTML Tags ? Posted: 1. Html tags are static Struts tags are Dynamic( At the run-time struts tags are called)2. Another diff is U create ur own Struts tags |
| What is switch action & forwardAction in struts? Posted: Switch action is used to navigate/move from one module to other module in struts, where as forwardAction is used is used to navigate/move within same module |
| Is Action class is Servlet or Not ? if yes why ? Posted: In Struts1, Action Servlet is a servelet (since it extends HTTPServle) but Action class extents org.apache.struts.action.Action which has nothing to do with Servlet. In Struts2, Action class extends com.opensymphony.xwork2.ActionSupport which has nothing to do with Servlet. So, to answer the question, Action class is not a Servlet by any logic. |
| What is the return type of DAO in Struts? Posted: Struts does not bind the programmer till the DAO layer. You can have anything you like, as the return type (valid in programming construts, of course) for the DAO method, Struts would not crib about anything, and would be happy to serve your Action class, as that is what struts is ment to do, just [...] |
| How many ActionServlets are created by struts based application? Posted: ActionServlet is a Servlet(Java Class).For one web application only one instance of Servlet is created which is multi threaded i.e.it will create separate thread of execution for each client.So, only one instance of ActionServlet will be created for each web application. |
| What is the main difference between Action and DispatchAction classes ? Posted: A DispatchAction contains a number of different methods other than the standard execute(). These methods are executed based on some request parameter. Your action mapping in struts-config specifies the request parameter to examine. Then, whatever the value of that parameter is for a given request, Struts will try to execute the method in the action [...] |
| Explain saveToken() function ? Posted: saveToken() method is used for duplicate form submission. Let’s take an example i.e. yahoo email registration form You filled the form and press the “submit” button more than once. For each action you do there is a request object associted with that. So when you press the submit button twice that means you are sending the same request twice so [...] |
| Posted: As long as your connection object is not declared as a class level object, (ie an object declared outside all functions), and as long as the connection object being declared is not static, the program will run fine. (Assuming that the method for creating a connection returns a connection object) |
| What will happen if the mapping to actionform in the struts-config.xml is mentioned wrong? Posted: It will return an error javax.servlet.ServletException: Cannot retrieve definition for form bean (form bean class name) on action FormBean. |
| What is the actual purpose of using framework in realtime applications? Posted: ramework will act as interface between our program (more specifically our business process) and java software and framework will enforce us to follow certain rules/standards to implement the business logics. For Example if you take struts or springs or Torque frameworks, every framework will have it is own defined rules so we need to follow [...] |
| What is the difference between Struts 1.x and Struts 2.x ? Posted: The new method execte() is necessary because the perform() method declares that it throws only IOException and ServletException. Due to the added declarative exception-hndling functionality, the framework needs to catch all instance of java.lang.Exception from Action class. Instead of changing the method signature for the perform() method and breaking backward compability, the execute method was added. |
| Why do we have only one ActionServlet in Struts? Posted: ActionServlet is like BackBone of our application, we have done all actions(request & response) by using only one instance, that is ActionServlet’s Instance, that is the main reason to go for MVC architecture, no need to create more than one instance, thats why we use only one ActionServlet for whole project. In Previous Structure, we should [...] |
| How to connect data source for mysql in tomcat server ? Posted: You can nonnect to mysql datasource without tomcat server by folowing way: - Setup mysql -download mysql connector(driver) and add file .jar to your project -run mysql, create datasource - Write code to connect to that datasource: public static Connection getConnection(){ try{ Connection conn = DriverManager.getConnection(”jdbc:mysql://127.0.0.1/lamtung?user=root&password=vertrigo”); [...] |
Friday, October 17, 2008
TECHNICAL QUESTIONS
Subscribe to:
Post Comments (Atom)



No comments:
Post a Comment