Solved

Not running in JSP script

Posted on 2009-03-31
4
260 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

13 Experts available now in Live!

Get 1:1 Help Now