• No results found

A.1 Modifying the File

The following 4.0 login.jsp file has been modified to display line numbers. The lines that require modifications have been highlighted, and a few extra spaces have been added to allow for a better display of the text.

1. <%@ page language="java" %>

2. <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>

3. <%@ page import="com.novell.nidp.common.provider.*" %>

12. response.setHeader("Pragma", "No-cache");

13. response.setHeader("Cache-Control", "no-cache");

14.

15. Locale locale = request.getLocale();

16. String strLanguageCode = locale.getLanguage();

17. String strImageDirectory = NIDPResourceManager.getInstance().getImage Directory(locale);

18. NIDPResource resource = NIDPResourceManager.getInstance().get (JSPResDesc.getInstance(), locale);

19.%>

20.

21.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//<%=strLanguage Code%>">

22.<html lang="<%=strLanguageCode%>">

23. <head>

24. <link rel="stylesheet" href="<%= request.getContextPath() %>/images/

hf_style.css" type="text/css">

25. <style type="text/css"

media="screen"><!--26. #headimage { position: relative; top: 0px; left: 0px; z-index: 1}

31. <META HTTP-EQUIV="Content-Language" CONTENT="<%=strLanguageCode%>">

36.

50. <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"

rightmargin="0" onLoad="document.IDPLogin.Ecom_User_ID.focus();" >

51. <form name="IDPLogin" enctype="application/x-www-form-urlencoded"

method="POST" action="<%= (String) request.getAttribute("url") %>"

AUTOCOMPLETE="off">

52. <table style="margin-top: 6em" width="100%" border="0" cellspacing="0"

cellpadding="0">

53. <tr>

54. <td width="50%" height="80 px">&nbsp;</td>

55. <td colspan="2">

56. <div id="title"><b><%=resource.getString0(JSPResDesc.

LOGIN_TITLE)%></b></div>

57. <div id="locallabel"><b><%=resource.getString0(JSPResDesc.

LOCAL_LOGIN)%></b></div>

58. <div id="headimage"><img src="<%= request.getContextPath() %>/images/

Odyssey_LoginHead.gif" alt="" height="80" width="550" border="0"></div>

59. </td>

60. <td width="100%">&nbsp;</td>

61. </tr>

62. <tr>

63. <td width="50%">&nbsp;</td>

64. <td style="background-color: #efeee9; padding: 10px" colspan="2">

65.<%

66. String err = (String) request.getAttribute(NIDPConstants.ATTR _LOGIN_ERROR);

67. if (err != null) 68. {

69. %>

70. <div><label><%=err%></label></div>

71. <% } 72.

73 // Determine if this login page is being used for account identification 74. // purposes

75. String id = (String) request.getAttribute("identify");

76. if (id != null && id.equals("true")) 77. {

78. %>

79. <div><%=resource.getString0(JSPResDesc.IDENTIFY)%></div>

80. <% } %>

81. <span id="login2" style="display: block;">

82. <table>

97. <div>

109. String prov = (String) request.getAttribute("provision");

110. if (prov != null)

124. <td width="100%">&nbsp;</td>

125. </tr>

126. <%

127. DisplayableProvider[] list = (DisplayableProvider[]) request.get Attribute("providers");

133. <td style="background-color: #efeeec; left: 10px; padding-bottom: 10px"colspan="2">

134. <div style="margin-left: -10px; background: url(<%=

request.getContextPath() %>/images/dotline_bg.gif) repeat-x">&nbsp;</div>

135. <div><b><%=resource.getString0(JSPResDesc.FEDERATED_LOGIN)%></b></

div>

136.<%

137. for (int i = 0; i < list.length; i++) 138. {

139.%>

140. <a style="padding: 5px" href="<%=list[i].getAuthenticationUrl (request.getContextPath())%>">

141.<%

142. if (list[i].hasIcon()) 143. {

144.%>

145. <img border=0 class="margin4" alt="<%=XMLUtil.stringToHTML String(list[i].getDisplayName())%>" src="<%=XMLUtil.stringToHTMLString (list[i].getIcon(request))%>" align="absmiddle"></a>

146.<%

147. }

155. } %>

162. <td style="background-color: #E6D88C; padding-left: 10px"><img style="padding-right: 200px" src="<%= request.getContextPath() %>/images/

LAP_interoperable_logo_100.gif" align="absmiddle" border="0"></td>

163. <td style="background-color: #E6D88C; padding-right: 10px"

align="right" width="100">

164.

165.<%

166. String cancel = (String) request.getAttribute("cancel");

167. if (cancel != null)

The following file shows all the changes that allow 4.0 login.jsp to compile on a 4.0 SP1 Identity Server. The deleted lines have been replaced with returns, so you can line this file up with the original to see the modifications.

<%@ page language="java" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//

<%=handler.getLanguageCode()%>">

<html lang="<%=handler.getLanguageCode()%>">

<head>

<link rel="stylesheet" href="<%= request.getContextPath() %>/images/

hf_style.css" type="text/css">

<style type="text/css"

#headimage { position: relative; top: 0px; left: 0px; z-index: 1}

<META HTTP-EQUIV="Content-Language" CONTENT="<%=handler.getLanguageCode()%>">

<title><%=handler.getResource(JSPResDesc.TITLE)%></title>

<meta http-equiv="content-type" content="text/html;charset=utf-8">

<script type="text/javascript" src="<%= request.getContextPath() %>/images/

showhide_2.js"></script>

<script language="JavaScript">

var i = 0;

<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"

rightmargin="0" onLoad="document.IDPLogin.Ecom_User_ID.focus();" >

<form name="IDPLogin" enctype="application/x-www-form-urlencoded"

method="POST" action="<%= (String) request.getAttribute("url") %>"

AUTOCOMPLETE="off">

<table style="margin-top: 6em" width="100%" border="0" cellspacing="0"

cellpadding="0">

<tr>

<td width="50%" height="80 px">&nbsp;</td>

<td colspan="2">

<div id="title"><b><%=handler.getResource(JSPResDesc.TITLE)%></b></div>

<div id="locallabel"><b><%=handler.getResource(JSPResDesc.PRODUCT)%></b></

div>

<div id="headimage"><img src="<%= request.getContextPath() %>/images/

<%

String err = (String) request.getAttribute(NIDPConstants.ATTR_LOGIN_ERROR);

if (err != null) {

%>

<div><label><%=err%></label></div>

<% }

<td width="100%">&nbsp;</td>

</tr>

<tr>

<td width="50%"></td>

<td style="background-color: #E6D88C; padding-left: 10px"><img style="padding-right: 200px" src="<%= request.getContextPath() %>/images/

LAP_interoperable_logo_100.gif" align="absmiddle" border="0"></td>

<td style="background-color: #E6D88C; padding-right: 10px" align="right"

width="100">

</td>

<td width="100%"></td>

</tr>

<%

if (NIDPCripple.isCripple()) {

%>

<tr>

<td colspan=4 width="100%"

align="center"><%=NIDPCripple.getCrippleAdvertisement(request.getLocale())%></td>

</tr>

<%

}

%>

</table>

</form>

</body>

</html>