Solved

Not running in JSP script

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export JSON response data to Excel in IE9 3 73
Apache server configuration 7 82
jersey maven project error 7 141
mask rule in struts validation.xml 5 87
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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…

813 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