サーブレットで Printwriter への href リンクを書いています。しかし、ブラウザはそれを無効なリンクとして表示します。
ここに私のコードがあります:
String path = request.getRequestURI();
path = path.substring(0, path.lastIndexOf('/'));
path = path + "/open-Account.html.html" ;
StringBuffer openAccountLink = new StringBuffer();
openAccountLink .append("<a href=").append("\"").append(path).append("\"");
openAccountLink .append(">").append("Create an account").append("</a>");
out.write("</br>");
out.print(openAccountLink .toString());
URL in the log:<a href="/content/pages/location/en_us/user/open-Account.html.html">
ログには href リンクの右上が表示されますが、ブラウザは無効なリンクであると不平を言います..これを克服するにはどうすればよいですか?