I m having a problem passing this data to a new JSP.
please help me.plz give some example of code.
BTW, You can pass the data by sending info through query string, setting the info into session or if You are forwarding to the second jsp through parameter tags.
i have done one page that handle all databse related events
and one is JSP page in between a hidden page that handle the some action so
the time of execugtion will reduce.
i send u some code of db handler and hidden page
this is hidden page
String mode = request.getParameter("mode");
String userId = (String)session.getAttribute("User");
ArrayList guser = new ArrayList();
boolean successFlag = false;
DBHandler dbh = new DBHandler();
successFlag = dbh.modifyguser(guser);
if(successFlag = true)
throw new AppException("error Insert");
this is db handler page
public boolean modifyguser(ArrayList guser)
boolean flag = false;
String mode = (String) guser.get(0);
String userId = (String)guser.get(1);
String userName = (String) guser.get(2);
String password = (String) guser.get(3);
String department = (String) guser.get(4);
String companyName = (String) guser.get(5);
String level = (String) guser.get(6);
String Status = (String) guser.get(7);
Statement st = con.createStatement();
String Query ="select mst01_company,mst01_uid,mst01_user_name,mst01_pwd,mst01_dept,mst01_user_lvl,mst01_status from mst01_user where mst01_uid ='"+userId+"'";
ResultSet rs = st.executeQuery(Query);
flag = true;
companyName = rs.getString(1);
userId = rs.getString(2);
userName = rs.getString(3);
password = rs.getString(4);
department = rs.getString(5);
level = rs.getString(6);
Status = rs.getString(7);
catch (SQLException ex)
By the way...
UBB Code tags around your posted code will make it much more readable and thus , more likely to be read by someone who could help you.
[ May 20, 2005: Message edited by: Ben Souther ]
JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.
Please read this for more information.
Originally posted by Kumar Navin:
Did you ever tried RequestDispatcher interface. It has the facility of passing on the request object and then the information be retrieved on the page before a response is sent.
He's using jsp:forward which uses a requestDispatcher in the generated servlet code.