上次提到的用switch语句操作传来action分别调用不同的语句
可是switch不支持,String所以有个大哥帮助我写了转换的语句
String action_s=request.getParameter("action");
char action=action_s.charAt(0);
但是编译之后还是显示同一个错误org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 35 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 96 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to char
有谁知道怎么弄,帮帮我好吗?
可是switch不支持,String所以有个大哥帮助我写了转换的语句
String action_s=request.getParameter("action");
char action=action_s.charAt(0);
但是编译之后还是显示同一个错误org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 35 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 96 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to charAn error occurred at line: 139 in the jsp file: /admin_manage_edit.jsp
Generated servlet error:
Type mismatch: cannot convert from String to char
有谁知道怎么弄,帮帮我好吗?
char action=action_s.charAt(0);这段代码没有问题看看你其他的代码
{ case "modify":{
;break;}
case "del":{ ;break;}
case "add":{ ;break;}}
其他的是这样的。就是根据action传来的值来操作相应的语句。
要不要包含相应的类包进来??