webSocket客户端报302,不知道哪里写错了。

请看下面代码:

 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!doctype html>
<html>
 <head>
  <meta charset="UTF-8" content="text/html">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>基于Java服务端消息主动推送技术</title>
  <style type="text/css">
    *{
        margin:0;
        padding:0;
    }
    body{
        background:url("image/bg.jpg") no-repeat;
        background-size:cover;
    }
    .chatbox{
        width:700px;
        height:500px;
        margin:100px auto;
        font-size:12px;
        font-family:"微软雅黑";
        color:#666;
    }
    h1{
        text-align:center;
        font-size:30px;
        color:green;
        text-shadow:5px 10px 10px #111;
    }
    .chatbox .c_info{
        text-align:left;
        line-height:46px;
    }
    .inputText{
        height:30px;
        border:0;
        outline:none;
        text-indent:1em;
        font-size:14px;
        font-family:"微软雅黑";
        color:#61B52D;
        border: 1px solid #61B52D;
    }
    .btn{
        width:80px;
        text-indent:0;
        background:#9AD02D;
        color:#fff;
        margin-left: 10px;
    }

    .chatbox .c_message{
        width:97%;
        height:300px;
        overflow:auto;
        border:1px solid yellow;
        font-size:24px;
        color:#9DA791;
        padding-left:20px;
        box-shadow:2px 10px 10px #111;
        /* background: #EAF9BE; */
    }

    .chatbox .c_send{
        margin-top: 10px;
    }
  </style>
 </head>
 <body>
    <div class="chatbox">
        <h1>基于Java服务端消息主动推送技术</h1>
        <div class="c_info">
            服务器地址:<input type="text" value="localhost:8080/webSocket" id="addr" class="inputText" style="width:350px"/>
            用户名:<input type="text" value="Yinwq" id="userName" class="inputText"/>
            <input type="button" id="con" class="inputText btn" value="连接" />
        </div>
        <div class="c_message">

        </div>
        <div class="c_send">
            <input type="text" id="sendText" class="inputText" style="width:592px" />
            <input type="button" id="sendBtn" class="inputText btn" value="发送" />
        </div>
    </div>
 </body>
 <!-- 引入jquery类库 -->
 <script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
 <script type="text/javascript">
    var connected = false;
    var ws;
    $(function(){
        $(".c_send").hide();
        //1.判断浏览器是否支持webSocket
        if(window.WebSocket || window.MozWebSocket){
            printMsg("您的浏览器支持WebSocket,您可以尝试连接到聊天服务器!" , "OK");
        }else{
            printMsg("您的浏览器不支持WebSocket,您可以换其他浏览器!" , "ERROR");
            $("#con").attr("disabled","true");
        }
    })

    //打印信息
    function printMsg(msg,msgType){
        if(msgType == "OK"){
            msg = "<span style='color:green'>"+msg+"</span>";
        }
        if(msgType == "ERROR"){
            msg = "<span style='color:red'>"+msg+"</span>"
        }
        $(".c_message").append(msg + "<br/>");
    }

    //点击连接的时候触发事件
    $("#con").click(function(){
        if(connected){
            //已连接
            ws.send("["+$("#userName").val()+"]离开了聊天室");
            connected = false;
            ws.close();
        }else{//没有连接
            printMsg("正在准备连接,请稍等!", "");
            var url = "ws://"+ $("#addr").val();
            if("WebSocket" in window){
                //ws = new WebSocket(url);
                ws = new WebSocket('ws://localhost:8080/webSocket');
            }else if ("MozWebSocket" in window) {
                ws = new MozWebSocket(url);
            }

            //连接成功后设置连接状态
            connected = true;
            $("#con").val("断开");

            //注册事件
            ws.onopen = function(event){
                openWs(event);
            };
            ws.onmessage = function(event){
                msgWs(event);
            };
            ws.onclose = function(event){
                closeWs(event);
            };
            ws.onerror = function(event){
                errorWs(event);
            };

        }

    });

    //打开socket
    function openWs(event){
        printMsg("连接已建立...!", "OK"); //建立连接的时候
        ws.send("["+$("#userName")+"]进入了聊天室");
        $(".c_send").show();
    };

    //接收消息
    function msgWs(event){
        printMsg(evnet.data);
    };
    //关闭连接
    function closeWs(event){
        $("#con").val("连接");
        //隐藏发送div
        $(".c_send").hide();
    };
    //产生错误
    function errorWs(event){
        printMsg("与服务器连接错误.." , "ERROR");
    };
    //点击发送触发事件
    $("#sendBtn").click(function(){
        //获取发送内容
        var text = $("#sendText").val();
        ws.send($("#userName").val() + "说:" + text);
        $("#sendText").val("");//清空发送框
    });
 </script>
</html>

浏览器报错
图片说明

图片说明

1个回答

那要看server是什么了。看报错是server和client协议不匹配造成的。不过,没有完整的代码和环境,没有办法判断。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
项目报错不知道在哪里写错了
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribingrnrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:763)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)rn at java.net.URLClassLoader.access$100(URLClassLoader.java:73)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:368)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:362)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:361)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:424)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)rn at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)rn at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)rn at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)rn at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)rn at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)rn at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)rn at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)rn at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)rn at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)rnCaused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribingrn at java.net.URLClassLoader.findClass(URLClassLoader.java:381)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:424)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:357)rn ... 22 morern rn ===============分割线===============rn 可以远程调试rn 3569644490 QQ号
websocket 链接服务器报 302 错误解决方法
将 websocket 的定义放到 JS 脚本的开头
新手写mysql,不知道哪里写错了,报error#:1064。
CREATE DEFINER = `root`@`localhost` PROCEDURE `NewProc`(IN `@make_date` varchar)rnbeginrnSET @make_date ='2012-10-10'rnend;rnrnmySQL error#:1064rnYou have an error in your sql syntax check the manual that corresponds to your mysql server version for the right syntax to use near ''at line 1rnrn
WCF 服务客户端配置不知道哪里错了
我的程序上是绝对没问题因为用VS的那个虚拟IIS时一切正常,而且我调试时一步一步看着程序走的,一定是配置问题,以下错误是我把rn出现的异常信息是rn无法处理消息。这很可能是因为操作“http://xxxx.xxx/IService/Service”不正确,或因为消息包含无效或过期的安全上下文令牌,或因为绑定之间出现不匹配。如果由于未处于活动状态导致服务中止了该通道,则安全上下文令牌无效。若要防止服务永久中止闲置会话,请增加服务终结点绑定上的接收超时 rn服务端的配置是rnrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn rn rnrn rn rn rnrn rn rn rn rnrn rn rn rn rnrnrn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rnrnrn rnrn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn 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 rnrn
求请教。。。。不知道哪里写错了
题目,输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输入数组。rn#includernint main()rnrn int a[10],max,min,i,t,y;rn printf("please enter 10 numbers:");rn for(i=0;i<10;i++)rn scanf("%d",&a[i]);rn for(i=1;i<10;i++)rn max=a[0];rn if(a[i]>max)max=a[i];t=max;max=a[0];a[0]=t;rn for(i=1;i<10;i++)rn min=a[0];rn if(a[i]
自己写的Kruskal算法,不知道哪里错了
各位能告诉我下面的代码哪里错了么,为什么运行结果不正确啊rn#includern#includern#define MAXV 6rn#define INF 32767rn#define MaxSize 30rntypedef struct rnrn char no;rn int info;rnVexterTyoe;rntypedef struct rnrn int edges[MAXV][MAXV];rn int n,e;rn VexterTyoe info;rnMGraph;rnrntypedef structrnrn int u;rn int v;rn int w;rnEdge;rnrnvoid Kruskal(MGraph *g);rnvoid InsertSort(Edge E[],int e);rnrnvoid main()rnrn int i,j,e=0;rn MGraph g;rn g.n=6;rn int A[MAXV][MAXV]=0,6,1,5,INF,INF,6,0,5,INF,3,INF,1,5,0,5,6,4,5,INF,5,0,INF,2,INF,3,6,INF,0,6,INF,INF,4,2,6,0;rn for(i=0;in;i++) //将所有边存放到E中rn for(j=0;jn;j++)rn if(g->edges[i][j]!=0&&g->edges[i][j]!=INF)rn rn E[k].u=i;E[k].v=j;E[k].w=g->edges[i][j];rn k++;rn rnrn InsertSort(E,g->e);rnrn for(i=0;in;i++)rn vset[i]=i;rnrn k=1;rn j=0;rnrn while(kn)rn rn u1=E[j].u;v1=E[j].v;rn sn1=vset[u1];rn sn2=vset[v1];rn if(sn1!=sn2)rn rn printf(" (%d,%d):%d\n",u1,v1,E[j].w);rn k++;rn for(i=0;in;i++)rn if(vset[i]==sn2)rn vset[i]=sn1;rn rn j++;rn rnrnrnvoid InsertSort(Edge E[],int e)rnrn int i,j;rn Edge temp;rn for(i=0;i=0&&temp.w
这么写正则表达式不知道哪里错了?
我的要求是输入只能出现数字或者"-"字符。但是这样写只要第一位有数字或者"-"就是正确的。rnrnrnrn rn 无标题文档rn rnrnrnrn rnrnrnrnrnrn
不知道哪里写错了,会报告错误。
String tt = request.getParameter("Edit1");rnString strSQL1 = "SELECT Permit FROM Common_Sn WHERE Id='"+tt+"'";rnResultSet rs1 = sts.executeQuery(strSQL);rnrs1.next();rnString dd = rs1.getString("Permit");rnrn错误如下:rnorg.apache.jasper.JasperException: Exception in JSP: /SnSheZhi/ShiYan4.jsp:42rnrn39: String strSQL1 = "SELECT Permit FROM Common_Sn WHERE Id='"+tt+"'";rn40: ResultSet rs1 = sts.executeQuery(strSQL);rn41: rs1.next();rn42: String dd = rs1.getString("Permit");rn43: strSQL = "SELECT ModuleId FROM Common_Module WHERE ModuleId IN ("+dd+")";rn44: rs = sts.executeQuery(strSQL);rn45: i=0;rn好像是第42行出现的错误。只是把数据库里的那个值赋给这个变量了,这有错嘛。
看看我写的哈夫曼树,不知道哪里错了。。
可能指针又不知指到哪里去了rnrn#include rnusing namespace std;rnrnstruct TREErnrn int weight;rn int lchild,rchild,parent;rn;rnrnstruct HuffmanTreernrn TREE*elem;rn;rnrn//-----------建立哈夫曼树----------rnvoid select(HuffmanTree**t,int n,int &s1,int &s2)rnrn int min;rn for(int i=0;ielem[i].parent==0)rn rn min=i;rn i=n+1;rn rn rn for(i=0;ielem[i].parent==0)rn rn if((*t)->elem[i].weight<(*t)->elem[min].weight)rn rn min=i;rn rn rn rn s1=min;rn for(i=0;ielem[i].parent==0)rn rn min=i;rn i=n+1;rn rn rn for(i=0;ielem[i].parent==0&&i!=s1)rn rn if((*t)->elem[i].weight<(*t)->elem[min].weight)rn rn min=i;rn rn rn rn s2=min;rnrnrnint CreatehuffmanTree(HuffmanTree**t,int w[],int n)rnrn if(n<=0)rn rn return 0;rn rn int i;rn int s1,s2;//记录两个最小左右子树;rn int m=2*n-1;rn (*t)->elem=new TREE[m];rn for(i=0;ielem[i].weight=w[i];rn (*t)->elem[i].parent=0;rn (*t)->elem[i].rchild=-1;rn (*t)->elem[i].lchild=-1;rn rn for(i=n;ielem[i].weight=0;rn (*t)->elem[i].parent=0;rn (*t)->elem[i].rchild=-1;rn (*t)->elem[i].lchild=-1;rn rn for(i=n;ielem[s1].parent=n;rn (*t)->elem[s2].parent=n;rn (*t)->elem[i].lchild=s1;rn (*t)->elem[i].rchild=s2;rn (*t)->elem[i].weight=(*t)->elem[s2].weight+(*t)->elem[s1].weight;rn rnrnint main()rnrn HuffmanTree *t;rn int w[5];rn cout<<"输入各叶子节点的权:";rn for(int i=0;i<5;i++)rn rn cin>>w[i];rn rn CreatehuffmanTree(&t,w,5);rnrn for(i=0;i<2*5-1;i++)rn rn cout<elem[i].weight<<" ";rn rn return 0;rn
我写的扫雷游戏 不知道哪里错了
#include "stdio.h"rn#include "stdlib.h"rn#define SPA 0 //代表空白rn#define BOMB 1 //代表雷rn#define SAFE 2 //代表已翻开的空白rn#define N 16rnvoid change(int m,int *i,int *j);rnint number(int x,int y);rnint num=N*N;//可翻的格的数目rnint dilei[N+2][N+2]=SPA; //边界各2rnint eye[N][N]=SPA; rnvoid suiji()rnrn int i,j;rn for(i=1;i
指针写冒泡排序,不知道程序哪里错了
9.写一个函数:对数组内的内容进行排序。提示:冒泡法排序。(用指针来完成)。rn#includernint paixu(float *p,int n)rn rn int i,j;rn float a;rn for(j=0;j*(p+i+1))rn rn a=*(p+i);rn *(p+i)=*(p+i+1);rn *(p+i+1)=a;rn rn rn rn return *p;rnrnint main()rnrn int i;rn float num[10]=1,10,6,20,50,3,7,14,21,12;rn float *p=num;rn *p=paixu(p,10);rn for(i=0;i<10;i++)rn rn printf("%-8.2f",*(p+i));rn rn return 0;rnrnrnrnrnrnrn输出的结果是0.00 1.00 3.00 6.00 7.00 10.00 12.00 14.00 20.00 21.00rn50给不见了。rnrnrn求大佬指点一二。
不知道哪里写错了.请指教
DECLARE @YISFKZBB_DATE_STEP_NAME CHAR(50),@DATE1 DATETIME,@DATE2 DATETIMErnSET @YISFKZBB_DATE_STEP_NAME = '_YISFKZBB_DATE_STEP_WWB'rnSET @DATE1 = '2004-10-3'rnSET @DATE2 = '2005-3-24'rnrnEXEC('INSERT '+@YISFKZBB_DATE_STEP_NAME+'(DATE1,DATE2) VALUES('+@DATE1+','+@DATE2+')')rnrn在查询分析器里运行的时候,出现如下错误.不知道正确的应该怎么写rn服务器: 消息 170,级别 15,状态 1,行 1rn第 1 行: '3' 附近有语法错误。rnrn就是想在这个INSERT语句里,把表名和两个日期参数都用变量来代替.
不知道哪里错了
我想实现这个功能rn 输入2009/11/07-12:12:12rn 输出11/07/2009-12:12:12pmrn但是没有办法读取进去哪里错了 谢谢各位rn[code=C/C++][/code]rn#include rnint main(int argc, char *argv[])rnrn int year,month,day,hour,seconds,minute,n;rn rn scanf("%d/%d/%d-%d:%d:%d",&year,&month,day,&hour,&minute,&seconds);rn if(hour>=0 && hour<12) rn rn hour+=12;rn if(hour>12) hour-=12;rn printf("%02d/%02d/%d-%02d:%02d:%02d",year,month,day,year,hour,minute,seconds);rn printf("am\n"); rn rn elsern rn hour-=12;rn if(hour==0) hour+=12;rn printf("%02d/%02d/%d-%02d:%02d:%02d",year,month,day,year,hour,minute,seconds);rn printf("pm\n");rn rn rn return 0;rn
帮帮忙,不知道哪里错了!
html中的代码:rnrn rnrn 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 rnrn rn rn rn rn rn rn rn rnrnrnrnrnjs中的代码:rnrn function kensaku1(No1,No2,No3)rn if (No1.options[No1.selectedIndex].value=="1" && No2.options[No2.selectedIndex].value=="1" && No3.options[No3.selectedIndex].value=="2") rn window.location.href="tousingi.html";rn rn else if (No1.options[No1.selectedIndex].value=="1" && No2.options[No2.selectedIndex].value=="2" && No3.options[No3.selectedIndex].value=="2")rn window.location.href="toutyuugi.html";rn rn else if (No1.options[No1.selectedIndex].value=="2" && No2.options[No2.selectedIndex].value=="1" && No3.options[No3.selectedIndex].value=="2")rn window.location.href="hisingi.html";rn rn else if (No1.options[No1.selectedIndex].value=="2" && No2.options[No2.selectedIndex].value=="2" && No3.options[No3.selectedIndex].value=="2")rn window.location.href="hityuugi.html";rn rn elsern alert("項目を選択してください。");rn rn rn rn出现的问题:rn浏览器左下方有黄的三角号,点开说エラー:document.MyForm.se1はnullまたはプロジェクトではありません.rn意思就是说document.MyForm.se1的值为null或者没有工程。rn大家帮帮忙啊,小问题,不会!!
我不知道哪里错了。。
rnimport java.util.Scanner;rnrnpublic class NewClass rn Student student = new Student();rn int n;rn public void init(Student student) rn System.out.println("How many students do you want to input?");rn Scanner str = new Scanner(System.in);rn n = str.nextInt();rn student.scores = new int[n];rn student.number = new String[n];rn student.name = new String[n];rn System.out.println("Please input " + n + " students' number,name and scores");rn Scanner string = new Scanner(System.in);rn Scanner string1 = new Scanner(System.in);rn Scanner string2 = new Scanner(System.in);rn for (int i = 0; i < n; i++) rn student.number[i] = string.nextLine();rn student.name[i] = string1.nextLine();rn student.scores[i] = string2.nextInt();rn rn sort(student);rn rnrn public void sort(Student student) rnrn String numbertemp, nametemp;rn int scorestemp;rn for (int i = 0; i < n - 1; i++) rn for (int j = 1; j < n; j++) rn if (rn student.scores[i] < student.scores[j]) rn numbertemp = student.number[i];rn student.number[i] = student.number[j];rn student.number[j] = numbertemp;rn nametemp = student.name[i];rn student.name[i] = student.name[j];rn student.name[j] = nametemp;rn scorestemp = student.scores[i];rn student.scores[i] = student.scores[j];rn student.scores[j] = scorestemp;rn rn rn rn output(student);rn rnrn public void output(Student student) rn for (int i = 0; i < n; i++) rn System.out.println(student.name[i]);rn rn rnrn public static void main(String args[]) rn NewClass application = new NewClass();rnrn application.init(student);rn rnrnclass Studentrn rn String number[];rn String name[];rn int scores[];rn Student(String number[],String name[],int scores[])rn this.name = name;rn this.number = number;rn this.scores = scores;rn rnrn Student() rn throw new UnsupportedOperationException("Not yet implemented");rn rn
不知道哪里出错了…
各位大哥好, 工作上临时需要用php操作个数据库, 但是不知道为什么一直无法成功Insert数据进Database, 想请各位帮忙检查一下哪里出错了rnrnrn rnrn". $row1[0] . " ";rn rn rn rnrnelsernrn echo "different--->". $row[0]. " ";rn rn rn mysql_select_db("testPLM",$connect);rn rn mysql_query("SET NAMES utf8");rn //底下要把另一个数据库没有的数据加入, 可是都报错rn mysql_query("INSERT INTO version (name, time, description) VALUES('$row[0]', NULL, NULL)") or die('Insert data fail');rn rnrnrn rnrnrn rn?>
不知道哪里错了!!
#include"stdio.h"rnfloat dx(float arry[],int n);rnfloat max=0,min=0;rnvoid main()rn int i;rn float score[10];rn printf("please enter score:\n");rn for(i=0;i<10;i++)rn scanf("%f",&score[i]);rn max=dx(score,10);rn min=dx(score,10);rn printf("MAX=%f,MIN=%f",max,min);rn rnrn float dx(float arry[],int n)rn int i;rn max=min=arry[0];rn for(i=0;imax)rn max=arry[i];rn if(arry[i]
不知道哪里出错了
java.lang.NullPointerExceptionrn at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:121)rn at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:100)rn at com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:73)rn at org.apache.struts2.components.Component.findValue(Component.java:313)rn at org.apache.struts2.components.Component.findString(Component.java:194)rn at org.apache.struts2.components.Param.end(Param.java:107)rn at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)rn at org.apache.jsp.pmessage_jsp._jspx_meth_s_005fparam_005f0(pmessage_jsp.java:260)rn at org.apache.jsp.pmessage_jsp._jspx_meth_s_005furl_005f0(pmessage_jsp.java:227)rn at org.apache.jsp.pmessage_jsp._jspService(pmessage_jsp.java:87)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)rn at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:139)rn at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)rn at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:186)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnjsp页面:rnrnrnrnrn"> rn rn rnrnn[b]问题补充:[/b]n这边应该没有出错,点击这个链接的到达的是另外一个链接,代码如下:rnrn rn rn rn rn" width=500 height=500/> rn这里都能没错,能显示出来,后来加了这段rnrnrn">添加到购物车rn就出现错误了。struts.xml:rnrn buy.jsprnaction代码:package com.shop.action;rnimport java.util.List;rnimport com.shop.bean.Product;rnimport com.shop.util.ShopCart;rnimport java.util.Iterator;rnimport com.opensymphony.xwork2.ActionContext;rnimport java.util.Collection;rnpublic class CartManager rn private String num;rn private String id;rn private Collection cartList;rn rn public String getId() rn return id;rn rnrn public void setId(String id) rn this.id = id;rn rn @SuppressWarnings("unchecked")rn public String execute()throws Exceptionrn @SuppressWarnings("unused")rn ShopCart cart=(ShopCart)ActionContext.getContext().getSession().get("cart");rn if(cart==null)cart=new ShopCart();rn if(cart.checkId(this.getId()))rn List products=(List)ActionContext.getContext().getSession().get("products");rn Iterator it=products.iterator();rn while(it.hasNext())rn Product p=(Product)it.next();rn if(p.getId().equals(new Integer(this.getId())))rn p.setNumber(1);rn cart.add(this.getId(), p);rn ActionContext.getContext().getSession().put("cart", cart);rn rn break;rn rn rn rn return "success";rn rn rnpublic String showCart()rn ShopCart cart=(ShopCart)ActionContext.getContext().getSession().get("cart");rn this.setCartList(cart.getHashMap().values());rn return "success";rnrnrn@SuppressWarnings("unchecked")rnpublic String del()rn ShopCart cart=(ShopCart)ActionContext.getContext().getSession().get("cart");rn cart.del(this.getId());rn ActionContext.getContext().getSession().put("cart",cart);rn return "success";rnrnrn@SuppressWarnings("unchecked")rnpublic String update()rn ShopCart cart=(ShopCart)ActionContext.getContext().getSession().get("cart");rn cart.update(this.getId(),this.getNum());rn ActionContext.getContext().getSession().put("cart",cart);rn return "success";rnrnrnpublic Collection getCartList() rn return cartList;rnrnrnpublic void setCartList(Collection cartList) rn this.cartList = cartList;rnrnrnpublic String getNum() rn return num;rnrnrnpublic void setNum(String num) rn this.num = num;rnrn rn不知道是哪里问题。rnrnrnn[b]问题补充:[/b]n我的意思是这个 rn rn rn rn"> rn rn rn rnrn没有错,点击了那个href链接到showproducts.action的时候出错了,showproducts.action是转发到 rn rn rn rn rn" width=500 height=500/> 这个jsp页面的,这里也没有出错,能显示出来,但是加了rn rn rn">添加到购物车这段代码以后就出现错误了,具体的action和配置在上面说得很清楚。我这个是用struts2的,出错应该是在后面的的action或者struts.xml或者是最后的jsp代码上。还是很感谢楼下朋友的热心n[b]问题补充:[/b]n不是这里,应该是 rn rn">添加到购物车这段代码吧!加了它就出错了,不加可以正常运行。可是也没看出事哪里出错了,id这里的值不是空的,我是从数据库中取出来的,所以id的值夜分配了。但是还是出来错误
不知道哪里错了,
tryrn rn //读取表单内容rn String type_id=request.getParameter("type_id");rn String soft_name=request.getParameter("softname");rn rn String soft_size=request.getParameter("soft_size");rn String soft_intro=request.getParameter("soft_intro");rn String file_name=request.getParameter("filename");rn String exequatur=request.getParameter("exequatur");rn String kind=request.getParameter("kind");rn String edition=request.getParameter("edition");rn rn //插入数据rn Stmt.executeUpdate("insert into soft (type_id,soft_name,soft_size,soft_sys,file_name,soft_intro,exequatur,kind,soft_edition) values ('"+type_id+"','"+soft_name+"','"+soft_size+"','"+soft_sys+"','"+file_name+"','"+soft_intro+"','"+exequatur+"','"+kind+"','"+edition+"')");rn rn rn catch( SQLException e)rn rn out.print(e);rn rnrnrnStmt.close();rnConn.close();rn%>rnrn不知道哪里错了?rn错误提示:不可利用的表达式 rn rn
这里不知道哪里错了
[code=java]package practice;rnrnimport java.util.Arrays;rnimport java.util.Scanner;rnrnpublic class LotteryDrawing rnrn public static void main(String[] args) rn Scanner in = new Scanner(System.in);rn rn System.out.println("How many numbers do you need to draw? ");rn int k = in.nextInt();rn rn System.out.println("What is the hightest number you can draw? ");rn int n = in.nextInt();rn rn int[] numbers = new int[n];rn for (int i = 0; i < numbers.length; i++) rn numbers[i] = i + 1;rn rn rn int[] result = new int[k];rn for (int i = 0; i < result.length; i++) rn //random得到一个[0,1)浮点数,用n乘这个数,得到[0,n-1]之间随机数;rn int r = (int) (Math.random() * n); rn result[i] = numbers[r];rn //确保每次抽到的值不相同,用数组中的最后一个值改写number[r],并且n--;rn numbers[r] = numbers[n - 1];rn n--;rn rn Arrays.sort(result);rn System.out.println("Bet the following combination. It'll make you rich!");rn for (int r : result)rn System.out.println(r);rn rnrn[/code]rnnumber[r] = numbers[n-1]提示数组越界rn还有最后为什么要用numbers[n-1改写numbers[r]rnscanner in warning resource leak是怎么了
不知道哪里错了?
static void Main( )rn const int MaxSize = 50; //假设猴子最多为50只;rn int m,n,d,i,count; //n代表猴子数目,m代表报到m号的淘汰;rn int [] A=new int[MaxSize]; Console.Write("输入猴子个数n:");rn n=int.Parse ( Console.ReadLine());rn Console.Write("输入要淘汰的报号m:");rn m = int.Parse(Console.ReadLine());rn for (i=0;i 0)rn for (i = 0; i < n; i++)rn if (A[i] != 0)rn rn count++;rn if (count == m)rn rn Console.Write(A[i] + " ");rn A[i] = 0; /*元素值清0*/rn count = 0; /*计数器重置0*/rn d++;rn n--;rn rn rn rn
求助,不知道哪里错了。
#include rn#include rn#include rn#include rnrn#define ListSize 10rnvoid Error(char *message)rnrn printf("Error:%s\n",message);rn exit(1);rnrnstruct SeqList rnrn int data[ListSize];rn int length;rn;rnvoid InitList(struct SeqList *L)rnrn L->length=0;rnrnvoid ListInsert(struct SeqList *L,int x,int i)rnrn int j;rn if(i<0||i>L->length)rn Error("position error");rn if(L->length>=ListSize)rn Error("overflow");rn for(j=L->length-1;j>=i;j--)rn L->data[j+1]=L->data[j];rn L->data[i]=x;rn L->length++;rnrnvoid DeleteList(struct SeqList *L,int i)rnrn int j;rn if(i<0||i>L->length-1)rn Error("position error");rn if(j=i+1;jlength;j++)rn L->data[j-1]=L->data[j];rn L->length--;rnrnint main()rnrn struct SeqList *SEQA;rn int i;rn SEQA=(struct SeqList *)malloc(sizeof(struct SeqList));rn if(!SEQA)rn Error("no space.\n");rn InitList(SEQA);rn for(i=0;idata[i]);rn rn printf("\n");rn DeleteList(SEQA,6);rn DeleteList(SEQA,0);rn DeleteList(SEQA,5);rn for(i=0;ilength;i++)rn rn printf("%3d",SEQA->data[i]);rn rn ListInsert(SEQA,1,0);rn ListInsert(SEQA,2,3);rn ListInsert(SEQA,3,9);rn for(i=0;ilength;i++)rn printf("%3d",SEQA->data[i]);rn _getch();rn return 0;rnrn在vc6.0下,编译后有三处错误,不知道哪里错了,望大神指点
不知道哪里错了,求助!!!
string ls_1,ls_2,lb,ldrnls_1=sle_1.textrnls_2=sle_2.textrndeclare cursor1 cursor for select A,B from ppp ;rnopen cursor1;rnfetch cursor1 into :lb,:ld;rndo while sqlca.sqlcode=0rn if ls_name=lb and ls_password=ld then rn open(main)rn close(ssssssssss)rn else rn messagebox ("adsa","sdfsdf!")rnfetch cursor1 into :lb,:ld;rnlooprnclose cursor1;rn表里数据如下:rn A Brn 123 123rn aaa bbb 数据类型为verchar.rn可是不管我输入哪个都提示错误rn如果我改成 long ls_1,ls_2,lb,ldrn ls_1=long(sle_1.text)rn ls_2=long(sle_2.text) rn然后输入123那行却没有问题rn这是为什么呢,麻烦知道的告诉我,谢谢了rn
不知道是哪里错了
用的是WIN2000 ADVANCED SERVER,每次打开页面是都说rnHTTP 500.100 - 内部服务器错误 - ASP 错误rnInternet 信息服务rn错误类型:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80004005)rn/35511/eb2/data.inc, 第 7 行rnrnrn浏览器类型:rnMozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) rnrn但页面语句的确没问题,我想可能是IIS的缘故,但具体不太清楚,不知道是哪错了??rnrn附:data.inc<% rnSet Conn=Server.CreateObject("ADODB.Connection") rnrnConnstr="DBQ="+server.mappath("zygxmamenu.mdb")+";DefaultDir=;DRIVER=Microsoft Access Driver (*.mdb);Pwd=zydnxky11789;" rnrnConn.Open connstr rn %>rn
不知道哪里错了!
Dim myconnection As New OleDb.OleDbConnection("provider=microsoft.jet.OLEDB.4.0;" & "data source=E:\软件工程\myfriend.mdb")rn Dim strsql As String = "insert into info( 姓名)values(" & Trim(TxtName.Text) & ")"rn Dim mycommand As New OleDb.OleDbCommand(strsql, myconnection)rn myconnection.Open()rn mycommand.ExecuteReader()rn myconnection.Close()rn Me.Close()rn运行时,出错说"至少一个参数没有被指定值。"我本想用insert语句来把txtname的text输入到表info中,怎么回事啊?
指针不知道哪里错了。。。
要求:将两个字符串连接起来并排序rn#includernint main()rnchar s1[20],s2[10],*p,*q,m;rn int n,i;rn scanf("%s",s1);rn scanf("%s",s2);rn for(n=0,p=s1;*(p+n)!=0;n++);rn for(q=s2;;q++)rn rn *(p+n-1)=*q;rn rn for(p=s1;*p!='\0';p++)rn rn for(i=1;;i++)rn rn if(*(p+i)<=*p)rn m=*(p+i);rn *(p+i)=*p;rn *p=m;rn rn rn rn p=s1;rn printf("%s",p);rn return 0;rn
郁闷不知道哪里错了
<%rn dim startyear rn dim startmon rn dim startday rn dim code rn dim inputnornrn startyear = year(now()) rn startmon = month(now())rn startday = day(now()) rn rn Dim conn,rs,strSql1rn rn rn Set rs=Server.CreateObject("ADODB.Recordset")rn strSql1 ="select top 1 no from wzbg order by date desc"rn rs.Open strSql1,conn,1 rn rn if startmon<10 then rn startmon="0"&month(date) rn end if rn if startday<10 then rn startday="0"&day(date) rn end if rn if startyear&startmon&startday<>left((rs.Fields.Item("no").Value),8) then rn code=001 rn else rn code=int(mid((rs.Fields.Item("no").Value),9,3))+1 rn end if rn if len(code)=1 then rn code="00"&cstr(code) rn end if rn if len(code)=2 then rn code="0"&cstr(code) rn end if rn inputno = startyear & startmon&startday&cstr(code) rn %>rnrnrnrn然后界面里
不知道拷贝哪里错了
#include//此程序没有错误没有警告,为什么运行的时候会弹出一个对话框呢,给出错误尼rn#includernclass personrnrnpublic:rn person(char *pn)rn rn cout<<"construcintg"<
不知道哪里出错了:(
我想复制一个标记块,但就是出不来~rnrnrn rnrnrn rnrnrnrn其中book.xml为:rnrnrn rn 我rn Carl Saganrn Ballantine Booksrn rn rn Catwingsrn Ursula K. Le Guinrn Scholasticrn rn rn Home Townrn Tracy Kidderrn Random Housern rnrnrn就是跳不出什么东西来啊~
求助,不知道哪里错了
程序如下rn#include rn#includernusing namespace std;rnclass studentrnprivate:rnint num;rnstring name;rnstring sex;rnfloat s1,s2,s3;rnpublic:rn student(int num=0,string name=0,string sex=0,float s1=0,float s2=0,float s3=0)rn this->num=num;rn this->name=name;rn this->sex=sex;rn this->s1=s1;rn this->s2=s2;rn this->s3=s3;rn rn student(student &p)rn num=p.num;rn name=p.name;rn sex=p.sex;rn s1=p.s1;rn s2=p.s2;rn s3=p.s3;rnrn rn void setinfo(int num,string name,string sex,float s1,float s2,float s3)rn this->name=name;rn this->num=num;rn this->sex=sex;rn this->s1=s1;rn this->s2=s2;rn this->s3=s3;rn rn void getinfo(int &n,string &nam,string &se,float &sc1,float &sc2,float &sc3)rn n=num;rn nam=name;rn se=sex;rn sc1=s1;sc2=s2;sc3=s3;rn rn void show()rn cout<<"学号:"<>num>>name>>sex>>s1>>s2>>s3;rn std[i].setinfo(num,name,sex,s1,s2,s3);rn rnrnfor(i=0;i<5;i++)rncout<<"输出第"<>number;rnfor(i=0;i<5;i++)rnstd[i].getinfo(num,name,sex,s1,s2,s3);rnif(number==num) std[i].show();rnrncout<<"每门课成绩都大于85分的学生:"<<'\n';rnfor(i=0;i<5;i++)rnstd[i].getinfo(num,name,sex,s1,s2,s3);rn if(s1>85&&s2>85&&s3>85) cout<
报错了报错了
for(int i=0;i<5;i++)rn //初始化格式rn SimpleDateFormat s=new SimpleDateFormat("yyyy/MM/dd");rn //下周周一到周五的日期rn int years=ca.get(Calendar.YEAR);rn int month=ca.get(Calendar.MONTH)+1;rn int day=ca.get(Calendar.DATE)+i+1;rn Date da=new Date();rn if(day<=31)rn String a1="years/month/day";rn da=s.parse(a1); //报错rn elsern String a2="years/(month+1)/(day-31)";rn da=s.parse(a2); //报错rn rn rnrn使用Calendar这个类里面的方法
哪里报错了 简单的AJAX
$.ajax(rn type: "post",rn url: "index.ashx/getinfo",rn contentType: "application/json; charset=utf-8",rn dataType: "json",rn success: function (data) rn rn alert("成功了");rn ,rn error: function (err) rn alert("报错了");rn rn ); rnrnrn后台:rn [WebMethod]rn public static string getinfo()rn rnrn return "Hi,Welcome to China!";rnrn rn
websocket本地调试运行正常,部署服务器报302错误
前后端分离项目,本地调试运行一切正常。部署到服务器后,websocket连接报错。 报错: Error during WebSocket handshake: Unexpected response code: 302 错误原因: 1、nginx中缺少支持websocket配置 在后台server location中加入三行: location { # WebS...
新手求解 不知道哪里错了
public ResultSet getALl(String id)rn rn rn Connection conn=null;rn PreparedStatement pstmt=null;rn ResultSet rs=null;rn try rn conn=getConn();rn String sql="select * from mobile where moblie=? ";rn pstmt=conn.prepareStatement(sql);rn rs=pstmt.executeQuery();rn if(rs.next())rn rn id=rs.getString(0);rn rn rnrn catch (SQLException e) rn rn e.printStackTrace();rn finallyrn CloseAll(conn,pstmt,rs);rn rn rn return rs;rn rn
急急急!!!! 不知道哪里错了?????
我双击列表控件 时弹出对话框 这样写哪里错了rnrnvoid CQq::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult) rnrn // TODO: Add your control notification handler code herernrnrn CDlgshow* Dlgshow;rn Dlgshow = new CDlgshow(this);rn Dlgshow->Create(IDD_Dlgshow);rn Dlgshow->ShowWindow(IDD_Dlgshow);rnrn rnrn *pResult = 0;rnrnrn如果 我想双击 列表框控件里 不同的行 弹出多个窗口 怎么实现
网站发布问题,不知道哪里错了
开始在vs2008里面发布网站提示成功rn发布在一个文件夹里面rn然后用iis在发布rn也就是指向该文件夹rn自己电脑可以预览rn但是局域网内的电脑输入自己的IP或这IP加上绝对的路径rn都不能访问rnrnrn后来不知道怎么弄了下rn在用iis预览的时候就报错了rn在vs2008里面不报错rn报错的信息是rn[code=C#]rn“/futong1”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn配置错误 rn说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 rnrn分析器错误消息: 项“wuyeSQLstr”已添加。rnrn源错误: rnrnrn行 42: rn行 43: rn行 44: rn行 45: rn行 46: rn rnrn源文件: D:\My Documents\Visual Studio 2008\Projects\WebSite2\web.config 行: 44 rnrnrn--------------------------------------------------------------------------------rn版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433 rn[/code]
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件