質問編集履歴
2
全角スペースを修正しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
String hiStr = request.getParameter("hi");
|
18
18
|
|
19
19
|
String[] results = {"大吉", "吉", "中吉", "小吉", "凶"};
|
20
|
-
|
20
|
+
int rdm = ((int)(Math.random()*5));
|
21
21
|
return result[rdm];
|
22
22
|
%>
|
23
23
|
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<div style="text-align: center;margin-left:auto; margin-right:300px;">
|
42
42
|
<a href="/JV16/question1.jsp">戻る</a>
|
43
43
|
</div>
|
44
|
-
```
|
45
|
-

|
45
|
+

|
46
46
|
ランダムに運勢を表示したいのですがエラーがでてしまいうまくいきません
|
47
47
|
このソースのなかでどこを直せばいいのか、知識のある方に教えていただきたいです。
|
1
コードの挿入
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,47 @@
|
|
1
|
+
```jsp
|
2
|
+
コード
|
3
|
+
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
|
4
|
+
<%@ page import="java.util.Date" %>
|
5
|
+
<%@ page import="java.util.Calendar" %>
|
6
|
+
<%@ page import="java.lang.Math" %>
|
7
|
+
<% request.setCharacterEncoding("UTF-8");%>
|
8
|
+
|
9
|
+
<%
|
10
|
+
String namaeStr = request.getParameter("namae");
|
11
|
+
String yubinStr = request.getParameter("yubin");
|
12
|
+
String jyusyoStr = request.getParameter("jyusyo");
|
13
|
+
String denwaStr = request.getParameter("denwa");
|
14
|
+
String seibetuStr = request.getParameter("seibetu");
|
15
|
+
String nenStr = request.getParameter("nen");
|
16
|
+
String tukiStr = request.getParameter("tuki");
|
17
|
+
String hiStr = request.getParameter("hi");
|
18
|
+
|
19
|
+
String[] results = {"大吉", "吉", "中吉", "小吉", "凶"};
|
20
|
+
int rdm = ((int)(Math.random()*5));
|
21
|
+
return result[rdm];
|
22
|
+
%>
|
23
|
+
|
24
|
+
<html>
|
25
|
+
|
26
|
+
<body>
|
27
|
+
<h1>入力確認画面</h1>
|
28
|
+
<p><font size="4">項目名 内容</font></p>
|
29
|
+
お名前 <INPUT name="namae" SIZE=40 VALUE=" <%=namaeStr%>"><br>
|
30
|
+
郵便番号 <INPUT TYPE="TEXT" name="yubin" SIZE=40 VALUE="<%=yubinStr%>"><br>
|
31
|
+
住所 <INPUT TYPE="TEXT" name="jyusyo" SIZE=40 VALUE="<%=jyusyoStr%>"><br>
|
32
|
+
電話番号 <INPUT TYPE="TEXT" name="denwa" SIZE=40 VALUE="<%=denwaStr%>"><br>
|
33
|
+
性別 <INPUT TYPE="TEXT" name="seibetu" SIZE=40 VALUE="<% if ( seibetuStr.equals( "1" ) ) { %>
|
34
|
+
男性
|
35
|
+
<% } else { %>
|
36
|
+
女性
|
37
|
+
<% } %>"><br>
|
38
|
+
生年月日 <INPUT TYPE="TEXT" name="seinen" SIZE=40 VALUE="<%=nenStr%>年<%=tukiStr%>月<%=hiStr%>日"> <br>
|
39
|
+
運勢 <%=results%> <br>
|
40
|
+
|
41
|
+
<div style="text-align: center;margin-left:auto; margin-right:300px;">
|
42
|
+
<a href="/JV16/question1.jsp">戻る</a>
|
43
|
+
</div>
|
1
|
-

|
44
|
+
```
|
2
45
|

|
3
46
|
ランダムに運勢を表示したいのですがエラーがでてしまいうまくいきません
|
4
47
|
このソースのなかでどこを直せばいいのか、知識のある方に教えていただきたいです。
|