wood burning stoves 2.0*
The moose likes Struts and the fly likes Need immediate help, my job is stuck Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need immediate help, my job is stuck" Watch "Need immediate help, my job is stuck" New topic
Author

Need immediate help, my job is stuck

kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Hi,

Sorry to be late here, but i need an immediate help. I am new to struts and recently put into a struts project.

FYI

I have a jsp file, where I am getting values from SQL SERVER 2000 database using an Action Class and A Form Bean.
This jsp view is as a tabular format, where data is populated.
Selectbox text checkbox checkbox text text cancel_image

This page having operations like cancel_row / save_table / add_row

First : I need to populate the values from database to this jsp page during the opening of this page
Second : how can I add row to this table dynamically so that I can enter a few records and save the data to the database.
Third : When I save the records the values must go to ActionServlet, where I need them all in an ArrayList.

Kindly see the code below.

-Thanks & Regards,
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

"Immediate" help is unlikely, as this is a forum that people read at their leisure.

It's also a completely useless subject line: see here.

Without the use of code tags code is very difficult to read--particularly when there's that much of it. I'll try to read it, but I'm also suspicious that this much code was necessary to communicate the problem.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You don't actually state what problem(s) you're having. Are you unable to do one or more of the three things you list as the requirement?
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Hi David,

I really understand, i did some stupid thins here. But i was quite confused with my work and i posted here in hurry. I will take care of this next time.

Yes, i am not sure what to do with this on this level. hope you can suggest me a solution.


-Thanks & Regards,
Kaushal Sharma
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

A solution for what? You don't say what isn't working.

You can edit your post to include code tags, or re-post using them correctly.
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
hi David,

Kindly let me know how to post my code in the best fit?



-Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

By following the link I gave you about code tags.

Here it is again:

http://faq.javaranch.com/java/UseCodeTags
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Thanks David for such a helpful information.

Here i go....

my JSP FIle,






My ActionServlet ....





My Form Bean....














hope you can provide me some help.



-Thanks & Regards,
Kaushal K. Sharma



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Do you really not indent your code?!

Again: help with ***what***? What doesn't work?
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Hi David,

Actually i need get data from database to my jsp page that will be displayed in a form - tabular form. I have created the view and the first field with <select>


is working fine, similarly i need data for other fields.

Later, i need to do some operations on the jsp page like 'save', 'add field', 'delete', 'cancel'.

As you look into the jsp page every last column in the table is having an in image to delete the row with the data from the database. i am not sure how to do this...

i created a javascript function to add and delete the row but need to add records to the database when i click to 'save' button and delete the records from the database when i click on the 'cancel' image in last coulmn of every row. the add and delete fuctions are as given below,




i need to send data back to my ActionServlet in an arraylist.


Please suggest.


-Thanks & Regards,
Kaushal K. Sharma
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Hi David,

Are you there?



Please suggest me anyone.




-Thanks & Regards,
Kaushal K. Sharma
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please see this.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So you have one field--why don't you have the rest? How are you sending the data to the JSP?

Do your JavaScript functions for adding/deleting rows work? Are you using indexed fields?

What version of Struts are you even using?
kaushal sharma
Greenhorn

Joined: Oct 04, 2009
Posts: 26
Hi David,

Yes, i used Indexed Fields.



-Thanks & Regards,
Kaushal K. Sharma


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You answered one question out of five :/

If you're using indexed fields, and your JavaScript works correctly, and your ActionForm is defined correctly, then I don't know what the problem is, and you don't want to tell us.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need immediate help, my job is stuck