写了一个带登录的系统,本来打包成war放在阿里云centos的tomcat的webapps下,通过ip:8080/项目名是可以所有正常显示并没有一点差错的。
但我想把域名映射过去,于是出问题了,登录跳转界面后显示:
The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
这个登录是通过springmvc执行并跳转的:如下
@RequestMapping("/login")
public ModelAndView loginStudent(@RequestParam("sid") String sid,@RequestParam("spassword") String spassword,Model model,HttpSession httpSession) {
StudentDAO studentDAO = new StudentDAO();
Student student = new Student();
student = studentDAO.getByStuSid(sid);
if (studentDAO.queryByNamePwd(sid, spassword)) {
httpSession.setAttribute("sid", sid);
httpSession.setAttribute("sname", student.getSname());
return new ModelAndView(new RedirectView("../student/studentFace.jsp")); /////在这里的确跳转成功,因为url显示出来了
} else {
return new ModelAndView(new RedirectView("../fail.jsp"));
}
}
还有一个登录却是可以登录成功的,
@RequestMapping("/login")
public String loginStudent(@RequestParam("aname") String aname,@RequestParam("apassword") String apassword,Model model,HttpSession httpSession) {
AdminDAO adminDAO = new AdminDAO();
if (adminDAO.queryByNamePwd(aname, apassword)) {
httpSession.setAttribute("aname", aname);
return "admin/adminFace";
} else {
return "fail";
}
}
但跳转之后的界面没有cssjs图片直接了,并且跳转之后界面的超链接点击之后显示错误:Message /onlineSC/StudentController/managestuDescription The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
上两张图,第一张:是第一种登录后直接显示的错误,
第二张是第二种可以登录进去的,第三张是第二张超链接点进去之后的
还有这两种登录跳转过去的界面都有这条语句
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>这些不用域名,直接通过ip:8080/项目名访问是很正常的,郁闷了一天,也百度了一天,实在想不出办法了 有没有技术大佬帮帮忙还有我的tomcat配置:
截取一段
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm> <Host name="onlinesc.fuzui.net" appBase="/www/server/tomcat/webapps/onlineSC" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/www/server/tomcat/webapps/onlineSC" debug="0" reloadable="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
</Host>有点头大
但我想把域名映射过去,于是出问题了,登录跳转界面后显示:
The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
这个登录是通过springmvc执行并跳转的:如下
@RequestMapping("/login")
public ModelAndView loginStudent(@RequestParam("sid") String sid,@RequestParam("spassword") String spassword,Model model,HttpSession httpSession) {
StudentDAO studentDAO = new StudentDAO();
Student student = new Student();
student = studentDAO.getByStuSid(sid);
if (studentDAO.queryByNamePwd(sid, spassword)) {
httpSession.setAttribute("sid", sid);
httpSession.setAttribute("sname", student.getSname());
return new ModelAndView(new RedirectView("../student/studentFace.jsp")); /////在这里的确跳转成功,因为url显示出来了
} else {
return new ModelAndView(new RedirectView("../fail.jsp"));
}
}
还有一个登录却是可以登录成功的,
@RequestMapping("/login")
public String loginStudent(@RequestParam("aname") String aname,@RequestParam("apassword") String apassword,Model model,HttpSession httpSession) {
AdminDAO adminDAO = new AdminDAO();
if (adminDAO.queryByNamePwd(aname, apassword)) {
httpSession.setAttribute("aname", aname);
return "admin/adminFace";
} else {
return "fail";
}
}
但跳转之后的界面没有cssjs图片直接了,并且跳转之后界面的超链接点击之后显示错误:Message /onlineSC/StudentController/managestuDescription The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
上两张图,第一张:是第一种登录后直接显示的错误,
第二张是第二种可以登录进去的,第三张是第二张超链接点进去之后的
还有这两种登录跳转过去的界面都有这条语句
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>这些不用域名,直接通过ip:8080/项目名访问是很正常的,郁闷了一天,也百度了一天,实在想不出办法了 有没有技术大佬帮帮忙还有我的tomcat配置:
截取一段
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm> <Host name="onlinesc.fuzui.net" appBase="/www/server/tomcat/webapps/onlineSC" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/www/server/tomcat/webapps/onlineSC" debug="0" reloadable="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
</Host>有点头大
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货