gudii9
asked on
jsp br tag is not working
I am trying below jsp page
I am getting output like
k value isssss 21 z value isssss 77
i=0
i=1
i=2
i=3
i=4
I expected to see below lines
i=0
i=1
i=2
i=3
i=4
in bold letters.
I am not getting them in bold letters. Please advise. Any ideas, sample code, resources highly appreciated. Thanks in advance.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%!
public int add(int a, int b ){
return a+b;
}
%>
<%
int i=10;
int j=11;
int k=i+j;
%>
k value isssss <%=k %>
<%
int z=add(33,44);
%>
z value isssss <%=z %>
<% for(i=0;i<5;i++){
out.println("<br> i="+i);
} %>
</body>
</html>
I am getting output like
k value isssss 21 z value isssss 77
i=0
i=1
i=2
i=3
i=4
I expected to see below lines
i=0
i=1
i=2
i=3
i=4
in bold letters.
I am not getting them in bold letters. Please advise. Any ideas, sample code, resources highly appreciated. Thanks in advance.
Try System.out.println("<br> i="+i);
ASKER
can i see some reference at
C:\Users\ganesha\Workspace s\MyEclips e 10_workspace\.metadata\.me _tcat\work \Catalina\ localhost\ JspProject \org\apach e\jsp
C:\Users\ganesha\Workspace
ASKER
that did not help.
Now it is printing in console as below
INFO: Jk running ID=0 time=0/28 config=null
Jan 29, 2013 11:16:58 AM org.apache.catalina.startu p.Catalina start
INFO: Server startup in 915 ms
<br> i=0
<br> i=1
<br> i=2
<br> i=3
<br> i=4
which I do not want. I want it instead to be printed on the rendered page. please advise
Now it is printing in console as below
INFO: Jk running ID=0 time=0/28 config=null
Jan 29, 2013 11:16:58 AM org.apache.catalina.startu
INFO: Server startup in 915 ms
<br> i=0
<br> i=1
<br> i=2
<br> i=3
<br> i=4
which I do not want. I want it instead to be printed on the rendered page. please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.