?
Solved

Not running in JSP script

Posted on 2009-03-31
4
Medium Priority
?
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 23

Accepted Solution

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

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

to

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

Assisted Solution

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

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 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