I have a JSP page that connect to backend via useBean. When I called the data from the backend i.e DataBase. I loop through my records and display them in HTML input value tag. The Idea was for someone to modify this record and send it Back to the backend as an update. I have tried so many tricks but could not get it to work.
I have a servlet that listern to events within the container. When the submit button is click the container listern to these events. The rest work fine. I do not need a <FORM action> framework. My program is on MVC
Here is the servlet the controls all the event enerated by clicking a button. i.e
This key and value are store in a properties file i.e To_EDIT_INVENTORY=com.org.bugtracker.event.ToEditInventory.java
A properties file mapped to URL i.e To_EDIT_INVENTORY=/jsp/toEditInventory.jsp
This is MVC. The rest of the file works. But to update this fields when they are called from database is the problem
The send button eventListener sends it to an event class that belongs to this action called ToEditInventory.java . In that class I have all the logic to update the database i.e
String query = "UPDATE inventory SET dept=?, room=?, ... WHERE ip=136.148.128.106
Mind you this is an internal LAN IP so you can not reach it (WARNING) You need to compromise the proxy server then compromise the ISA's, then compromise the Packet filtering ISA and them the almighty Millennium gatewatcher that runs on UNIX also act as a router filtering to the rest of the DSN Servers.
Anywaay sorry I wondered away. But when I click on the submit button the database do not update
well, you have a <form> on the page... note, the person who responded was correct. Without an action attribute for the form, your page won't work. Now that 2 of us are telling you the same thing, will you listen?
and while I'm on a rant, don't go on and on about MVC when you have sql on a jsp. The "V" in MVC is View, and jsp is a technology primarily designed for view, not logic like sql. The results from the query are part of the "M", the model, and the "C", while I'm at it, is controller.
Thank you all for you input. I still don't want to use <form action> framework. Phranquie thanks for the MVC lecture. Below is my actual controller. Next after controller is Model, above is the View. I know I'm not suppose to use SQL in view but I did that when I got frustrated with the work. I just want is to work.
String query = "UUPDATE inventory SET harddrive='10' WHERE ip='136.148.128.106'";
try{
if( !demo.isConnect( ) )
demo.connect( );
demo.executeQuery ( query );
}catch ( Throwable e ){
}//End exception
}//End process
}//End EventBaseHandler class
Look at it properly what I did was to have one controller for all my event either through <form action=controller Method=POST> or <form> send a hidden action called name=event value=TO_EDIT_INVENTORY they all do the same. Tell me otherwise
String query = "UUPDATE inventory SET harddrive='10'
WHERE ip='136.148.128.106'";
First Valentine, I don't know if this is where the problem is, but I think you should look at the piece of code shown above. The update statement is not correct. It should be update, not uupdate.
Change that first and see if it works, otherwise let us know