django怎么使用ajax,为什么我老是报404,小白求赐教 20C

这是views里面的代码,
def get_signal(request):
if request.method == 'POST':
print(request.method)
msg_ids = request.POST.get('ids')
print(msg_ids)
res = {'aa': ' aa', 'bb': 'bb'}
return HttpResponse(json.dumps(res), content_type='application/json')

这是urls里面的代码
from django.contrib import admin
from django.urls import path
from bokehTestApp import views as view

urlpatterns = [
path('admin/', admin.site.urls),
path('getSignal', view.get_signal)
]

这里是html里面的代码
var data = {'ids': id_data}
function getSignal() {
if(id_data.length > 0){
$.ajax({
"url": '/getSignal/',
type: "POST",
data: data,
datatype: "json",
success: function (res) {
alert(res.data)
}
})
}
}

3个回答

"url": '/getSignal/', 改成url:'/getSignal' 就是去掉 "url" 的引号

#触发ajsx事件
$.ajax({ #导入ajax模块
url: '/app01/ajax_handle/', #要走的地址 相对地址, 在 项目中的url 设置
type: 'get', #执行的方法 一般是get的话不用写
success: function (data) { ajsa 请求得到的结果在这里接收 并在这里处理
{# data 是返回给这边的参数 当执行成功(能够正常返回的时候)的时候 执行这个回调函数 #}
console.log(data)

        },
        error: function () {
            {#            当有错误的时候执行这个函数中的内容#}
        }
    })

url:接口没链接上,仔细查看一下url

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么我写的Ajax老是报404????
[code=JScript]rn rn[/code]rn调用同一目录下的webSerivernxmlHttp.status老是等于404....
为什么访问url老是报404
这是我的web.xmlrnrnrnrn rn contextConfigLocationrn rn classpath:application.xmlrn rn rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn rn encodingrn rn org.springframework.web.filter.CharacterEncodingFilterrn rn rn encodingrn UTF-8rn rn rn rn encodingrn /*rn rnrn rn LoginFilterrn com.nirvana.filter.LoginFilterrn rn rn LoginFilterrn *.dorn rn rn adminrn rn org.springframework.web.servlet.DispatcherServletrn rn 2rn rn rn adminrn *.dorn rn rn index.jsprn rnrn[img=https://img-bbs.csdn.net/upload/201809/05/1536117530_321844.png][/img]rn[img=https://img-bbs.csdn.net/upload/201809/05/1536117566_631532.png][/img][img=https://img-bbs.csdn.net/upload/201809/05/1536117584_231705.png][/img]
Struts2小白,报404了求教
本人刚开始学Struts2框架,看着书上敲了第一个工程,但404了,弄了半天没解决,求大神指教!感激不尽!这是我的login.jsp和web.xml的代码:rn[code=html]rn<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8"%>rn<%@taglib prefix="s" uri="/struts-tags"%>rnrnrnrn rn Insert title herernrnrn rn rn rn rn rnrnrn[/code]rn以下为web.xml:rn[code=text]rnrnrn ch1rn rn index.htmlrn index.htmrn index.jsprn default.htmlrn default.htmrn default.jsprn rn rn struts2rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterrn rn struts.i18n.encodingrn UTF-8rn rn rn rn struts2rn *.actionrn rn rn struts2rn *.jsprn rnrn[/code]rn
为什么我的老是报错误
rnrnrn 添加管理员rn rn rnrnrn rn rn rn 添加管理员rn rn rn 管理员帐号rn rn rn rn 管理员密码rn rn rn rn 再输入密码rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn为什么我的老是报rnNotice: Undefined index: submit in d:\usr\www\html\php\admin\system\useradd.php on line 3rn
为什么报错误404
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>rn<%@ page import="tool.*"%>rn<%@page import="tool.JDBCConnection"%>rnrnrnrn rn 对图片发表评论rn rnrnrnrn rn <%rn rnint i=Integer.parseInt(request.getParameter("picture_id"));rn//request.setCharacterEncoding("GBK");rn//String picture_title=format.StrFormat(request.getParameter("picture_title"));rnJDBCConnection dbconn=new JDBCConnection();rnConnection conn=dbconn.getConnection();rnString sql="select * from dto_picinfo where photoid=?";rnPreparedStatement pstmt=null;rnJDBCConnection dbc=null;rndbc=new JDBCConnection();rnpstmt=dbc.getConnection().prepareStatement(sql);rnpstmt.setInt(1,i); rn//pstmt.setInt(1,Integer.parseInt((String)request.getSession().getAttribute("photoid"))); rnResultSet rs1=pstmt.executeQuery();rnif(rs1.next())rn%>rnrn rn rn 标题:<%=rs1.getString("pic_object")%>rn rn rn rn rnrn rn <%JDBCConnection dbconn1=new JDBCConnection();rnConnection conn1=dbconn.getConnection();rnString SQL="select * from dto_comment where dataid=?";rnPreparedStatement pstmt1=null;rnJDBCConnection dbc1=null;rndbc=new JDBCConnection();rnpstmt1=dbc.getConnection().prepareStatement(SQL);rnpstmt1.setInt(1,i); rn//pstmt.setInt(1,Integer.parseInt((String)request.getSession().getAttribute("photoid"))); rnResultSet rs=pstmt1.executeQuery();rn while(rs.next())rn %>rnrnrn 评论内容:rn <%=rs.getString("Content")%>rn 发表人:<%=rs.getString("user_name")%> 发表时间:<%=rs.getString("comment_time")%>rn rnrn<%%>rn rn 发表评论:rn rn rn rn rn rn rn rnrn rn rn rnrn rn rn rnrn rn rn rn rnrnrn 返回rnrn<%rnrs1.close();rnpstmt.close();rnrs.close();rnpstmt1.close();rnconn.close();rn%>rnrnrnrn rn This is the description of my J2EE componentrn This is the display name of my J2EE componentrn slt_picture< rvlet-name>rn servlet.slt_picture< rvlet-class>rn < rvlet>rnrnrnrn slt_picture< rvlet-name>rn /slt_picturern < rvlet-mapping>rn
为什么项目部署报404
我经历此问题的原因是:因为tomcat6.0和jre1.8不兼容!换成tomcat7.0就好了
ajax访问spring 报404
404一般都是无法找到路径问题,[img=https://img-bbs.csdn.net/upload/201602/27/1456547013_690079.png][/img],rn可是我能进到服务端的方法里,然后在return 出去的时候服务端报错了,然后tomcat返回了一个404错误。rn[img=https://img-bbs.csdn.net/upload/201602/27/1456547165_954418.png][/img]rn如上图,路劲里多了一层。rn[img=https://img-bbs.csdn.net/upload/201602/27/1456547333_912358.png][/img]rn可是从header里看的话路劲又没错。rn困扰一天了,求助。
关于fckeditor老是报404的错误
我利用fckeditor实现网页编辑器功能。将fckeditor的解压缩包放入工程的根目录下,并在工程中加入commons-fileupload-1.2.1.jar ,commons-io-1.3.2.jar , java-core-2.4.1.jar,slf4j-api-1.5.2.jar和 slf4j-simple-1.5.2.jar 包rnweb.xml里也进行了配置:rn rn Connectorrn rn net.fckeditor.connector.ConnectorServletrn rn 1rn rn rn Connectorrn rn /fckeditor/editor/filemanager/connectors/*rn rnjsp页面中代码如下:rn<%@ page language="java" contentType="text/html; charset=UTF-8"rn pageEncoding="UTF-8" import="net.fckeditor.*" %>rn<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>rn rn<%rn FCKeditor fckEditor = new FCKeditor(request, "EditorDefault");rn fckEditor.setHeight("388");rn fckEditor.setWidth("633");rn fckEditor.setValue("This is some ");rn out.println(fckEditor);rn rn %>rn rn在测试的时候老是出现404错误,页面无法现实找到,但事实是我查看了路径没有问题/wrmps/fckeditor/editor/fckeditor.html(wrmps是工程名)请问哪位能帮我一下,看看是为什么?(我是第一次用这个,谢谢)
为什么老报404错????
现在刚刚开始跟视频学struts,用的是myeclipse,tomcat和jdk环境变量都配对了,但是不知道为什么老是报404错误,比如:HTTP Status 404 - /struts_jstl/jstl_el.jsp,但是我的jstl_el.jsp明明存在啊,这是为什么
为什么我老是报这样的错
我的程序流程是没有的问题的,也可以运行,但是如果一段时间停在那个页面,我刷新或者再运行的话,就会报错,只能重新关闭rnTAMCAT,就好了,谁知道怎么解决这个问题?rn我自己怀疑是因为hibernate 的session的原因,但是却无从下手rn例如:rnjava.sql.SQLException: Io 异常: Socket closedrn还有rnorg.springframework.dao.DataAccessResourceFailureException: Hibernate operation: could not load an entity: rn还有 Io 异常: Socket closed; nested exception is java.sql.SQLException: Io 异常: Socket closed
为什么我的系统老是报javaw.exe错误
win2k+jdk+1.4.1+jb8+eclipsernrnjb和eclipse使用中经常弹出错与对话框 :(
我网站为什么老是报内存溢出呢?
前几天做了一个关于房屋出租的网站,用的是ibatis+struts+spring ,几个表要关联时用到了jdbc(感觉jdbc灵活些),我是继承的SqlMapClientDaoSupport类,然后用getSqlMapClientTemplate()访问的,jdbc的数据库连接都是关了的。ibatis交给spring处理的。前几天虚拟主机的管理人员叫我升级说内存少了,我就升级 ,现在级也升了,网站访问量也不大,为什么老是报内存溢出呢?rn请高人给我分析下,以下是错误提示!rnorg.apache.jasper.JasperException: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.OutOfMemoryError: Java heap spacern org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:97)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)rn org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)rn org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)rn org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)rn com.fwcz.filter.Character.doFilter(Character.java:23)rnrnrnroot cause rnrnorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.OutOfMemoryError: Java heap spacern org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:385)rn org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313)rn org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)rn org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)rn org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)rn org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)rn org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)rn org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)rn org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)rn org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)rn org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)rn org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:122)rn org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:66)rn com.fwcz.taglib.ShowArticle.doEndTag(ShowArticle.java:39)rn org.apache.jsp.public_.right_jsp._jspx_meth_article_005fshow_005f0(right_jsp.java:143)rn org.apache.jsp.public_.right_jsp._jspService(right_jsp.java:79)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)rn org.apache.jsp.index_jsp._jspService(index_jsp.java:97)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)rn org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)rn org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)rn org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)rn com.fwcz.filter.Character.doFilter(Character.java:23)rnrn
报404
如果发现404的错误: 1.首先请检查spring配置文件是否将对应的service实现类引入 如: 2.检查路径是否正确
Struts2 使用感叹号报 404
异常: 在访问 http://localhost/项目名称/package/action!method 时报 404 异常 解决方法: 在 struts.xml 中加入这段代码: &lt;constant name="struts.enable.DynamicMethodInvocation" value="true"&gt;&lt;/constant&gt; 原因: 开启动态方法调...
ajax或者form表单提交报404
我今天使用的ajax提交表单,但是弄了好久一直都是404。找了路径没有错直接在地址栏也进不去,再经过一步步探索产生这种原因的是:1、在springMVC配置文件中controller没有扫描到(我这里是因为有个字母打错了)2、改正后又发现我的扫描和开启注解顺序反了,先开启注解再扫描,开启注解需要放到最上面。3、不过还是需要检查下自己的路径,要理清楚项目结构。...
ajax访问后台报404,spring mvc框架
在controller中打断点,可以访问,返回的数据也正常。     解决办法: 找了很久也没发现问题,后来发现未加@RestController注解; 又尝试加上@ResponseBody注解,去掉@RestController也可以解决问题; 特此记录以纪念这个低级的,但不好找的错误...
ajax调用成功 前台却报404
最近一直都在画前台页面,后台代码好久不写都生疏了。 前台用ajax调用数据时,debug可以进入后台方法,前台控制台却一直报404错误,确实很郁闷啊,后来灵光一闪,原来是前台限制的响应格式是json,而方法上并没有加mvc的 @ResponseBody注解。。。   我也是醉了。。。
为什么使用ajax,怎么使用?
什么是AjAx? 异步的javascript和xml。 作用是什么? 通过AjAx与服务器进行数据交换,AjAx可以使用网页实现布局更新。 这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新。 怎么来实现Ajax? XmlHttpRequest对象,使用这个对象可以异步向服务器发送请求,获取响应更新,完成局部...
为什么jsp老是报java.lang.NoClassDefFoundError ?
eclipse + myeclipse + tomcat + sql server2000 rn我把JDBC的3个JAR文件都拷贝到工程下来的lib文件夹里面了,也从eclipse中导入了3个JAR文件。。连接数据库都没得问题,就是要报错?rnrnjava.lang.NoClassDefFoundError: org/apache/jsp/vikStore_jsp (wrong name: org/apache/jsp/vikstore_jsp)rn java.lang.ClassLoader.defineClass1(Native Method)rn java.lang.ClassLoader.defineClass(ClassLoader.java:620)rn java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)rn java.net.URLClassLoader.defineClass(URLClassLoader.java:260)rn java.net.URLClassLoader.access$000(URLClassLoader.java:56)rn java.net.URLClassLoader$1.run(URLClassLoader.java:195)rn java.security.AccessController.doPrivileged(Native Method)rn java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:156)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:69)rn org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:548)rn org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:136)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn servlet.filter.LoginFilter.doFilter(LoginFilter.java:42)rn
老是报同一个错误为什么
我现在是在sco unix5.05下,想运行java程序,但是总提示我“Cannot allocate colormap entry for "ScoBackground",为什么?谢谢各位大侠!!!
Ajax小白使用
//请注意使用的时候需要导入jquery $.ajax({ type:&quot;POST&quot;,//提交方式是POST还是GET,还是其他的。。。。 contentType:&quot;application/x-www-form-urlencoded; charset=utf-8&quot;,//传递一般的数据的话就不需要定义。不知道说的对不对,因为我没用到过 url:&quot;/Area
使用ajax请求时,报404或者406错误问题
解决办法 1.检查请求后缀,被mvc拦截的后缀用ajax请求时后缀不能为html 2.控制器是否添加@ResponseBody注解 3.路径问题,确认真的没有错误
Django中ajax的使用
前端的ajax代码如下所示: $.ajax({     type:'GET',     url:'/store/ds_mgmt_wx/ajax_handle',     dataType:'html',     success:function(data)         {             alert(data);         },     error:functi
Django 之 如何使用ajax
最简单的ajax实例
怎么老是报服务器内部错误?
我运行asp程序时,怎么老是报服务器内部错误?rn前两天还可以看到页面的,这是怎么回事呀。我刚学asp,还望赐教
为什么我的AJAX不可以使用?
后台代码:rnusing System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnusing System.Data.OracleClient;rnrnnamespace CglPractice.regrnrn /// rn /// register 的摘要说明。rn /// rn public class register : System.Web.UI.Pagern rn protected System.Web.UI.WebControls.TextBox tbx_uid;rn protected System.Web.UI.WebControls.Label chkuser_lbl;rn protected System.Web.UI.WebControls.TextBox tbx_tureneme;rn protected System.Web.UI.WebControls.RadioButton rtn_male;rn protected System.Web.UI.WebControls.RadioButton rtn_female;rn protected System.Web.UI.WebControls.TextBox tbx_age;rn protected System.Web.UI.WebControls.TextBox tbx_password;rn protected System.Web.UI.WebControls.TextBox tbx_confirmpass;rn protected System.Web.UI.WebControls.TextBox tbx_coname;rn protected System.Web.UI.WebControls.TextBox tbx_coaddre;rn protected System.Web.UI.WebControls.TextBox tbx_city;rn protected System.Web.UI.WebControls.TextBox tbx_phone;rn protected System.Web.UI.WebControls.TextBox tbx_email;rn protected System.Web.UI.WebControls.TextBox tbx_code;rn protected System.Web.UI.WebControls.Button btn_submit;rn private string connStr = System.Configuration.ConfigurationSettings.AppSettings["dsn"];rn OracleConnection conn = null;rnrn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn Ajax.Utility.RegisterTypeForAjax(typeof(CglPractice.reg.CheckUser));rn rnrn #region Web 窗体设计器生成的代码rn override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.btn_submit.Click += new System.EventHandler(this.btn_submit_Click);rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrnrn public void btn_submit_Click(object sender, System.EventArgs e)rn rn rn rn rnrn前台代码:rn<%@ Page language="c#" Codebehind="register.aspx.cs" AutoEventWireup="false" Inherits="CglPractice.reg.register" %>rnrnrn rn registerrn rn rn rn rn rn rn rn rn rn rn rn 用户名:rn *rn rn rn 真实姓名:rn *希望您如实填写。rn rn rn rn 性别:rn 男rn rn 女rn *rn rn rn rn 年龄:rn rn *rn rn rn rn 密码:rn rn rn * 大于6位rn rn rn rn 确认密码:rn rn rn *rn rn rn rn 所属单位名称:rn rn rn *rn rn rn rn 单位地址:rn rn rn *rn rn rn rn 所在城市:rn rn rn *rn rn rn rn 电话号码:rn rn rn *rn rn rn rn Email:rn rn rn *rn rn rn rn 输入验证码:rn rn rn * rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnCheckReg.js文件内容:rn//用户名验证rnfunction chkUser(userid)rnrn var message;rn message = CheckUser.CheckUserById(userid).value;rn document.getElementById("chkuser_lbl").innerText=message;rn;rn望各位高手不吝赐教。
struts2报 HTTP Status 404 - 为什么?
配置(MyEclipse8.5+tomcat6.0)rn[b][color=#FF0000]rn[size=24px][size=24px]rn服务器报错:[/size][/size][/color][/b]rnrnrnrn警告: Could not create JarEntryRevision for [jar:file:/F:/Program%20Files/apache-tomcat-6.0.29/webapps/lian/WEB-INF/lib/struts2-core-2.2.1.jar]!rnjava.lang.NoClassDefFoundError: org/apache/commons/io/output/NullOutputStreamrn at com.opensymphony.xwork2.util.FileManager$JarEntryRevision.build(FileManager.java:307)rn at com.opensymphony.xwork2.util.FileManager.loadFile(FileManager.java:145)rn at com.opensymphony.xwork2.util.FileManager.loadFile(FileManager.java:105)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:898)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:154)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:121)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:179)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)rn at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.ClassNotFoundException: org.apache.commons.io.output.NullOutputStreamrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)rn ... 38 morern2010-12-4 19:06:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger inforn信息: Parsing configuration file [struts-default.xml]rn2010-12-4 19:06:02 com.opensymphony.xwork2.util.logging.commons.CommonsLogger errorrnrn
为什么跳转找不到WEB-INF下的jsp文件报404
在用eclipse开发时碰到许多次这种情况了,总结了下情况,发现了一个特征,WEB-INF下的jsp文件一般只能通过请求然后后台controller层才能跳转,直该请求路径下的文件是进不去的会报404,而如果直接请求文件路径地址,如那么该文件是需要在WebContext文件夹下的。
servlet出错。。报404错。。。求大虾!!!
正在自学servlet。。。跟着书上一步一步建。。。可是在已有的project中建好了就是访问不了。。。其他jsp都可以正常运行~~rnrn以下是web.xmlrn[code=Java]rnrnrn rnfsssrn servlets.fsssrnrn rn DisplayChartrn org.jfree.chart.servlet.DisplayChartrnrnrnrn fsssrn /servlet/fsssrnrnrn DisplayChartrn /servlet/DisplayChartrnrnrn[/code]rnrn其中displaychart的那个servlet是引用其他jar包的~~相关功能也都可以实现~~rn但就是自己建的这个servlet一直都是404报错~http://localhost:8080/MyProject/servlet/fsssrn报错内容如下:rntype Status reportrnrnmessage /MyProject/servlet/fsssrnrndescription The requested resource (/MyProject/servlet/fsss) is not available.rnrnrn紧急求助!!!~小女子不甚感激!!!!~~
django 的静态资源404问题
其实这不能算个问题。 原因是:Debug 模式下静态资源官方给了解决方案 Serving files uploaded by a user during development 代码如下: from django.conf import settings from django.conf.urls.static import static urlpatterns = [ #
视图函数
定义视图 本质就是一个函数视图的参数 一个HttpRequest实例通过正则表达式组获取的位置参数通过正则表达式组获得的关键字参数 在应用目录下默认有views.py文件,一般视图都定义在这个文件中如果处理功能过多,可以将函数定义到不同的py文件中 新建views1.py #coding:utf-8 from django.http import HttpResponse def
django 静态文件404配置
参考:https://code.ziqiangxuetang.com/django/django-static-files.html 1 确保setting.py:INSTALLED_APPS里有'django.contrib.staticfiles', 2 STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(B...
django 加载静态文件404
如果项目路径正确,以debug模式启动的项目, 查看你的 setting.py 文件debug是否设置成了False,需要改为True。
启动项目出现异常,报404,求拯救
[code=text]rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:566)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rn at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)rn at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)rn at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:80)rn at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:323)rn at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:456)rn at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:131)rn at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:267)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)rn ... 36 morernCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107)rn ... 49 morernCaused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property lastLoginTime in class com.show.entity.EuuUserinforn at org.hibernate.property.BasicPropertyAccessor.createSetter(BasicPropertyAccessor.java:240)rn at org.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:233)rn at org.hibernate.mapping.Property.getSetter(Property.java:299)rn at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertySetter(PojoEntityTuplizer.java:307)rn at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:142)rn at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:78)rn ... 54 morern2013-5-27 16:03:09 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2013-5-27 16:03:09 org.apache.catalina.core.StandardContext startrn严重: Context [/36show] startup failed due to previous errorsrn[/code]rnrnrn以上是错误信息,求各位大大帮忙
django 自定义404页面
django 自定义404页面在django中使用我们自定义的404页面,需要四个步骤: 1、在templates中添加404.html 2、修改settings.py 3、修改views.py 4、修改urls.py 我项目的结构是这样的,接下来,看看每一步具体是怎样实现的。1、在templates中添加404.html在templates目录里,添加一个404.html文件,我们自定义的404错
我写的struts报404 求帮助啊
[size=18px][i][b]求大神们帮助啊,我这里一直报404 错误,没写多少都行全贴出来了。[/b][/i][/size]rnrnpackage servletTest;[img=https://img-bbs.csdn.net/upload/201306/26/1372177692_205519.jpg][/img]rnimport java.sql.SQLException;rnimport java.util.*;rnpublic class EmpListAction rn private List list= new ArrayList();rn public String execute()rn try rn list = EmpDao.findAllEmp();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return "succ";rn rnrnrnrn rn rn rn rn jsp/emp.jsprn rn rn rnrnrnrnrn rn index.jsprn rn rn HellServletrn laughter.HelloServletrn rn rn addEmprn laughter.AddEmpInforn rn rn addrn servletTest.AddEmpServletrn rn rn HellServletrn /sayHellorn rn rn addEmprn /addrn rn rn addrn /addErn rn rn rn Struts2rn rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterrn rn rn rn Struts2 rn /* rn rnrnrnrnrn<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>rn <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'Emp.jsp' starting pagern rn rn rn rn rn rn rn rn rn 哈哈哈rn rn rn rn rn IDrn rn rn namern rn rn salaryrn rn rn agern rn rn rn emp.idrn emp.namern emp.salaryrn emp.agern rn rn rn rnrnrnrnrn[img=https://img-bbs.csdn.net/upload/201306/26/1372177400_502361.jpg][/img]rn[img=https://img-bbs.csdn.net/upload/201306/26/1372177725_608225.jpg][/img][b][img=https://img-bbs.csdn.net/upload/201306/26/1372177737_599072.jpg][/img][/b]rnhttp://localhost:8888/laughter/day01/pri.action 写的访问路径,我的端口号是8888,求帮助
网页报404解决办法
今天调试的时候报404错误了,这个时候我在后台requestMapping()映射的方法设置断点,该方法没有进去。如果你和我是一样的情况的话,试试以下办法: 1.仔细检查你的URL,每一个字母都和后台映射的URL相比较; 2.如果第一个你检查了没有发现问题,那么,请检查你的&quot;/&quot;是否缺少,不说了,想哭,今天搞了多久才发现。     ps:Chrome和Firefox浏览器——&amp;gt;F1...
我直接访问jsp页面报404 求解
我直接访问jsp页面报404 求解[img=https://img-bbs.csdn.net/upload/201604/07/1460000608_571663.png][/img]
struts2总是报404
自己写了一个struts2的小实例程序,但是部署到tomcat上后,启动tomcat时报rnjava.lang.NullPointerExceptionrn at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)rn at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)rn at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)rn at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)rn at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)rn at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774)rn at org.apache.struts2.dispatcher.ng.InitOperations.initStaticContentLoader(InitOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:49)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)rn at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:78)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rnrn然后访问时,报404!求解啊!!
为什么我老是碰到问题?
set cn=server.createobject("adodb.connection")rncnpath="DBQ="&server.mappath("flower.mdb")rncn.Open "DRIVER=Microsoft Access Driver (*.mdb);"&cnpathrnset rs=server.createobject("adodb.recordset")rnrs.opne "inster tab1 (name,date) values("&request.form("name")&","&date()&")",cnrn**date为日期时间型的字段**rn//////////////////////////////////rnProvider 错误 '80004005' rnrn未指定的错误 rn
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法