Dear all,
I am doing revamp project from struts1 to struts2. I have studied for some time and going to amend
Jsp Page. Below is some extract from struts1 framework jsp file:
Please let me know some conversion tips or example. I really in doubt about the javascript client side and struts2 server side
exchange. e.g. var form = document.forms['CardForm'] ..........
<%@ page import="java.io.*, java.util.*" %>
<%@ page import="com.awip.hibernate.SCardTypeCat" %>
<%@ page import="com.awip.hibernate.SCardTypeCatDesc" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<bean:define id="days" name="CardForm" property="dayRange" type="java.util.Collection" />
<bean:define id="months" name="CardForm" property="monthRange" type="java.util.Collection" />
<bean:define id="years" name="CardForm" property="yearRange" type="java.util.Collection" />
//----------------------------------------------
var form = document.forms['CardForm'];
//-------------------------------------------------
function cardTypeOnChange(objField) {
<%
if (jalCardType!=null && !jalCardType.equals("")){ %>
if (objField.value == '<%=jalCardType %>'){
var elem = document.getElementById('jalMembershipNoRow');
if (elem!=null){
var html ='<DIV class="row"><DIV class="title1"><SPAN
class=title><bean:message bundle="cardResources" key="label.jal.membershipno" /></SPAN></DIV>';
html = html + '<DIV class="longfield"><INPUT class="shortinput"
maxLength="48" type="text" name="jalMembershipNo" value="<%=jalMembershipNo %>"> ';
html = html + '<BR/><SPAN ID="jalRemark" style="color:#999; line-
height:18px;"><bean:message bundle="cardResources" key="label.person.jal.remark" /></SPAN> ';
//**** BEGIN MAK2302 ****
html = html + '<BR/><B ID="jalRemark2" style="color:red; line-
height:18px;"><bean:message bundle="cardResources" key="label.person.jal.remark2" /></B> ' ;
html = html + '</DIV></DIV>';
elem.innerHTML = html;
}
var elem1 = document.getElementById('emailRemark');
if (elem1){ elem1.innerHTML = '<bean:message bundle="cardResources"
key="label.person.email.remark2" />'; }
var elem3 = document.getElementById('cardTermsTextarea');
if (elem3){ elem3.value = '<bean:message bundle="cardResources"
key="label.tnc.content2" />'; }
showOptOutForJAL();
}