File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Migrating Application - From Struts with AJAX to JSF with AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Migrating Application - From Struts with AJAX to JSF with AJAX" Watch "Migrating Application - From Struts with AJAX to JSF with AJAX" New topic

Migrating Application - From Struts with AJAX to JSF with AJAX

Abhijit Panigrahi

Joined: Feb 25, 2009
Posts: 1

I have the following requirement. It will be great help if some one from the forum will able to advice us.

Problem Statement:
We have an application that is written in Struts. The struts application extensively uses AJAX. Let me explain the architecture of the existing application.
Existing Architecture
The application has struts based JSP page which uses AJAX for submitting the request and getting the response. After the form submission it goes to Action class and does the business processing using DAO and DTO pattern. The output is generated in XML format and send back through an response object. Then using AJAX the response object is rendered in JSP.
1. The existing architecture has extensive use of AJAX for struts which constructs the URL and other default settings for the application.
2. Action class is not well designed and it generates the XML file for response object inside it.

We want to migrate from Struts with AJAX application to JSF and AJAX. As I explained, we can not modify much AJAX and action class of struts, we need to find out a solution where we can do minimal changes to the action class and AJAX js files and achieve the target.

Our Thought Process
We need to find out a way to change the followings:
1. Form beans to Manage bean.
2. Struts-config to Faces-config.
3. Modify the JSP (use the JSF control instead of struts)
4. Call the action class inside the managed bean of JSF.

1. Not sure how to handle the request and response object of the AJAX call that is used in struts.(Note there is extensive use of AJAX). Rewriting the AJAX js file is not possible because of time frame.
2. How to render the XML response object in JSF.
3. How to do calls to AJAX request and response object.

Please feel free to contact me if you need any further clarifications in the requirements.

It will be a great help if someone can suggest how to proceed with this.


I agree. Here's the link:
subject: Migrating Application - From Struts with AJAX to JSF with AJAX