質問するログイン新規登録

質問編集履歴

1

トップページのJSPファイルのコードを追加

2018/06/20 12:16

投稿

naruseyoshiki
naruseyoshiki

スコア12

title CHANGED
File without changes
body CHANGED
@@ -25,4 +25,44 @@
25
25
  note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.
26
26
 
27
27
 
28
- GlassFish Server Open Source Edition 4.1.1 」
28
+ GlassFish Server Open Source Edition 4.1.1 」
29
+
30
+ 以下が実行したトップページです。
31
+
32
+ ```Java
33
+
34
+ <%@page import="javax.servlet.http.HttpSession"
35
+ import="kagoyume.KagoyumeHelper"
36
+ import="kagoyume.UserData"
37
+ import="kagoyume.UserDataDTO" %>
38
+ <%
39
+ HttpSession hs = request.getSession();
40
+ UserDataDTO udd = (UserDataDTO) hs.getAttribute("udd");
41
+ KagoyumeHelper kh = KagoyumeHelper.getInstance();
42
+ String login = hs.getAttribute("login").toString();
43
+ String reinput = "";
44
+ String keyword = "";
45
+
46
+ %>
47
+
48
+ <%@page contentType="text/html" pageEncoding="UTF-8"%>
49
+ <!DOCTYPE html>
50
+ <html>
51
+ <head>
52
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
53
+ <title>かごゆめトップページ</title>
54
+ </head>
55
+ <body>
56
+ <%=kh.mydata(udd, login)%><%=kh.cart(login)%><%=kh.login(login)%>
57
+ <h1>かごゆめ</h1><br><br>
58
+ <h3>ここは好きなものを自由に買える気分になれる「かごゆめ」です。</h3><br><br>
59
+ <form action="Search" method="GET">
60
+ <input type="search" name="keyword" value="<%if (!reinput.equals("")) {
61
+ out.print(keyword);
62
+ }%>"required>
63
+ <input type="submit" value="検索">
64
+ </form>
65
+ </body>
66
+ </html>
67
+
68
+ ```