This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with CRUD operation in struts1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with CRUD operation in struts1.3" Watch "Problem with CRUD operation in struts1.3" New topic
Author

Problem with CRUD operation in struts1.3

Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

Hi Ranchers,
I have two pages Prf.jsp and PrfArticle.jsp both are mapped to the same form bean. Prf page has a Table (also other form values) which
performs CRUD (Create, Retrieve, Update, Delete) Operation with form values getting from PrfArticle page. Using Dispatch Action i am forwarding
from Prf Page to Article Page it works fine. The Problem I am facing is whenever i forward from Article to Prf Page the Page gets refreshed.
Is the any way to achieve this without getting the page reloaded. Any help on this will be highly appreciated..


As long as breath left in my body there is hope
Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

Hi,
Is it possible to Implement a single action on two jsp pages . I mean keeping prfArticle page inside prf page and implementing crud operation using ajax (on PrfArticle page).
can anyone help me on this issue.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

Do you have experience with AJAX? Struts is a server-side framework. What you do with that information on the client side doesn't matter to Struts. Struts 2 makes AJAX easier with a jQuery plugin and JSON result encoding.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

thank you very much for the response. Actually I don't have much experience in Ajax,
To be clear i need to implement crud operation inside a form. i need to try this in struts1. I have attached image of my form for better understanding



[Thumbnail for PrfPage.jpg]


[Thumbnail for articlepage.png]

Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

Any ideas or suggestions??
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

I'd use a jQuery Dialog to display prfArticle. When the dialog closes, I'd refresh the list on prf from the database via an AJAX call.
What have you tried so far?
Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

Joe,
Sorry for the late response. I tried using Dispatch action. I kept both pages properties in a single form bean and in a single action. I access article page by forwading from
prf page. After saving article form (or page) i return the action to the prf page (actually forwading). thereby the prf page gets refreshed. Actually i was searching similar to Jquery Dialog
and boy you gave me the perfect one i started learning jquery now.. thanks dude
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

Yea, jQuery is awesome. If you need help, have a look at our HTML, CSS and JavaScript forum. One of our moderators wrote the book on jQuery.
Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

Joe,
I am unable to submit jquery dialog via ajax . My Dialog elements are inside a form which is inside the main form (form inside form).
my codes are,


My Questions are,
1. Can i have nested form tag
2. Is there an alternate way to pass article form values to servlet to store in DB

thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with CRUD operation in struts1.3
 
Similar Threads
Passing parameters between pop window JSP page and parent JSP page
Spring Webflow: Type Mismatch error is thrown even after setting Validation to false
jgrid - Spring MVC CRUD operation with pagination and without page refresh
call is not going to the backend in ie8 but it is working good in fire fox
Null pointer Exception while inserting values in to DB