首页 > 解决方案 > favlang 无法解析为 eclipse 中的变量

问题描述

我无法在下面的代码中找到问题,但我收到错误“favlang 无法解析为 eclipse 中的变量”。请帮助我如何解决此问题。

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
     <!DOCTYPE html>
     <html>
           <head>
            <meta charset="ISO-8859-1">
                      <title>Insert title here</title>
           </head>

   <body>
         <!-- read the favourite programming langauge cookie -->
     String favlang="java";
    //get the cookie from the browser request
     cookie[] thecookies=request.getCookies();

   //Find our favourite langauage cookie
    if(thecookies!=null)
      {
             for(cookie tempcookie:thecookies)
             {
                  if("myApp.language".equals(tempcookie.getname()))
                   favlang=tempcookie.getValue();
                     break;
             }
      }
 new books for **<%=favlang%**> #ERROR- favlang cannot be resolved to a   variable

       <ul>
        <li>bbbbbbbbbbbbbbbbbbbbb</li>
        <li>bbbbbbbbbbbbbbbbbbbbb</li>
       </ul>

标签: javascriptjava

解决方案


推荐阅读