Can i use constructor in Action Class?If yes how?
Answers were Sorted based on User's Feedback
Answer / kumar
Yes, we can have a constructor, but there is no use even if
you invoke explicitly because container itself is providing
a zero argument constructor implicitly.
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / manjunath more
public class MyAction extends Action{
public MyAction(){
}
public ActionForward execute(ActionMapping
mapping,ActionForm form,Request,Resopnse){
//some code
}
}
This will work...
It means you can write constructor in Action classes.
If you have any queries drop me a mail on
manjunathmore@gmail.com
Is This Answer Correct ? | 6 Yes | 0 No |
Yes we can write the constructor for the Action clas rule is
Constructor should not have arguments ,
If we provide with arguments we should also proide no
argment constructor
Is This Answer Correct ? | 6 Yes | 1 No |
ActioClass is on of the servet and it is superclass of
javax.servlet.HTTP.HTTPServlet.In the servet there is
possiblity of write zeroorgumen consrtacter but can't write
perametarised cunstracter becouse of perametarised
constrater can't read container...
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / kamal hossain
yes, we can use zero argument constructor for initialisation.
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / devender
Yes action class can have constructor but what is the
advantage of that constructor
Is This Answer Correct ? | 7 Yes | 5 No |
Answer / sagar
No you cant use Constructor in Action class,
if you use it will unable to find action class
and gives Error Msg( No action instance for path )
Is This Answer Correct ? | 0 Yes | 10 No |
What are disadvantages of Struts?
What is the use of form bean in struts?
What design patterns are used in struts?
what is a RequestProcessor?
Explain design patterns which is used in struts?
What is the default suffix for Struts2 action URI and how can we change it?
How do u provide security to ur project?(Banking domain project)
Can you call Action class methods from Struts config.xml?
wat happen when the connection is nt closed in jdbc n what vl happen when i interchange in executequery n execute statements
drawback of Validation Framework where and how to write the connection pool object in the programe how to debug the programe and application in struts without using eclips
Who wrote struts?
What is difference between interceptors and filters?