• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with CRUD operation in struts1.3

 
Abdul Wahab
Ranch Hand
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Abdul Wahab
Ranch Hand
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Abdul Wahab
Ranch Hand
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
PrfPage.jpg
[Thumbnail for PrfPage.jpg]
Main Page
articlepage.png
[Thumbnail for articlepage.png]
Crud form
 
Abdul Wahab
Ranch Hand
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any ideas or suggestions??
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic