2012-03-16 2 views
0

WebFont를 사용하는 Spring 로그인 양식이있는 경우. 처음으로 로그인 양식을 제출하면 브라우저에서 다운로드 할 웹 글꼴의 .ttf 버전을 제공합니다. 그런 다음 다운로드를 중단하고 제출 버튼을 다시 클릭하면 로그인이 작동하고 리디렉션됩니다. 이 오류는 IE 8 & 9에서 모든 로그인 (놀랄 일도 없음) 및 캐시 지우기 후에 만 ​​FF 10에서 재현 할 수 있습니다. 이것은 게시 할 수있는 방법으로 만 발생합니다. 얻으십시오, 그러나 그것은 분명히 로그인 폼을위한 해결책이 아닙니다 ...양식 게시시 다운로드 할 수있는 Webfont

어떤 원인이 도움이 될지도 모릅니다.

은 여기에 CSS 파일입니다 :

@charset "utf-8"; 

/* first for IE 6/7/8 */ 
@font-face { 
    font-family: KievitWebProBook; 
    src: url(/fonts/KievitWebPro-Book.eot); 
    src: url(/fonts/KievitWebPro-Book.eot?) format('eot'), 
     url(/fonts/KievitWebPro-Book.woff) format('woff'), 
     url(/fonts/KievitOffcPro-Book.ttf) format('truetype'); 
} 

body { font-family: KievitWebProBook, sans-serif; } 
div.logo { margin-left: auto; margin-right: 150px; margin-top: 100px; text-align: right; } 
div.header { width: 90%; margin: 0px auto 20px auto; color: #788995; font-size: 24px; padding-left: 300px;} 
div.divider { width: 90%; margin-left: auto; margin-right: auto; height: 5px; background-image: url(/images/gradient5px.png); background-repeat: repeat-x;} 
table { margin-top: 40px; margin-left: 300px; width: 330px; background-color: #eaedef; padding: 10px;} 
td.header { text-align: center; font-size: large; padding: 5px; } 
td.error { color: #0076ae; font-size: small; } 
td.errorcode { color: #98a5ae; font-size: small; text-align: right; font-size: 12px;} 
td.input input { width: 100%; color: #a6b1b9; font-size: 12px; } 
td.submit { text-align: left; width: 50% } 
td.subtext { text-align: right; color: #0076ae; font-size: x-small; width: 50%; } 
td.subtext a { color: #0076ae; } 

그리고 여기 JSP있어 :

코드는 꽤 솔직하다

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" 
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" 
%><%@ taglib prefix="spring" uri="http://www.springframework.org/tags" 
%><?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title><spring:message code="login.title"/></title> 
    <link rel="stylesheet" type="text/css" href="<c:url value='/css/login.css'/>" /> 
    <script type="text/javascript"> 
    <!-- 
    function clearInput(inp) { 
     if (inp.value === inp.defaultValue) { 
      inp.value = ""; 
     } 
    } 

    function restoreInput(inp) { 
     if (inp.value === "") { 
      inp.value = inp.defaultValue; 
     } 
    } 
    --> 
    </script> 
</head> 
<body> 
    <div class="logo"><img src="<c:url value="/images/logo.png"/>" alt="Logo" /></div> 
    <div class="header"><spring:message code="login.title"/></div> 
    <div class="divider"></div> 
    <form action="j_spring_security_check" method="post"> 
    <table> 
     <tr> 
      <td class="input" colspan="2"><input name="j_username" type="text" onfocus="clearInput(this);" onblur="restoreInput(this);" value="<spring:message code="login.username"/>" /></td> 
     </tr> 
     <tr> 
      <td class="input" colspan="2"><input name="j_password" type="password" onfocus="clearInput(this);" value="<spring:message code="login.password"/>"/></td> 
     </tr> 
     <tr> 
      <td class="submit"><input type="submit" value="<spring:message code="login.loginbutton"/>"/></td> 
      <td class="subtext"><a href="newpass.jsp"><spring:message code="login.newpass"/></a></td> 
     </tr> 
     <c:if test="${not empty param.login_error}"> 
     <tr> 
      <td class="error" colspan="2"><spring:message code="login.error"/></td> 
     </tr> 
     <tr> 
      <td class="errorcode" colspan="2">Code: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/></td> 
     </tr> 
     </c:if> 
    </table> 
    </form> 
</body> 
</html> 

답변

0

이보십시오. 그것은 작동 할 수 있습니다 -

@font-face { 
    font-family: 'PTSansNarrowRegular'; 
    src: url('PTN57F-webfont.eot'); 
    src: url('PTN57F-webfont.eot?#iefix') format('embedded-opentype'), 
     url('PTN57F-webfont.woff') format('woff'), 
     url('PTN57F-webfont.ttf') format('truetype'), 
     url('PTN57F-webfont.svg#PTSansNarrowRegular') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
    } 

이것은 내장 된 폰트에 대한 FontSquirrel의 CSS에서 추출합니다.
희망이 도움이됩니다.

관련 문제