java-Struts2返回json的时候404错误 新手求大神知道,在线等回复。QQ945377104

问题描述

Struts2返回json的时候404错误 新手求大神知道,在线等回复。QQ945377104
Struts配置文件代码:
<?xml version=""1.0"" encoding=""UTF-8"" ?>
<!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN""
http://struts.apache.org/dtds/struts-2.0.dtd"">

/index.jsp这种方式可以访问页面
当我改成json类型的时候访问页面就报404的错误,action都进不了。

解决方案

配置文件不全,莫非你是想在路径后加上形如xxxaction.json

解决方案二:
struts.action.extension = json
这句话加了在struts.xml文件中。这句话的意思是说,访问action的路径都为xxxAction.json

时间: 2024-08-04 06:14:49

java-Struts2返回json的时候404错误 新手求大神知道,在线等回复。QQ945377104的相关文章

spring mvc-用idea15开发 springmvc项目时报404错误,求大神告知原因

问题描述 用idea15开发 springmvc项目时报404错误,求大神告知原因 web.xml配置如下: restorg.springframework.web.servlet.DispatcherServlet contextConfigLocation/WEB-INF/rest-servlet.xml 1 rest/restful/* rest-servlet.xml配置如下: <beans xmlns="http://www.springframework.org/schema/

struts2.0 Dispatcher initialization failed错误,求大神给指点

问题描述 struts2.0 Dispatcher initialization failed错误,求大神给指点 webxml: <?xml version="1.0" encoding="UTF-8"?> xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schem

图片-Eclipse编译Java文件出现空指针错误,求大神指教如何改正

问题描述 Eclipse编译Java文件出现空指针错误,求大神指教如何改正 另外出现错误的代码 主函数 public static void main(String[] args) { Login login = new Login(RELOAD); login.setVisible(true); } public Login() { super(); initialize(); } public Login(boolean reload) { super(); initialize(); ne

数据传输-WriteFile失败,GetLastError返回1,功能错误,求大神解答啊

问题描述 WriteFile失败,GetLastError返回1,功能错误,求大神解答啊 向DSP写入数据,设备打开成功句柄有效,WriteFile失败,GetLastError返回1 部分代码: DWORD dwTransRet = 0, dwRecRet = 0; BOOL bTransRet, bRecRet; DWORD dwError; unsigned char RecBuff[BufferSize] = { 0 }; unsigned char TransBuff[BufferSi

ava基础 代码错误-Java新手,求大神帮小弟看看这段代码哪里错了,多谢!!!

问题描述 Java新手,求大神帮小弟看看这段代码哪里错了,多谢!!! class Student { //姓名 private String name; //年龄 private int age; //构造方法 public Student(){ } public Student(String name, int age){ this.name = name; this.age = age; } public String getName(){ return name; } public voi

Android http client response500错误,求大神帮忙看看代码!

问题描述 Android http client response500错误,求大神帮忙看看代码! http://121.42.195.113/usay/register.jsp服务器这里没错啊....但不知道为什么放到安卓上就不行 package com.example.demo_jsom1; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.http

recyclerview-进入页面虚拟机崩溃,找不到错误,求大神帮改下源码,谢谢啦

问题描述 进入页面虚拟机崩溃,找不到错误,求大神帮改下源码,谢谢啦 import android.app.Activity;import android.os.AsyncTask;import android.os.Bundle;import android.support.v7.widget.DefaultItemAnimator;import android.support.v7.widget.RecyclerView;import android.support.v7.widget.Sta

java-jsp页面从数据库读数据遇到一个错误,求大神。

问题描述 jsp页面从数据库读数据遇到一个错误,求大神. Servlet.service() for servlet [GoYeahAdmin] in context with path [/admin] threw exception [Handler processing failed; nested exception is java.lang.StackOverflowError] with root cause java.lang.StackOverflowError at org.c

jdk-执行source /etc/profile时候报如下错误,求大神帮忙!

问题描述 执行source /etc/profile时候报如下错误,求大神帮忙! 10C 在/etc/profile配置jdk路径,执行source /etc/profile时候报如下错误:bash: STSIZEpathmunge: command not found export JAVA_HOME=/usr/java/jdk1.6.0_45export PATH=$PATH:$JAVA_HOME/binexport CLASSPATH=.:$JAVA_HOME/lib/tools.jar: