首页 \ 问答 \ 无法找到行动或结果(Could not find action or result)

无法找到行动或结果(Could not find action or result)

我正进入(状态:

com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn无法找到操作或结果没有针对命名空间[/]映射的Action和与上下文路径[/]关联的操作名称[]。 - [未知位置]

我使用RAD + WebSphere的组合进行开发,使用以下代码:

struts.xml中:

<struts>
    <constant name="struts.devMode" value="true" />
    <constant name="struts.custom.i18n.resources" value="ApplicationResources" />
    <package name="default" extends="struts-default" namespace="/">

web.xml中:

<filter>
    <filter-name>struts2</filter-name>
    <filter-class> 
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
    <welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

我已阅读所有博客并尝试了网站上提到的所有内容。 这是一个错误,因为我无法找到的一些不同的原因。


I am getting:

com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result There is no Action mapped for namespace [/] and action name [] associated with context path [/]. - [unknown location]

I am using a combination of RAD + WebSphere for development with the following code:

struts.xml:

<struts>
    <constant name="struts.devMode" value="true" />
    <constant name="struts.custom.i18n.resources" value="ApplicationResources" />
    <package name="default" extends="struts-default" namespace="/">

web.xml:

<filter>
    <filter-name>struts2</filter-name>
    <filter-class> 
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 
    </filter-class>
</filter>
<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
    <welcome-file>Login.jsp</welcome-file>
</welcome-file-list>

I have read all blogs & tried everything mentioned on sites. It is an error because of some different reason what I am unable to find .


原文:https://stackoverflow.com/questions/30932742
更新时间:2023-01-17 19:01

最满意答案

你分配了col=end; b[k]=(double*) calloc (col,sizeof (double)); col=end; b[k]=(double*) calloc (col,sizeof (double)); 但你在循环中for(j=start;j<=end-1;j++){ b[i][j]=b[i][j+1]; } b[i][end] for(j=start;j<=end-1;j++){ b[i][j]=b[i][j+1]; } 在函数中。 computeDeterminant 。 你设置col=end+1; 或者你改变<= by <

if(matrix == NULL)
    return 0.0;

row = end;
col = end;
double ** b=(double **) malloc (row*sizeof (double*));
for(k=0; k<row ;k++){
    b[k]=(double*) calloc (col,sizeof (double));
}

for(i=0;i<end;i++){
    for(j=0;j<end;j++){    
        b[i][j]=matrix[i][j];
    }
}

for(i=0;i<end-1;i++){ // i<end-1 bcause of i+1  
    for(j=1;j<end;j++){ // j<end
       b[i][j]=b[i+1][j];
    }
}

for(i=0;i<end;i++){ // i<end
    for(j=start;j<end-1;j++){ // j<end-1 bcause of j+1
        b[i][j]=b[i][j+1];
    }
}

此外,您应该释放在函数computeDeterminantb分配的内存

if (end-1==2){
    s = b[1][1]*b[2][2]-b[1][2]*b[2][1];
}
else{
    for (j=0;j<end-1;j++){
        s=s+pw(1+j)*b[1][j]*computeDeterminant(end-1,j,b);
    }
}

for(k=0; k<row ;k++){
    free( b[k] );
}
free(b);

return s;

在函数sum存在类似的问题:

double sum(int n,double **matrix)
{
    int j;
    double s=0;

    if(n>2)
    {
        // for(j=1;j<=n;j++) <- change this
        for(j=1;j<n;j++)
               //^
            s=s+pw(1+j)*matrix[1][j]*computeDeterminant(n, j, matrix);
        return s;
    }
    else
        return matrix[1][1]*matrix[2][2]-matrix[1][2]*matrix[2][1];
}

You allocated col=end; b[k]=(double*) calloc (col,sizeof (double)); but you accesed to b[i][end] in loop for(j=start;j<=end-1;j++){ b[i][j]=b[i][j+1]; } in function. computeDeterminant. Either you set col=end+1; or you change <= by <.

if(matrix == NULL)
    return 0.0;

row = end;
col = end;
double ** b=(double **) malloc (row*sizeof (double*));
for(k=0; k<row ;k++){
    b[k]=(double*) calloc (col,sizeof (double));
}

for(i=0;i<end;i++){
    for(j=0;j<end;j++){    
        b[i][j]=matrix[i][j];
    }
}

for(i=0;i<end-1;i++){ // i<end-1 bcause of i+1  
    for(j=1;j<end;j++){ // j<end
       b[i][j]=b[i+1][j];
    }
}

for(i=0;i<end;i++){ // i<end
    for(j=start;j<end-1;j++){ // j<end-1 bcause of j+1
        b[i][j]=b[i][j+1];
    }
}

Further you should free the memory you allocated for b in function computeDeterminant

if (end-1==2){
    s = b[1][1]*b[2][2]-b[1][2]*b[2][1];
}
else{
    for (j=0;j<end-1;j++){
        s=s+pw(1+j)*b[1][j]*computeDeterminant(end-1,j,b);
    }
}

for(k=0; k<row ;k++){
    free( b[k] );
}
free(b);

return s;

In function sum there is a similar problem:

double sum(int n,double **matrix)
{
    int j;
    double s=0;

    if(n>2)
    {
        // for(j=1;j<=n;j++) <- change this
        for(j=1;j<n;j++)
               //^
            s=s+pw(1+j)*matrix[1][j]*computeDeterminant(n, j, matrix);
        return s;
    }
    else
        return matrix[1][1]*matrix[2][2]-matrix[1][2]*matrix[2][1];
}

相关问答

更多
  • 你几乎拥有它。 您将size的地址传递给read_data因此可以在该函数中更改size ,但是没有传递mtx的地址,因此它不反映read_data完成的分配。 You almost had it. You passed the address of size to read_data so size could be changed within that function, but did not pass the address of mtx, so it does not reflect the a ...
  • 使用new而不是malloc在堆上创建C ++对象。 下列: head = (PNODE) malloc(sizeof(NODE)); 应该读 head = new NODE; malloc()在这里不起作用的原因是它不调用对象构造函数。 Use new rather than malloc to create C++ objects on the heap. The following: head = (PNODE) malloc(sizeof(NODE)); should read head = ...
  • 你可能只是在这里得到堆栈溢出。 该数组太大而不适合您程序的堆栈地址空间。 如果你在堆上分配数组,你应该没问题,假设你的机器有足够的内存。 You're probably just getting a stack overflow here. The array is too big to fit in your program's stack address space. If you allocate the array on the heap you should be fine, assuming y ...
  • 保罗·德雷珀,你几乎是对的。 我认为,正确的代码应如下所示: Matrix* transp (Matrix* mat) { int i, j; int linesTrp = mat->nc ; int colTrp = mat->nl ; Matrix* trp = initMatrix (linesTrp, colTrp) ; // was correct originally for (i=0; i< colTrp; i++) { ...
  • 检查fopen的返回值(好吧,检查任何调用的返回值),它可能无法打开文件。 Check the return value of fopen (well, check the return value of any call), it probably failed to open the file.
  • 检查是否确实分配了rn 。 它可能是导致分段错误的唯一因素。 我在我的电脑上测试了你的代码,它可以告诉你运行正常。 可以检查安装GSL,他们有一个你可以使用的测试套件 check to see if rn has really been allocated. It is probably the only thing that can cause segmentation fault. i tested your code on my computer, it runs okay as far as the ...
  • 你分配了col=end; b[k]=(double*) calloc (col,sizeof (double)); col=end; b[k]=(double*) calloc (col,sizeof (double)); 但你在循环中for(j=start;j<=end-1;j++){ b[i][j]=b[i][j+1]; } b[i][end] for(j=start;j<=end-1;j++){ b[i][j]=b[i][j+1]; } 在函数中。 computeDeterminant 。 你设置co ...
  • 如果缓冲区太小, strncpy不会终止其输出。 出于这个原因,许多人认为在几乎所有情况下它都是一个糟糕的功能选择。 你的代码有另一个问题, dst没有指向任何地方,但你试图通过它写字符。 你认为那些人物会在哪里? 可能这会导致您的段错误,尝试将字符写入您尚未分配的随机内存位置。 假设您希望坚持使用递归方法:不要每次都复制字符串,而是更改函数以传递字符串的长度。 那么你不需要分配任何内存,也不需要浪费任何时间调用strlen : unsigned int hash_code(const char *str, ...
  • 你的分配应该是 a=malloc(5*sizeof(int*)); 请注意sizof的指针类型。 在某些系统(21世纪初的Windows桌面)中, int恰好与int*大小相同,但您不能认为。 scanf将指针作为参数:最清楚的方法是scanf("%d", &a[i][j]); 一旦完成,不要忘记free记忆。 最后,每当我看到这样的矩阵建模时,我就会死一点。 当然,它允许您使用[][]表示法,但通常最好将其建模为连续的内存块,并使用成语i * columns + j来访问(i, j)处的元素。 Your ...
  • 你有三个选择: 像你不想做的那样在堆栈(或全局)上分配。 错误可能是因为您认为数组数组可以被视为指向指针的指针,但它不能。 动态分配,首先是第一维,每行分配第二维。 您错过了代码中的最后一步。 像现在一样使用单个维度动态分配,但使用例如row * column_length + column作为索引。 You have three choices: Allocate on the stack (or globally) like you don't want to do apparently. The er ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。