Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Interview

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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?
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Good questions. Anyone care to answer those for me?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you can config like this

 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some problem about Struts to ask ::


How/When to use DynaActionForms ?


Because i never use in my project....
 
Daniel Massie
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the disadvantages of DynaValidatorForm?
 
Manas Dabz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic