Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <%!
- String username=null;
- String password=null;
- %>
- <%
- Cookie [] cookies=request.getCookies();
- if(cookies!=null) {
- for (int i = 0; i < cookies.length; i++) {
- if (cookies[i].getName().equals("username")) {
- username = cookies[i].getValue();
- }
- }
- }
- %>
- <form action="/helloworld" method="post">
- <input type="text" name="name" value="<%=username%>">
- <input type="submit">
- </form>
- </body>
- if(cookies!=null)
- Servlet.service() for servlet [jsp] in context with path [] threw exception [An exception occurred processing JSP page /index.jsp at line 20
- 17: %>
- 18: <%
- 19: Cookie [] cookies=request.getCookies();
- 20: for(int i=0;i<cookies.length;i++){
- 21: if(cookies[i].getName().equals("username")) {
- 22: username=cookies[i].getValue();
- 23: }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement