Hi! Can someone help me? I'm a starter in Java-WebDeveloping and i have a question.
I have some Strings in a servlet that i want to send to a JSP (with setAttribute()). So far so good. After this, i want to show them in my JSP. Because there are a variable number of them i need to make a for.
<%
for(int i=1;i<=j;i=++){
%>
Contine: <input type="text" name="<%out.print("Aller"+i);%>" value="<%out.print("${Message"+i+"}");%>" readonly="readonly"/>
<%
}
%>
All variables here are ok, tested...But my JSP instead of showing me the attribute i set in the Servlet, i get ${Message1}. The conclusion is that the JSP does the commands in order, and it doesn t know what ${Message1} means because it passed to next lines of code.
Does anyone knows how to make "<%out.print("${Message"+i+"}");%>" work?
P.S. Sorry for my english, it's not my native language
I have some Strings in a servlet that i want to send to a JSP (with setAttribute()). So far so good. After this, i want to show them in my JSP. Because there are a variable number of them i need to make a for.
<%
for(int i=1;i<=j;i=++){
%>
Contine: <input type="text" name="<%out.print("Aller"+i);%>" value="<%out.print("${Message"+i+"}");%>" readonly="readonly"/>
<%
}
%>
All variables here are ok, tested...But my JSP instead of showing me the attribute i set in the Servlet, i get ${Message1}. The conclusion is that the JSP does the commands in order, and it doesn t know what ${Message1} means because it passed to next lines of code.
Does anyone knows how to make "<%out.print("${Message"+i+"}");%>" work?
P.S. Sorry for my english, it's not my native language