登陆到最后一个权限时,登陆时进度条走到一半就不走了 而且报错。 但登陆前边的没有问题。myeclipse报错如下 :
The kind of launch is configured to open zhe debug perspective when it suspends.
this debug perspective is designed to support application debuging.it.......而且myeclipse提示的一行变了颜色 :最后一个else里边的Valuer v= va.check(username, password); 但没有出现红叉。为什么呢?、 高手指教 谢谢!!!!!!!!代码如下::
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
request.setCharacterEncoding("gbk");
response.setCharacterEncoding("gbk");
LoginForm lf=(LoginForm)form;
String username=lf.getUsername().trim();
String password=lf.getPassword().trim();
String usernamegbk= new String( username.getBytes("ISO-8859-1"),"gbk");
System.out.println(usernamegbk);
username=usernamegbk;
String premission=lf.getPremission();
if(premission.equals("user")){
UserMgr um=UserMgr.getInstance();
try{
User u= um.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("user", u);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success1");
}else if(premission.equals("mgr")){
ManagerService ms=ManagerService.getInstance();
try{
Manager m= ms.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("mgr", m);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success");
}else if(premission.equals("loo")){
LookerService lo=LookerService.getInstance();
try{
Looker l= lo.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("loo", l);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success2");
}else {
ValuerService va=ValuerService.getInstance();
try{
Valuer v= va.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("val", v);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success3");
}
} 高手指教 谢谢!!
The kind of launch is configured to open zhe debug perspective when it suspends.
this debug perspective is designed to support application debuging.it.......而且myeclipse提示的一行变了颜色 :最后一个else里边的Valuer v= va.check(username, password); 但没有出现红叉。为什么呢?、 高手指教 谢谢!!!!!!!!代码如下::
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub
request.setCharacterEncoding("gbk");
response.setCharacterEncoding("gbk");
LoginForm lf=(LoginForm)form;
String username=lf.getUsername().trim();
String password=lf.getPassword().trim();
String usernamegbk= new String( username.getBytes("ISO-8859-1"),"gbk");
System.out.println(usernamegbk);
username=usernamegbk;
String premission=lf.getPremission();
if(premission.equals("user")){
UserMgr um=UserMgr.getInstance();
try{
User u= um.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("user", u);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success1");
}else if(premission.equals("mgr")){
ManagerService ms=ManagerService.getInstance();
try{
Manager m= ms.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("mgr", m);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success");
}else if(premission.equals("loo")){
LookerService lo=LookerService.getInstance();
try{
Looker l= lo.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("loo", l);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success2");
}else {
ValuerService va=ValuerService.getInstance();
try{
Valuer v= va.check(username, password);
HttpSession session=request.getSession();
session.setAttribute("val", v);
}catch(PasswordException e){
return mapping.findForward("error");
}catch(UserNotFoundException e){
request.setAttribute("username", username);
return mapping.findForward("error");
}
return mapping.findForward("success3");
}
} 高手指教 谢谢!!
这行前面应该有个标志吧?双击它,它就会消失了