672329 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 13 Messages: 13 Messages: 13 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Extending Struts

Posted by: Dion Almaer on November 11, 2004 DIGG
Sunil Patil discusses three ways to extend Struts. You can create plugins to execute some business logic at application startup, create your own RequestProcessor if you want to execute some business logic at a particular point during the request-processing phase, or extend the ActionServlet class if you want to execute your business logic at either application startup or shutdown, or during request processing.

This article uses a sample Struts application to demonstrate how to extend Struts using each of these three approaches. Two of the most successful examples of Struts extensions are the Struts Validation framework and the Tiles framework.

Read more: Extending Struts

Threaded replies

·  Extending Struts by Dion Almaer on Thu Nov 11 22:59:24 EST 2004
  ·  Extending Struts by Artem Yegorov on Fri Nov 12 09:58:20 EST 2004
    ·  Extending Struts by Sunil Patil on Fri Nov 12 23:29:06 EST 2004
      ·  What's the different between RequestProcessor and Action? by Roby Chen on Sun Nov 14 22:54:11 EST 2004
        ·  What's the different between RequestProcessor and Action? by Artem Yegorov on Mon Nov 15 17:51:46 EST 2004
  ·  BeeHive and PageFlows by Doug Dew on Fri Nov 12 10:27:44 EST 2004
  ·  Extending Struts by Abdeslam el Idrissi on Sat Nov 13 06:16:09 EST 2004
    ·  Struts Extention by Sergio Alemán on Wed Feb 22 15:55:56 EST 2006
  ·  Extending Struts by Martin Anderson on Mon Nov 15 11:03:50 EST 2004
    ·  extending struts... by Ian Pojman on Mon Nov 15 14:09:42 EST 2004
    ·  Extending Struts by NullPtr ! on Mon Nov 15 21:48:53 EST 2004
      ·  Extending Struts by Martin Anderson on Thu Nov 18 05:27:53 EST 2004
  ·  using struts with FDF/PDF forms by Sri Ram on Tue Nov 16 01:00:33 EST 2004
  ·  Plese Help! by Sergio Alemán on Fri Feb 24 13:32:13 EST 2006
  Message #145872 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: Artem Yegorov on November 12, 2004 in response to Message #145831
I've done it for my project and it adds a lot of flexibility and added functionality to your applications while still conforming to the Struts compatibility specs.

I am glad that somebody has finally wrote an article that gives one an idea on how to do it without extensive trial and error way of figuring things out or looking that much at the Struts source.

Thanks, Sunil!

Artem D. Yegorov
http://www.activexml.org

  Message #145877 Post reply Post reply Post reply Go to top Go to top Go to top

BeeHive and PageFlows

Posted by: Doug Dew on November 12, 2004 in response to Message #145831
The PageFlows feature of the Apache BeeHive project is basically a big Struts extension. The PageFlows code contains examples of the techniques described by the author, as well as examples of more advanced Struts extension techniques.

BeeHive: http://incubator.apache.org/beehive/

Doug

  Message #145942 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: Sunil Patil on November 12, 2004 in response to Message #145872
Thanks Artem for taking interest in extending struts article. Hope it is helpful.

Sunil

  Message #145958 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: Abdeslam el Idrissi on November 13, 2004 in response to Message #145831
Extending Struts by changing the RequestProcessor or the ActionServlet is very risky. I think that extending Struts by adding the SpringFramework can be a better choice.

  Message #146059 Post reply Post reply Post reply Go to top Go to top Go to top

What's the different between RequestProcessor and Action?

Posted by: Roby Chen on November 14, 2004 in response to Message #145942
That means ActionServlet is responsible for handling all of your requests to Struts. You can create a sub-class of the ActionServlet class if you want to do something at application startup or shutdown or on every request, but you should try creating a PlugIn or RequestProcessor before extending the ActionServlet class. Before Servlet 1.1, the Tiles framework was based on extending the ActionServlet class to decorate a generated response. But from 1.1 on, it's used the TilesRequestProcessor class.
In our project based on Struts Framework, we always extend our work by extending ActionServlet. The kind of session work can be done in the base ActionServlet. What's the different between extending RequestProcessor and ActionServlet? Why "you should try creating a PlugIn or RequestProcessor before extending the ActionServlet class" is reasonable?

  Message #146121 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: Martin Anderson on November 15, 2004 in response to Message #145831
Nicely done. Having done both a custom solution and used struts, I feel that extending struts in this manner is incredibly powerful and under-used.<br><br>
Also very useful as I'm in the process of mentoring a team of newbies onto struts and trying to convince them of its usefulness over Model 1 vanilla JSPs, and this provides yet another excellent reason!

  Message #146147 Post reply Post reply Post reply Go to top Go to top Go to top

extending struts...

Posted by: Ian Pojman on November 15, 2004 in response to Message #146121
I have found a fourth and best way to extend struts... you simply download webwork1 and delete all those nasty config files and dependency jars :) oh yes, and all that useless form code and servlet code... Ahhh, someone smack Jakarta with a POJO. seriously though, there is an extension to struts which makes the actions be non-reentrant. That solves a huge problem of struts off the bat. Sad Craig disagrees with a more sane model.....

  Message #146183 Post reply Post reply Post reply Go to top Go to top Go to top

What's the different between RequestProcessor and Action?

Posted by: Artem Yegorov on November 15, 2004 in response to Message #146059
You want to extend RequestProcessor if you want to change or extend behaviour of URI to action matching and Forward processing.

ActionServlet is extended if any additional initalization and actual raw request processing (not reuqest URI) is needed, like triggering some behaviour based on some request values and etc.

Sincerely,

Artem D. Yegorov
http://www.activexml.org

  Message #146198 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: NullPtr ! on November 15, 2004 in response to Message #146121
As another member suggested, u wud be better off convincing them of WebWork or Spring-MVC..
Nicely done. Having done both a custom solution and used struts, I feel that extending struts in this manner is incredibly powerful and under-used.<br><br>Also very useful as I'm in the process of mentoring a team of newbies onto struts and trying to convince them of its usefulness over Model 1 vanilla JSPs, and this provides yet another excellent reason!


  Message #146212 Post reply Post reply Post reply Go to top Go to top Go to top

using struts with FDF/PDF forms

Posted by: Sri Ram on November 16, 2004 in response to Message #145831
Any body can tell me whether can we use PDF forms instead of form in the jsp and struts. FDF toolkit allows us to extract the data filled in pdf forms - we normally use FDF toolkit and servlet to extract the same. But I m not too sure whether can I use this with struts framework.
if anybody can point some samples/articles on the same it will be great

  Message #146532 Post reply Post reply Post reply Go to top Go to top Go to top

Extending Struts

Posted by: Martin Anderson on November 18, 2004 in response to Message #146198
As another member suggested, u wud be better off convincing them of WebWork or Spring-MVC..
In a situation were you have J2EE developers on a J2EE system looking for an MVC framework that has a solid background, good documentation (standard docs and books), an excellent and supportive community and has more employment opportunities (220 v 3 on Jobserve this morning[18/11/04]), you have to go for Struts. On an enterprise system where object creation is an issue, especially on an early JVM, Struts will always score better than WW due to its architecture.

I’m a big fan of OpenSymphony, I think they do some great work (I always try to use clickstream for example), but I think that the big picture favours Struts at the moment. Even thought there are definitely issues such as ActionForm bloat, the market has gone for struts in a big way. I don’t know enough about Spring-MVC to comment but I believe that you can easily inter-op between a Struts presentation layer with a Spring mid-tier which would give you the best of both worlds.

  Message #201739 Post reply Post reply Post reply Go to top Go to top Go to top

Struts Extention

Posted by: Sergio Alemán on February 22, 2006 in response to Message #145958
i didn't understand the reason for i could extends struts framework to Spring Framework.
Can you explain it to me?
Thanks.

  Message #202001 Post reply Post reply Post reply Go to top Go to top Go to top

Plese Help!

Posted by: Sergio Alemán on February 24, 2006 in response to Message #145831
I was serching about build.xml file, to create .war with ANT. But, is possible the Eclipse generates autimatically this file. Can Eclipse generate automatically the build.xml file ???

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 2

Reza Rahman continues to explore the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (January 21, Article)

Ted Neward Q&A: What you must know about JavaScript, Scala and more

Ted Neward is an independent consultant specializing in high-scale enterprise systems, and an authority in Java and .NET technologies. He is the author and co-author of several books, including Effective Enterprise Java. At TheServerSide Java Symposium in March, he will be presenting sessions on pragmatic architecture, ECMAScript and Scala. (January 15, Article)

Developers split on open sourcing Java

Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP). While some say Oracle should become the new steward of Java and keep the JCP much as it was, others argue that it may be time to open-source this widespread language. (November 24, Article)

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map