Edited, Still this is not working exactly, but I need to set a page_type on each page of a website. That page_type needs to be checked by some java and do code based on the page_type. The problem is, the if else statements are not being done correctly. Nothing happens because the parameter doesn't seem to be placed. main page where page_type is being set:
<div id="DYK_area">
<jsp:include page="/imgs/random_dyk.jsp" flush="true">
<jsp:param name="Page_type" value="prenatalOverviewArea"></jsp:param>
</jsp:include>
</div>
Where the code is being checked
<% String pageType = request.getParameter("page_type")==null?"": request.getParameter("page_type");
String image_name="";
if(pageType.equals("prenatalOverviewArea")){
int random = (int )(Math.random() * 10 + 1);
image_name= "/images/did_you_know/dyk_p_" + random + ".png";
}
else if(pageType.equals("prenatalNorm")){
int random = (int )(Math.random() * 25 + 1);
image_name= "/images/did_you_know/dyk_p_" + random + ".png";
}
else if(pageType.equals("overviewArea")){
int random = (int )(Math.random() * 20 + 1);
image_name= "/images/did_you_know/dyk_" + random + ".png";
}
else if(pageType.equals("overviewNorm")){
int random = (int )(Math.random() * 45 + 1);
image_name= "/images/did_you_know/dyk_" + random + ".png";
}
if(!image_name.equals("")){
%>
<img id="dyk_random" src="<%=image_name%>"/>
<%}%>