Struts2应用程序出错
当我尝试在Struts2应用程序的index.jsp中执行tester操作时,出现以下错误 异常java.lang.NullPointerException org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.dispatcher.serviceAction(dispatcher.java:500) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher 下面是我的struts.xml和web.xml文件。你能告诉我它们是否有问题吗 struts.xmlStruts2应用程序出错,struts2,Struts2,当我尝试在Struts2应用程序的index.jsp中执行tester操作时,出现以下错误 异常java.lang.NullPointerException org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) org.ap
/success.jsp
web.xml
框架应用
index.jsp
支柱2
org.apache.struts2.dispatcher.FilterDispatcher
支柱2
/*
index.jsp
测试页
输入参数值:
呼叫网络服务
进行以下更改并重试:
<form action = "tester">
<h1>Test Page</h1>
Enter the parameter value:<input id="formParameter" type="text" title="attribute"/>
<input type=submit value="Call WebService"/>
</form>
测试页
输入参数值:
哪个S2版本?自Struts 2.1.3.Yes S2版本以来,过滤器Dispatcher
已被弃用。我应该使用什么来代替过滤器Dispatcher?哪个S2版本?
是S2版本:D@AndreaLigios这不仅仅是一个问题的答案。:)
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Framework Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.DriverManager"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page import="java.sql.Statement"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
</head>
<body>
<form action = "tester">
<h1>Test Page</h1>
Enter the parameter value:<input id="formParameter" type="text" title="attribute"/>
<button>Call WebService</button>
</form>
</body>
</html>
<form action = "tester">
<h1>Test Page</h1>
Enter the parameter value:<input id="formParameter" type="text" title="attribute"/>
<input type=submit value="Call WebService"/>
</form>