给我报服务器500,空指针异常.用eclipse是可以的,idea不行 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package name="p1" extends="struts-default"> <action name="hello" class="com.org.web.action.Hello" method="sayHello"> <result name="success"> /success.jsp </result> </action> </package> </struts>
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> <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>
<%-- Created by IntelliJ IDEA. User: 39738 Date: 2018-07-09 Time: 21:00 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>struts2方法执行了</title> </head> <body> <a href="hello.action">带有hello的action</a> </body> </html>
package com.org.web.action; public class Hello { public String sayHello(){ System.out.println("方法执行了"); return "success"; } }
嗯恩恩
相关分类