Hi,

JSP newbie here. I am trying to set the active tab on the client side based
on the parameter passed in the url. All of the code below works except the
if condition is always false and I can't seem to see my way to reason. If I
could get an objective eye here I would appreciate it so much. Thanks.

NT4 sp6
JRun 3.0
JDK 1.3

<snip>
<%!
String PageName = "Security Manager";
String tab = "application";
String tabClass = "";
%>
<%
if (request.getParameter("tab") != null){
 tab = request.getParameter("tab");
}

String[] tabList = {"Applications","Resources","Rules","Users / Groups"};

for (int i = 0; i < tabList.length; i++){

 if (tab == tabList[i].toString()){
  tabClass = "activeTab";
 }else{
  tabClass = "dormantTab";
 }
 out.println("<td class='" + tabClass + "' NOWRAP>" + tabList[i] + "</td>");
}
%>
</snip>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to