Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying output in HTML  RSS feed

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing jsp page. In this jsp, code runs through a loop to get the values. Now I want to display tthe obtained values in html form. How can I do this ?

[html]
<div>
<ul>
<% for(int i=0; i<8; i++){
String image <!-- links_label --> = "cont_"+i+"_image";
String image_alt <!-- links_url --> = "cont_"+i+"_image_alt";
String image_url <!-- links_url --> = "cont_"+i+"_image_url";
%>
<content:getProperty name="<%=image%>" node="<%=cmsNode%>" resultId="image" />
<content:getProperty name="<%=image_alt%>" node="<%=cmsNode%>" resultId="alt" />
<content:getProperty name="<%=image_url%>" node="<%=cmsNode%>" resultId="url" />
<% if (image != null && !"".equals(image) ) {%>
image<%i%> = image<br>
ALT<%i%> = alt<br>
image_url<%i%> = url<br>
<%
}%>
<%for(i=0; i<8; i++)%>
<html>
<body>
image<%i%>
ALT<%i%>
image_url<%i%>
</body>
</html>

</ul>
</div>
[/html]

Is this syntax ok to display results ? Please correct , if wrong
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags.
 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are starting of with a <div> tag, and then displaying <html> tags in a loop. Your page would look something like this which is definitely not right



If what you want is just a form, then use <form> tags instead of <html><body> tags...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!