日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java ee500错误_无法访问页面,500错误

發布時間:2024/4/11 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java ee500错误_无法访问页面,500错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

想問下這是怎么回事,明明跟著視頻一步步敲代碼的

相關配置和代碼

web.xml:<?xml ?version="1.0"?encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee?http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"

version="4.0">

shiroFilter

org.springframework.web.filter.DelegatingFilterProxy

shiroFilter

/*

login.jsp

springmvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:spring/spring-*.xml

springmvc

/

spring-web.xml:<?xml ?version="1.0"?encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xmlns:context="http://www.springframework.org/schema/context"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context.xsd

http://www.springframework.org/schema/mvc

http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

/login.jsp?=?anon

/subLogin?=?anon

/*?=?authc

login.jsp:

Created?by?IntelliJ?IDEA.

User:?98184

Date:?2019/9/27

Time:?9:08

To?change?this?template?use?File?|?Settings?|?File?Templates.

--%>

登錄

用戶名:

密碼:

UserController.java:package?com.lgq.shirotest.controller;

import?com.lgq.shirotest.entity.User;

import?org.apache.shiro.SecurityUtils;

import?org.apache.shiro.authc.AuthenticationException;

import?org.apache.shiro.authc.UsernamePasswordToken;

import?org.apache.shiro.subject.Subject;

import?org.springframework.stereotype.Controller;

import?org.springframework.web.bind.annotation.RequestMapping;

import?org.springframework.web.bind.annotation.RequestMethod;

import?org.springframework.web.bind.annotation.ResponseBody;

@Controller

public?class?UserController?{

@RequestMapping(value?=?"/subLogin",?method?=?RequestMethod.POST,produces?=?"application/json;charset=utf-8")

@ResponseBody

public?String?subLogin(User?user)?{

Subject?subject=?SecurityUtils.getSubject();

UsernamePasswordToken?token=new?UsernamePasswordToken(user.getUsername(),user.getPassword());

try?{

subject.login(token);

}?catch?(AuthenticationException?e)?{

return?e.getMessage();//返回異常信息

}

return?"登錄成功";

}

}

總結

以上是生活随笔為你收集整理的java ee500错误_无法访问页面,500错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。