I am trying to create an application that will allow the users to change text and labels in an XML file, which in turn I will pull into the
JSP. The idea is that I will code the static portion of the JSP with the include, but there after if they want to change a text paragraph or field label, it can be done in the XML file and will be available to the JSP next time the JSP is run.
In my JSP I have the following code:
.
.
.
<%
String newState = null;
if (userProfile.getPreviousState().equals("createstudentresponse")){
newState = student.getState();
} else {
newState = request.getParameter(oldState);
}
%>
<table border="0" width="650">
<form method="post" name="dealerp1">
<tr><td >
<%
Paragraph[] paragraphs = webPage.getParagraphs();
for (int i = 0; i < paragraphs.length; i++) {
Column[] columns = paragraphs[i].getColumns();
out.println("<table border=\"0\" width=\"100%\"><tr>");
for (int j = 0; j < columns.length; j++) {
out.println("<td width=\"100%\">");
out.println(UtilityMethods.replaceHTMLNull(columns[j].getDescription()));
out.println(columns[j].getFixedData());
}
out.println("</td>");
}
out.println("</tr></table>");
}
%>
</td><td width="1%"></td></tr>
</form>
</table>
.
.
.
The XML which is being parsed is as follows:
<Paragraph>
<Column>
<FixedData><input type="text" size="2" name="oldState" value="<%= newState != null ? newState : "" %>">
</FixedData>
<Description>Previously titled in </Description>
</Column>
</Paragraph>
The problem is that at run time the piece of
Java code in the JSP is run and it outputs the description, but the variable newState which is determined by the Java code that is being pulled in from the XML file is not resolved. Any ideas on how I can make this work?