Why servlet is used as controller ?Not JSP? I want complete explation?
In struts servlet control the application and we know that a JSP compiled into a servlet first. The only problem with the servlet is that it needs to write out.Println call per HTML line. But as a controller in struts servlets do not force the programmers to write out.Println, that is the part of JSP...
How you will handle errors and exceptions using struts
To handle errors server side validation can be used using ActionErrors classes can be used. or If you need to handle an exception in a specific way for a certain action you can use the exception-mapp...
we can handle exception in two ways declarative exception & programmatic exception handling
Why do we have only one actionservlet in struts?(asked in polaris interview for Java experienced people , on april 11, chennai)
ActionServlet acts as a controller in Struts 1.x,Structs is a Mvc2 architecture based web-framework, According to MVC2 there must be only one Controller in our app,
We can configure many servlets, pls check it.
Can I have more than one struts-config.XML file for a single struts application?
Multiple struts-config.XML files
In struts, for what purpose we will be creating multiple struts-config.XML files? Can anyone help me out?
Yes we can have mutilple config files ..this will be good for modulariazaion
Struts Modules allow a team to logically separate their segment of a single application into the "sub-Web" application . In such a case , each sub-web part will have its own struts-config.xml file. e....
What we will define in struts-config.XML file. And explain their purpose
These are the tags we can define
<data-sources/>
<form- beans/>,
<global- forwards/>,
<message-resources>,
<switch-action>
<plug-in/>
We can say like soul of struts is Struts-config.xml.The server will read struts-config.xml once only on the time of server starting. so server will know how and where to re-route to each and every req...
Difference between struts 1.X and struts 2.X
What is the difference between struts 1.X and struts 2.X
struts1:: It uses abstract classes rather than interfaces. struts2:: It provides a base ActionSupport class that implements commonly used interfaces like ( Action, ServletResponseAware, ServletReques...
1. Struts 2 is Action based framework, where as in struts 1.2 its control based.
2. There is ActionForm concept in struts 2.0
3. In struts 2 configuration file renamed to struts.xml from struts-config.xml
4. introduced interceptors instead of request processor.
5. Easy to configure.
What are the core classes of struts?
Actionform, Actionclass, ActionMapping, ActionForwrd, Action Errors.
The core class of struts framework is
1) ActionServlet
2) Action
3) ActionForward
4) ActionMapping
5) ActionErrors
6) RequestProcessor
7) ActionForm
Struts application in rad error
I am trying to run the struts application in rad using websphere application 6.1 but its not working its giving as error: there is no action mapped for namespace / and action name . - [unknown location] at com.Opensymphony.Xwork2.Defaultactionproxy.Prepare(defaultactionproxy.Java:178) at org.Apache.Struts2.Impl.Strutsactionproxy.Prepare(strutsactionproxy.Java:61) at...
Have you mapped the default action in struts.xml?
How to add multiple .Property files in sturts-config.XML file..?
If any one knows the answer plz add..
By assigning a key attribute to each property file,while configuring in struts configuration file.
By configuring in struts config file as follows:
What is the diffrence between apache struts and jakarta struts ?
both are same
They are the same
Explain about token feature in struts
Tokens are used to prevent multi click problem in struts. In Action class method at the begining of the code, need to call the saveToken() that generates an unique identifier for the "request ur...
In classes we will write the Tocken code
Answered by asreeni on 2005-04-08 03:24:40: the core of the struts framework is a flexible control layer based on standard technologies like Java servlets, Javabeans, resourcebundles, and XML, as well as various jakarta commons packages. Struts encourages application architectures based on the model...
I worked with struts it completely MVC base. I used SHINE pattern. It is a MVC base too. Actually it is an open source project to implement J2EE application.
Apache Struts is a frame work build on several design patterns like MVC, FrontController, Factory, Singleton etc., It is most suitable framework to develop web based applications, because this f...
Explain all tyes of action classes in struts
Forward Action
Include action
Dispatch Action
Lookup Dispatch Action
1. Action2. ForwardAction3. IncludeAction4. DispatchActi...
What are the advantages and disadvantages of struts 2 framework?
Answered by: tirumurugan
Member Since Jun-2009 | Answered On : Jun 25th, 2009
Advantages of struts
1. Centralized file-based configuration
2.
Form beans.
3. Bean tags.
4. HTML tags
5. Form field validation
6.
Consistent approach.
Disadvantages of struts
1. Bigger learning curve
2.
BAD documentation
3. Less transparent
4. Rigid approach.
1. no need coding action forms
2. can be any method
3. action name can contain place holders
4. interceptors
5. value stacks
6. thread safe
compared to struts 1
Advantages of struts
1. Centralized file-based configuration
2.
Form beans.
3. Bean tags.
4. HTML tags
5. Form field validation
6.
Consistent approach.
Disadvantages of struts
1. Bigger learning curve
2.
BAD documentation
3. Less transparent
4. Rigid approach.
Why we use struts framework in project?
Generally in any project we should use any design pattern to make project success. So many people find some sort of problems in their design but atlast they provide one solution to those common probl...
Benifits of using struts framework are [these are the reasons we should use struts]:-(1) Its based on MVC architecture [MVC-2 to be specific] and brings a clear line of demarkation between Controller ...
What is heirarchy of files in struts?
When we send the request from client then first it touches the ActionServlet--->RequestProcessor---->ActionForm(do the required validations)---->Action (execute method is executed)---->Service class(i...
When the request is recived by ActionServlet it looks for the ActionMapping entries in the Struts-config.xml. ActionMapping returns the appropriate Action class where we handle the business logic.Finally execute() returns the ActionForward key (View).
How do you perform tight coupling and loose coupling in struts ?
Is it require to perform coupling in struts ? If yes then how?
How can container will know this is a struts application?
Here one thing i want to finalize i.e everything is working on servlet container only i.e we need only serlet container not sturts container .since when we deploy the application into the servlet cont...
The control is forwarded from the container to struts controller when is reads an entry like :-- <servlet-name>action</servlet-name> <serv...
When we send the request once to the server then we should disable that button otherwise the user may thought that the request is not sent so he send the request again and again. Here the problem is w...
saveToken() method is used for duplicate form submission.Let's take an example i.e. yahoo email registration formYou filled the form and press the "submit" button more than once.For each action you do...
If JSP is used as controller,it will be violated MVC architecture of web based applications.Since as per MVC pattern JSP is for VIEW and servlet is for controller.
Excellent question