Hey, I have the program below in jsp which will simply set the color of the page which you provide and if you don't provide anything then it will simply set the white color as your background:
Code:
<HTML>
<HEAD>
<TITLE>
JSP page Color Changer
</TITLE>
</HEAD>
<%
String backgroundcolor = request.getParameter("COLOR");
%>
<%
if (backgroundcolor == null)
{
%>
<BODY BGCOLOR="FFFFFF" >
<%
}
else
{
%>
<BODY BGCOLOR="<%= backgroundcolor %>" >
<%
}
%>
<H1>
Conditionally working
</H1>
<%
if (backgroundcolor == null)
{
%>
It will simply use the White.
<%
}
else
{
%>
It will simply use your requested.
<%
}
%>
</BODY>
</HTML>
Bookmarks