Question
What are best practices to follow while developing Struts2 application

Answers

Some of the best practices while developing Struts2 application are:

• Always try to extend struts-default package while creating your package to avoid code redundancy in configuring interceptors.

• For common tasks across the application, such as logging request params, try to use interceptors.

• Always keep action classes java bean properties in a separate bean for code reuse and implement ModelDriven interface.

• If you have custom interceptor that you will use in multiple actions, create interceptor stack for that and then use it.

• Try to divide your application in different modules with namespace configuration based on functional areas.

• Try to use Struts2 tags in result pages for code clarify, if needed create your own type converters.

• Use development mode for faster development, however make sure production code doesn’t run in dev mode.

• Use Struts2 i18n support for resource bundles and to support localization.

• Struts2 provides a lot of places where you can have resource bundles but try to keep one global resource bundle and one for action class to avoid confusion.

• struts-default package configures all the interceptors and creates different interceptor stacks. Try to use only what is needed, for example if you don’t have localization requirement, you can avoid i18n interceptor.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q What is known as ‘the Fourth Arm of Defence and Force behind the Armed Forces’ ?
  • Q What is Runtime Host?
  • Q what is the total amounts or money deposited in all banks of india by people in one day?
  • Q Difference between iterator and listiterator?
  • Q What courses did you like least and why ?
  • Q What is brainstorming?
  • Q Define co-­ordination covalent bond.
  • Q What is the Load Balancing Advisory? - Oracle RAC
  • Q Under the total force policy, what plan covers all degrees of volunteerism, involuntary recall, mobilization, and demobilization to support the Joint Strategic Plan (JSCP) and Deliberate Plans and Crisis Action Planning (A)Demobilization (B)Mobilization (C)Execution (D)Strategic
  • Q Scientific name of Human beings?
  • Q Watch this video (http://openstaxcollege.org/l/l_3-D1) to learn more about how the brain perceives 3-D motion. Similar to how retinal disparity offers 3-D moviegoers a way to extract 3-D information from the two-dimensional visual field projected onto the retina, the brain can extract information about movement in space by comparing what the two eyes see. If movement of a visual stimulus is leftward in one eye and rightward in the opposite eye, the brain interprets this as movement toward (or away) from the face along the midline. If both eyes see an object moving in the same direction, but at different rates, what would that mean for spatial movement?