How to get Data from Mysql to be in Value of text in servlet
I try this code but it is not working
while(rs.next()){
out.println("<form action=\"userpage\" method=\"post\">"
+ " <input type=\"text\" name=\"ID_customer\" value=\"<%=rs.getString(1)%>\">"
+ "</form>");
}
You should have to create separate view (.jsp) instead of producing dynamic content of html in
Servlet.First of all create the
List<T>to represent database result in servlet or model class and assign thatlistobject into request (request scope) viarequest.setAttribute()method.In servlet,
The view show.jsp should be: