###前提・実現したいこと
閲覧誠に有難う御座います。
只今eqlipceを使いJSP、servletで開発しているのですが、
コンパイル、実行など出来ているエラーではないのと思うのですが、
以下のようなメッセージが黄色い波線と共に表示されました。
どこがおかしいか分からないのでご指摘お願い致します。
参考までに下記にソース及び、メッセージを記載しておきます。
###発生している問題・エラーメッセージ
Invalid location of text (<% Connection con = null; PreparedStatement ps = null; String sql = null; ResultSet rs = null; try{ InitialContext initContext = new InitialContext(); DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/Library"); con = ds.getConnection(); sql = "SELECT user_no,first_name,last_name,first_name_kana,last_name_kana,user_id,password FROM user"; // SELECT命令の準備 ps = con.prepareStatement(sql); // UPDATE命令を実行 rs = ps.executeQuery(); // 結果セットの内容を順に出力 while(rs.next()){ %>) in tag (<tr>).
###JSP
java
1<%@ page contentType="text/html; charset=UTF-8" 2import="java.sql.*,javax.naming.*,javax.sql.*,java.text.*"%> 3<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> 5 6 7<html> 8 9 10<sql:setDataSource var="db" driver="com.mysql.jdbc.Driver" 11 url="jdbc:mysql://localhost/Library" user="root" password="" /> 12 13<sql:query var="rs1" dataSource="${db}"> 14 select * from user 15</sql:query> 16<head> 17<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 18 19<title>ユーザ管理画面</title> 20</head> 21<body> 22<h2>ユーザー管理画面</h2> 23 24<form method="POST" action="user_edit"> 25ユーザーID 26 <select name="user_no"> 27 <c:forEach var="row" items="${rs1.rows}"> 28 <option value=${row.user_no}>${row.user_id}</option> 29 </c:forEach> 30 </select> 31 <br> 32名前(姓) 33<input type="text" name="first_name" size="30"> 34名前(名) 35<input type="text" name="last_name" size="30"> 36<br> 37カナ(姓) 38<input type="text" name="first_name_kana" size="30"> 39カナ(名) 40<input type="text" name="last_name_kana" size="30"> 41<br> 42ID 43<input type="text" name="user_id" size="30"> 44パスワード 45<input type="password" name="password" size="30"> 46<br><br> 47 48<input style="color:white; 49 background-color:D57200;" type="submit" value="更新"/> 50 51</form> 52 <c:if test="${!empty requestScope['errorMessage']}"> 53 <div>${requestScope['errorMessage']}</div> 54 </c:if> 55<h3>ユーザリスト</h3> 56<table border="1" width=70%> 57<tr> 58<th>ユーザNo</th> 59<th>名前(姓)</th> 60<th>名前(名)</th> 61 62<th>カナ(姓)</th> 63<th>カナ(名)</th> 64 65<th>ID</th> 66<th>パスワード</th> 67</tr> 68<% 69 70Connection con = null; 71PreparedStatement ps = null; 72String sql = null; 73ResultSet rs = null; 74try{ 75 InitialContext initContext = new InitialContext(); 76 DataSource ds = (DataSource) initContext.lookup("java:comp/env/jdbc/Library"); 77 con = ds.getConnection(); 78sql = "SELECT user_no,first_name,last_name,first_name_kana,last_name_kana,user_id,password FROM user"; 79 80// SELECT命令の準備 81ps = con.prepareStatement(sql); 82 83// UPDATE命令を実行 84rs = ps.executeQuery(); 85// 結果セットの内容を順に出力 86while(rs.next()){ 87 88%> 89 90<tr> 91<td height=70><%=rs.getString("user_no") %></td> 92<td height=70><%=rs.getString("first_name") %></td> 93<td height=70><%=rs.getString("last_name") %></td> 94<td height=70><%=rs.getString("first_name_kana") %></td> 95<td height=70><%=rs.getString("last_name_kana") %></td> 96<td height=70><%=rs.getString("user_id") %></td> 97<td height=70><%=rs.getString("password") %></td> 98 99<% 100} 101}catch(Exception e){ 102 throw new ServletException(e); 103 104}finally{ 105 try{ 106 if(rs != null){rs.close();} 107 if(rs != null){ps.close();} 108 if(rs != null){con.close();} 109 }catch(Exception e){} 110 111 } 112%> 113</table> 114<form action="kanri_mypage.jsp"> 115<input style="color:white; 116 background-color:D57200;" type="submit" value="TOPページ"> 117</form> 118<form action="user_kanri.jsp"> 119<input style="color:white; 120 background-color:D57200;" type="submit" value="戻る"> 121 122 123</form> 124</body> 125</html>

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。