小编noD*_*ame的帖子

为什么这个JSP-Servlet代码不起作用?

我有一个名为classes的包,其中包括x.java和y.java.x.java:

public class x{
private int a;
private int b;
private String c;
private String d;
private String e;
private String f;
//And the fields are encapsulated.
}
Run Code Online (Sandbox Code Playgroud)

y.java:

public class y{
private List<x> xs;
private int k1;
private int k2;
private String k3;
private String k4;
//And the fields are encapsulated.
}
Run Code Online (Sandbox Code Playgroud)

z.JSP:

<%
usecase y = new y();
request.getSession().setAttribute("yy", y);
%>
<form action="aaa?id=1" method="POST">
            <td>
            <input type="text" name="bbb"/>
            </td>
            <td>
            <input type="text" name="ccc"/>
            </td>
            <td>
            <input type="submit" name="ddd"/> …
Run Code Online (Sandbox Code Playgroud)

java jsp servlets

-3
推荐指数
1
解决办法
149
查看次数

声明变量全局是否有任何不利之处?

在C++语言中,声明变量全局是否有任何缺点?

void foo()
{
  int a;
  a=10;
}

int a;
void foo()
{
  a=10;
}
Run Code Online (Sandbox Code Playgroud)

他们之间有什么不同?

c++ global-variables

-4
推荐指数
1
解决办法
6222
查看次数

标签 统计

c++ ×1

global-variables ×1

java ×1

jsp ×1

servlets ×1