2013-10-09 2 views
0

기본적으로 내 컨트롤러에서 내 JSP로 데이터를 전달하여 내 응용 프로그램을 통해 데이터를 전달하려고합니다. 주요 아이디어는 URL 당 데이터를 얻고 i를 서비스 메소드에 보내는 것입니다. 단순히 비밀번호를 변경하는 데 사용하고 싶습니다.컨트롤러에서 jsp로 데이터 전달하기

는 컨트롤러 :

@RequestMapping("/passwordSetForm") 
public String redirectToPasswordForm(@RequestParam(value = "token") String token) { 

    log.debug("+++++token: '{}'",token); 
    return "form"; 
} 
토큰 당 암호, 식별을 변경하는 형태를 돌려줍니다

.

JSP는 :

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
pageEncoding="ISO-8859-1"%> 
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 

    <head> 
     <title>Set Password/title> 
    </head> 

    <body> 

     <form name="f" action="<%= request.getContextPath() %>/setPassword" method="POST"> 
      <table> 
       <tr> 

        <td> 
         <input class="field" type='text' id="password" name='password' size="20" /> 
         <input type="hidden" name="token" id="token" value="${ token }" />  
        </td> 
       </tr> 
       <tr> 
        <td colspan="2">&nbsp;</td> 
       </tr> 
       <tr> 
        <td colspan='2' align="center"> 
         <input name="submit" type="submit" value="SET" /> 
        </td> 
       </tr> 
      </table> 
     </form> 
    </body> 
</html> 

나는 다음 컨트롤러 방법으로 토큰 저점을 통과합니다. 하지만 변수 만 얻고 토큰 값은 얻지 못합니다. 수입품이나 무언가를 잊고 있습니까? 도움이 필요하면 Thx.

+0

당신이 암호 정보를 처리 할 때 POST 방법을 사용하지 않는 것이 좋습니다. – lsp

답변

1

는 다음과 같은 시도 :

<input type="hidden" name="token" id="token" value="<%= request.getParameter("token") %>" />  
관련 문제