File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help on basic struts

 
Venkatesh Goriparthy
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am learning struts. I have an issue in doing my hands on.

In my form, I have an textbox, whose value can be populated from database and have an update button , where the user can change the value in the textbox and click on update button. this value should get updated in database. this updation should be tracked as an event. The whole form should not get submitted.

After this not knowing what I need to do....
Please help me how i need to do this.

Thanks!!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way to cause an update to the database without submitting the form is to use AJAX, which is way beyond the scope of a beginning Struts project. Is this a school assigment?
 
Venkatesh Goriparthy
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we not even refresh the page.. like submitting the page and redirecting to same page or forward the action.
my java script is like this on click of the button
pForm.action="updateUserName.do?method=executeAction&userName="+userName+"&flag="+flag;
pForm.submit();

This is giving blank page aftr clicking on the button. and in the url v can see the changed username.
[ July 16, 2008: Message edited by: Venkatesh Goriparthy ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, forwarding to the same page is the right way to handle this. Just be careful, though, with the words you use to describe a problem. Saying "The whole form should not get submitted" is not the same as saying "after submitting the form, the same page should be displayed".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic