Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java中的GetParameter返回错误_Java - Fatal编程技术网

Java中的GetParameter返回错误

Java中的GetParameter返回错误,java,Java,我在编辑源代码时对java的了解非常有限(我使用php/AS,不幸的是我也需要它) 无论如何,我正在从HTML文件读取参数。在源代码的一个类中,它可以很好地读取参数,但当我尝试从另一个类中读取参数时,它不起作用 String tmp; tmp = getParameter("playername"); 这是我收到的错误消息 C:\java\applet\source2\BufferView.java:432: error: cannot find symbol tmp = g

我在编辑源代码时对java的了解非常有限(我使用php/AS,不幸的是我也需要它)

无论如何,我正在从HTML文件读取参数。在源代码的一个类中,它可以很好地读取参数,但当我尝试从另一个类中读取参数时,它不起作用

String tmp;

tmp = getParameter("playername");
这是我收到的错误消息

C:\java\applet\source2\BufferView.java:432: error: cannot find symbol
        tmp = getParameter("playername");
              ^
  symbol:   method getParameter(String)
  location: class BufferView
1 error
getParameter()
方法未在
BufferView
类中定义


您可能需要的是一个
HttpServletRequest
实例,从中可以调用
getParameter()
方法。

getParameter
是它工作的类上的一个方法。您的另一个类需要提供该类的实例来调用该方法


那么,在它工作的类中阅读它,并将它传递到
BufferView
中的相应方法“我使用php/AS,不幸的是我也需要它”哇!获得精通Java的人员帮助的方法。。