좋습니다.이 간단한 예제를 시도했습니다. http://www.mkyong.com/struts2/struts-2-property-tag-example/. 사전 행동에서 속성을 설정하고 jsp에서 속성을 표시하는 것만이 아닙니다. 그것은 나를 위해 일했고 문제는 없었다.Struts2 속성 값이 설정되었지만 비어있는 것으로 표시됩니다.
나는 모든 작업 요청을 차단하고 새로운 인터셉터 스택 (기본 스택 + 새로운 인터셉터)을 작업 구성으로 참조하는 인터셉터를 추가하려고 시도했습니다. 그런 다음 빈 속성을 표시하는 문제가 시작되었습니다. 조치 클래스에 설정된 특성은 jsp에서 더 이상 액세스 할 수 없습니다. 왜 그런가? 여기
내 설정이다 :<action name="propertyTagAction" class="com.mkyong.common.action.PropertyTagAction" >
<result name="success">pages/property.jsp</result>
<interceptor-ref name="customStack">
<param name="operationMode">STORE</param>
</interceptor-ref>
</action>
<interceptors>
<interceptor name="customInterceptor" class="...">
<param name="operationMode">STORE</param>
</interceptor>
<interceptor-stack name="customStack">
<interceptor-ref name="customInterceptor"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</interceptor-stack>
</interceptors>
당신이 당신의'customInterceptor'에 대한 코드를 보여 수 없습니다. –
음, 여기에 넣을 수없는 코드가 들어 있습니다. 기본적으로, 그것은 사용자 액세스를 검사 할 인터셉트 메소드를 포함합니다. 검사가 실패하면 유효성 검증 오류 메시지가 메시지 저장 인터셉터에 추가됩니다 (나중에 사용하기 위해). 그렇지 않으면 actionInvocation.invoke()를 사용하여 액션이 호출됩니다. 이 문제를 일으킨 것으로 생각되는 부분에 무엇이있을 것으로 예상됩니까? – mystarrocks
누가 알겠는가?하지만 분명히 그것은 당신의 인터셉터 나 설정과 관련이있다. 최소한의 실패 사례를 게시하지 않으면 도움이되지 않습니다. –