저는 Struts 1.2와 J2EE 1.4를 사용하고 있습니다. 저는 Struts와 Java에 익숙하지 않았습니다. 제 문제에 대한 간단한 해결책이 있기를 바랍니다. 나는이 같은 설정 페이지가 있습니다커스텀 변수를 자바의 Struts 애플리케이션의 요청에 어떻게 저장할 수 있습니까?
<div class="success">
HTML for success
</div>
<div class="error">
<p>We are experiencing technical difficulties at this time. Please try your request again later.</p>
</div>
<div id="contact-form-block">
<html:form action="/reg" id="contactform">
<br /><html:text property="firstName"/><html:errors property="firstName"/>
<p><input type="image" src="images/reset_btn.png" id="reset" name="reset" alt="Reset" /><input type="image" src="images/submit_btn.png" id="submit" name="submit" alt="Submit" /></p>
</div>
</html:form>
</div>
원래 성공, 오류 및 div의 모든 숨겨진 저희에게 연락하십시오. 에 관계없이 검증이 있었다 여부
$('.success, .error, .success_header, .error_header').hide();
$('form#contactForm').show();
그래서, 내 행동에, 나는 동일한 입력 forward
에 다시 모든 것을 보낼 수 있도록하려면 : 나는 문의 양식이 같은 모달 대화 상자에서 클릭에 표시해야 오류 여부. 하지만 나는 표시되어야하는 대화 확인하기 위해 jQuery를에서 JSP 페이지에 수표를 갖고 싶어 :
- 성공 대화 또는
- 연락처 - 우리가 오류 대화 상자
if ("reg".equalsIgnoreCase(contactUsForm.getAction())) {
ActionMessages errors = getErrors(request);
errors = validate(contactUsForm);
if (errors.isEmpty()) {
//Save some variable to the request/response to say that registration was successful
} else {
//save something to say that registration was not successful
saveErrors(request, errors);
}
}
return actionForward;
에서 변수를 설정하는 방법이 있나요 : 여기
ActionForward
이 호출 된 후
jsp
페이지에서 검색 할 수있는
Action
입니다. 가급적이면
$(document).ready
함수에서 jQuery로 액세스 할 수 있습니까?
제안 : struts2로 가면 Struts1과 많이 다르므로 궁극적으로 Struts2로 전환하게 될 것입니다. Struts2는 Struts1에 대한 이전의 경험을 필요로하지 않으므로 학습하기가 매우 쉽습니다. –
@XCoder 내가 할 수 있으면 좋겠다. 불행히도 나는 이것을 위해 사용할 수있는 기술을 결정하지 못했습니다. – Rondel