|
INTERVIEW QUESTIONS
J2EE
STRUTS
DETAILS
Question: Can't I just create some of my JavaBeans in the JSP using a scriptlet?
Answer: Struts is designed to encourage a Model 2/MVC architecture. But there is nothing that prevents you from using Model 1 techniques in your JavaServer Pages, so the answer to the question is "Yes, you can". Though, using Model 1 techniques in a Struts application does go against the grain. The approach recommended by most Struts developers is to create and populate whatever objects the view may need in the Action, and then forward these through the request. Some objects may also be created and stored in the session or context, depending on how they are used. Likewise, there is nothing to prevent you from using scriptlets along with JSP tags in your pages. Though, many Struts developers report writing very complex scriplet-free applications and recommend the JSP tag approach to others. For help with Model 1 techniques and scriptlets, you might consider joining the Javasoft JSP-interest mailing list, where there are more people still using these approaches.
|
|
|
Category |
Struts Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8205 users |
Added on |
8/31/2014 |
Views |
71816 |
Rate it! |
|
|
Question:
Can't I just create some of my JavaBeans in the JSP using a scriptlet?
Answer:
Struts is designed to encourage a Model 2/MVC architecture. But there is nothing that prevents you from using Model 1 techniques in your JavaServer Pages, so the answer to the question is "Yes, you can". Though, using Model 1 techniques in a Struts application does go against the grain. The approach recommended by most Struts developers is to create and populate whatever objects the view may need in the Action, and then forward these through the request. Some objects may also be created and stored in the session or context, depending on how they are used. Likewise, there is nothing to prevent you from using scriptlets along with JSP tags in your pages. Though, many Struts developers report writing very complex scriplet-free applications and recommend the JSP tag approach to others. For help with Model 1 techniques and scriptlets, you might consider joining the Javasoft JSP-interest mailing list, where there are more people still using these approaches. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Why are my checkboxes not being set from ON to OFF?
|
View Answer
|
|
Why doesn't the focus feature on the <html:form> tag work in every circumstance?
|
View Answer
|
|
Can I use multiple HTML form elements with the same name?
|
View Answer
|
|
Can I use multiple HTML form elements with the same name?
|
View Answer
|
|
Do ActionForms have to be true JavaBeans?
|
View Answer
|
|
Why is ActionForm a base class rather than an interface?
|
View Answer
|
|
Why are some of the class and element names counter-intuitive?
|
View Answer
|
|
What is a modular application? What does module-relative mean?
|
View Answer
|
|
Why was reload removed from Struts (since 1.1)?
|
View Answer
|
|
Is there a particularly good IDE to use with Struts
|
View Answer
|
|
What about JSTL and JavaServer Faces ?
|
View Answer
|
|
Will the Struts tags support other markup languages such as WML ?
|
View Answer
|
|
Are the Struts tags XHTML compliant ?
|
View Answer
|
|
Why aren't the Struts tags maintained as part of the Jakarta Taglibs project ?
|
View Answer
|
|
What's the difference between Struts and Turbine? What's the difference between Struts and Espresso?
|
View Answer
|
|
Where can I get help with Struts?
|
View Answer
|
|
If the framework doesn't do what I want, can I request that a feature be added?
|
View Answer
|
|
Does Struts include its own unit tests?
|
View Answer
|
|
When do I need "struts.jar" on my classpath?
|
View Answer
|
|
How do I install Struts?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Struts Interview Questions & Answers - Exam Mode /
Learning Mode
|