Solved

Not running in JSP script

Posted on 2009-03-31
4
276 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 250 total points
ID: 24026808
Change

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

to

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

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Invest in your employees with these five simple steps to improve employee engagement and retention.
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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