Solved

Not running in JSP script

Posted on 2009-03-31
4
264 Views
Last Modified: 2012-05-06
If you see the attach code when the run reach to line
  if (lang.toUpperCase() == "AR")
stopped

But when I remove if statement and write this
   String url = "imfIdentifyDefault.jsp"
   + "?loid=" + activeLayer.getObjectId()
   + "&lyr=" + activeLayer.getId();

running fine.

What the problem with if statement ?
function startup()

 {

<%

  if (buffer != null) {

    AimsEnvelope bufferExtent = buffer.getExtent();

    if ((bufferExtent.getWidth() > 0.0) && (bufferExtent.getHeight() > 0.0)) {

      map.setExtent(bufferExtent);

    }

    out.println("parent.frames['mapFrame'].refreshMap();");

  }

  boolean printed = false;

  var lang ="<%= strLanguageSession %>"; 

  if (lang.toUpperCase() == "AR")

  	{ 

    	String url = "imfIdentifyDefault.jsp"

        + "?loid=" + activeLayer.getObjectId()

        + "&lyr=" + activeLayer.getId();

    }

  else

  	{

    	String url = "imfIdentifyDefault.jsp"

        + "?loid=" + activeLayer.getObjectId()

        + "&lyr=" + activeLayer.getId();      

  	}  

	//String strLanguageSession2 = (String) session.getAttribute("strLanguage") == null? "" : (String) session.getAttribute("strLanguage");

	//if (strLanguageSession2.equals("AR"))	

		//{  

    		//String url = "imfIdentifyDefault.jsp"

            //+ "?loid=" + activeLayer.getObjectId()

            //+ "&lyr=" + activeLayer.getId();

		//}

	//else

		//{

    		//String url = "imfIdentifyDefault.jsp"

            //+ "?loid=" + activeLayer.getObjectId()

            //+ "&lyr=" + activeLayer.getId();		

		//}

%>

}

Open in new window

0
Comment
Question by:bworld
4 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 250 total points
ID: 24026808
Change

if (lang.toUpperCase() == "AR")

to

if (lang.toUpperCase().equals("AR"))
0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
ID: 24028523
to prevent null value, you can always try like this instead...

if ("AR".equals(lang.toUpperCase()))
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
trouble with PDF encryption using itext-1.3.1 17 83
eclipse problems view not showing all the time 4 87
session bean client machine 9 57
print map entry 34 56
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
There is no doubt that cloud is gaining importance. Many of you must have read about this technology and its growing importance. More and more organisations are embracing this technology not forgetting start-ups. The process begins by dipping …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now