Solved

Not running in JSP script

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
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…

705 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