<%@ page import="com.cw.search.*" %> <%@ page import="com.cw.weather.*" %> <%@ page import="com.cw.weather.types.*" %> <%@ page import="com.cw.weather.reports.*" %> <%@ page import="com.cw.util.*" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <% //System.out.println("here"); String cityid = request.getParameter("city_id"); String searchtext = request.getParameter("searchtext"); //if(searchtext==null) searchtext = request.getParameter("searchText2"); if(searchtext==null||"".equals(searchtext.trim())) searchtext = request.getParameter("searchText2"); boolean metric = "true".equals(request.getParameter("metric")); List al = new ArrayList(); SearchEngine searchEngine = SearchEngineFactory.getInstance(); if(cityid!=null){ City city = (City) searchEngine.idSearch(cityid); if(city!=null) al.add(city); } if(al.size()==0&&searchtext!=null){ City city = searchEngine.zipSearch(searchtext, "US"); if(city!=null) al.add(city); if(al.size()==0){ al = searchEngine.search(searchtext); if(al.size()==0) al = searchEngine.search("zip:"+searchtext); } } if(al.size()==0){ request.getRequestDispatcher("/bin/cw/cwnotfound.jsp").forward(request, response); return; } if(al.size()==1){ City city = (City) al.get(0); %> <% return; } %> <% int SCROLL_INCREMENT = 20; %> CustomWeather
/bin/cw/citylist.jsp"> <% int scrollIndex = 0; String sIndex = (String) request.getParameter("scroll_index"); if(sIndex!=null) scrollIndex = Integer.parseInt(sIndex); if(scrollIndex<0 || scrollIndex> al.size()/SCROLL_INCREMENT) scrollIndex = 0; int startIndex = scrollIndex*SCROLL_INCREMENT; int endIndex = (int) Math.min(startIndex+SCROLL_INCREMENT, al.size()); boolean previous = scrollIndex>0; boolean next = (scrollIndex+1)*SCROLL_INCREMENT <% City city = (City) al.get(0); %>
CustomWeather Home
<%=CWDateFormat.formatDate(new Date(), "EEEE MMMM d, yyyy") %>        
About CustomWeatherProducts and ServicesClients and PartnersContact CustomWeatherMy Forecast

Another Location?
Enter any city name, or zip code
(US zip codes only).

 

               
               
  Select Your Location
Your CustomWeather search resulted in <%=al.size()%> possible locations. Please select a location for more weather information.
   
               
  <% WeatherEngine currentConditions = WeatherEngineFactory.getInstance(WeatherProduct.CURRENT_CONDITIONS); for(int i=startIndex; i0){ WeatherStation ccStation = ccStations[0]; if(ccStation.size()>0) cc = (CurrentConditionsData) ccStation.get(0); } %> <% if((i/5)%2!=0){%> <% if((i/5)%2!=0){%> <% if((i/5)%2!=0){ %> <%}%>
<%if(previous){%> << /bin/cw/citylist.jsp?scroll_index=<%=(scrollIndex-11)+"&metric="+metric+"&searchtext="+searchtext%>">Previous Page <%}%> <%if(previous&&next){%>|<%}%> <%if(next){%> /bin/cw/citylist.jsp?scroll_index=<%=(scrollIndex+1)+"&metric="+metric+"&searchtext="+searchtext%>">Next Page >> <%}%> <%if(previous||next){%>|<%}%> displaying: <%=startIndex+1%>-<%=endIndex%>
Location Conditions Temp.
<%}else { %><%}%> /bin/cw/detailed.jsp?city_id=<%=__city.getCityId()+"&metric="+metric%>"><%=__city.simpleName()%> <%}else { %><%}%> <% String precip = null; if(cc!=null){ IndexedDescriptor rain = cc.getPrecipDesc(); IndexedDescriptor sky = cc.getSkyDesc(); if(rain.isNull()){ if(!sky.isNull()){ precip = sky.toString(); } }else{ precip = rain.toString(); } } if(precip==null) precip = " "; %> <%=cc==null?"":cc.getDescription()%> <%}else { %> <%}%> <% if(cc==null){%>  <%}else{ Temperature cTemp = cc.getTemperature(true); Temperature fTemp = cc.getTemperature(false); %> <%=fTemp%>/ <%=cTemp%> <%}%>
<%if(previous){%> << Previous Page <%}%> <%if(previous&&next){%>|<%}%> <%if(next){%> Next Page >> <%}%> <%if(previous||next){%>|<%}%> displaying: <%=startIndex+1%>-<%=endIndex%>
                 
                 
Back to Top
                 
                 
©<%=city.getLocalTime(new Date(), "yyyy") %> CustomWeather Inc., All Rights Reserved.
About Us | Products and Services | Clients and Partners | Contact | My Forecast | Home
webmaster@customweather.com