Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts Interview Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Interview" Watch "Struts Interview" New topic
Author

Struts Interview

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
(While this topic does spill over to those covered in our "Jobs Discussion" forum, let's keep this conversation here, for now.)

During a technical interview, what could be asked to ferret out the exceptionally good Struts developers?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
A few questions :
1.)How do we configure two strus-config.xml files and what if same action mapping is there in the two files?
2.)Why DynaActionForms were required?
3.)How requestprocessor loads Actions?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

1) What are some reasons to customize the RequestProcessor?
2) What are the advantages of Tiles? [ok, this one isn't hard, but it shows the person used more than basic struts]
3) What happens if you have the same form in the request and session?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hmm. Good questions. Anyone care to answer those for me?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

2) What are the advantages of Tiles? [ok, this one isn't hard, but it shows the person used more than basic struts]

None. Now you have 1 more XML file to manage. Sorry, couldn't resist.


GenRocket - Experts at Building Test Data
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
Well,answering those is difficult
Answer to question related to 2 struts-config files:
In web.xml,while specifying the value of config param-name inside init-params,the struts-confifs can be specified as comma-separated paths
so :
<init-param>
<param-name>config</param-name>
<param-value>.../struts-config.xml,.../struts-config1.xml</param-value>
</init-param>

Regarding the 2nd part,someone pls confirm the below answer:
In case there are two action-mappings defined with the same name,first one will get overwritten and only 2nd one will take effect.
The basis of my answer is that ,since RequestProcessor loads the actionmapping using ClassLoader API,it will end up loading the same mapping twice,so first one will get overwritten.
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
3) What happens if you have the same form in the request and session?
Let me think through it.First how can that happen?If same form is used in two mappings?
Even then it shld not create problems since individual action mappings will have that form in their defined scope and they will take it from that scope.
[ January 11, 2005: Message edited by: Jitesh Sinha ]
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
And you can config like this



SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I have some problem about Struts to ask ::


How/When to use DynaActionForms ?


Because i never use in my project....
Daniel Massie
Greenhorn

Joined: Jan 08, 2005
Posts: 28
Some more...

What are the main extension points of the struts framework and how could you make use of them?

Give examples of the different types of Action available in the struts framework.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Originally posted by Jeanne Boyarsky:
1) What are some reasons to customize the RequestProcessor?
2) What are the advantages of Tiles? [ok, this one isn't hard, but it shows the person used more than basic struts]
3) What happens if you have the same form in the request and session?

Now I can't ask these if someone knows they are interviewing with me because the answers will be on the web

1) Intercepting requests, custom exceptions, enforcing validations ... - some of these can be done other ways (and in my opinion better ways), but it shows whether someone knows what the RequestProcessor does.
2) Can abstract layout from JSPs. As Gregg pointed out, I should also ask the disadvantages of Tiles!
3) Normally, this is ok. But if you try to get the bean without specifying the scope, you may not get the one you are expecting.
Sunil Manheri
Ranch Hand

Joined: Jul 07, 2004
Posts: 32
What are the disadvantages of DynaValidatorForm?


TechMindViews - Technical Notes
Manas Dabz
Greenhorn

Joined: Mar 26, 2003
Posts: 5
Why DynaActionForms are required ? As Questioned by somebody...

Well I dont see any reasons to use them as compare to ActionForms.
Only benefit DyanActionForms was supposed to bring was to avoid the bloat of too many ActionForms ( In most cases every HTML form have a separate ActionForm). DynaActionForm brings the advantage of setting all the properties in config xml file..so there is no need to have an ActionForm java file. Wait a minute....

But then you have to skip the benefit of using (overriding) the validate method of AcionForm. One can still override the validate the validate method by doing something like this :

public class NewDriverDynaActionForm extends DynaActionForm{
...

..... validate(..){

}
}

But then whole purpose of using DynaActionForm is lost...isn't it ..since we still have to code an ActionForm class... since only benefit we will be getting is no getter-setter method declaration in this new form. But that is not even a benefit , since most of IDE's take care of that and generate Getter-Setter code at a single click of mouse.

and moreever while using DynaActionForm, as mentioned by Struts as truly dynamic....they are not even dynamic..as after a change in field one has to restart the web application.
And one thing i can think of more is runtime exception if we by chance put a wrong data type in xml file for one of our properties. Otherwise we will be getting a compiler error.

Well i will apprecite if somebody can tell me where i can use them...any specific scenario .i am not aware of ...

Munish Dabra
 
jQuery in Action, 2nd edition
 
subject: Struts Interview