jsp - How to populate values second time when the profile page link is located -
i have populated values in jsp drop downwards using jstl servlet array list. stored in request attribute , getting values in drop downwards during first page view (i.e) after login.
while making sec visit. can't find values in drop down. traced 1 time again expects request attribute same servlet. also, didn't want store values in session. approach may combat performance. wish avoid scriptlet coding. hence expect valuable suggestions or approach problem.
thank you.
servlet-link
http://xxx.xxx.xxx:8080/app/login
servlet
hmap = getuserprofile(con, request, session); system.out.println("requested result---> " + hmap); request.setattribute("accessconnect", con); request.getrequestdispatcher("home.jsp").forward(request, response); logger.info("user login successful=");
jstl
<strong>city</strong>: <select id="city" name="city"> <option value="scity">select city</option> <c:foreach var="cit" items="${result1}"> <option> <c:out value="${cit}"/> </option> </c:foreach>
hyperlink clicked profile page
http://xxx.xxx.xxx:8080/app/home.jsp
finally found out reply servlet should mapped in web.xml , method should called. drop downwards list working now
jsp servlets jstl
No comments:
Post a Comment