| | |
help me
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
thats ok after getting the data from the database i need to display the values in text fields. I mean when i select the username in drop down all the information of that perticular user should be displayed in the text.......which is nothing but getting user info...so wat i have to do?
If it is JSP then use: <%= variable%> to display the value of variable in HTML
Check out my New Bike at my Public Profile at the "About Me" tab
•
•
Join Date: Sep 2008
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
What is your problem? Getting the data from DB or displaying them? Because displaying them is easy. Just call the setText() method of the JTextFields you have. It you want JTextArea call the append() method.
If it is JSP then use: <%= variable%> to display the value of variable in HTML
in our project we have admin module. ok when admin login into his account if he wants to change user information which is nothing but usermanagement section(usermanagement.jsp). when admin comes this page there is a drop down. In that drop down all the username should be fetched from the database so that when admin selects perticular username then in remaining fields such as designation, role, email should come from database for that perticular user.
now am getting all the user names in drop down which is as shown below
<%!ArrayList usernameslist; %>
<%
InsertRegister insrt=new InsertRegister();
try{
usernameslist=insrt.editUserInfo();
}
catch(SQLException sqe)
{
out.print(sqe.toString());
}
%>
<select type="text" name="select" class="spacer" id="select" onchange="fnChangeHandler_A(this, event); submitAction('EditUserInfo');">
<option>Select UserName</option>
<% Iterator itres=usernameslist.iterator();
while(itres.hasNext())
{ String value=(String)itres.next();
out.println("<option value='"+value+"' onclick='submitAction('EditUserInfo')'>"+value+"</option>");
}%>
</select>
</label></td>
</tr>
now the problem is i need to get the information into the text box by using this username list.
i think now you got my problem...
Last edited by rakesh.mk; Oct 1st, 2008 at 3:54 am.
•
•
•
•
ya its a part of application. i need edit user information and store new values into same location.
•
•
•
•
JSP Syntax (Toggle Plain Text)
<%!ArrayList usernameslist; %> <% InsertRegister insrt=new InsertRegister(); try{ usernameslist=insrt.editUserInfo(); } catch(SQLException sqe) { out.print(sqe.toString()); } %> <select type="text" name="select" class="spacer" id="select" onchange="fnChangeHandler_A(this, event); submitAction('EditUserInfo');"> <option>Select UserName</option> <% Iterator itres=usernameslist.iterator(); while(itres.hasNext()) { String value=(String)itres.next(); out.println("<option value='"+value+"' onclick='submitAction('EditUserInfo')'>"+value+"</option>"); }%> </select> </label></td> </tr>
Request made to move this to JSP section...
Database connectivity from JSP is bad thing thing to do. Use servlets!
Secondly please start using [code]YOUR CODE HERE[/code]
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Other Threads in the JSP Forum
- Previous Thread: Form data
- Next Thread: servlet +tomcat 5.0.28+access database+problems
| Thread Tools | Search this Thread |
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write






