解决方案 »
- 使用Struts 2时Tomcat启动出错。
- Eclipse
- createStatement()?
- struts2.0.14 不能显示datetimepicker
- CDATA??
- struts中哪个标签是显示日期的
- from Picture p where exists( (from Album a where exists (select c.id from Catego
- 用代码生成XML文件时,如何将空格作为值传递给一个结点?有答案马上结贴!!
- I have a trouble with ssl , and need your help ,thanks a lot!
- 求助!
- 大学期间参加软件竞赛很重要吗?
- 引用javax.websocket.server.serverendpoint需要导入什么jar包
<?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="default" namespace="/" extends="struts-default"> <action name="login" class="com.jacksen.struts2Demo01.UserAction">
<result>/userlogin.jsp</result> </action>
<action name="check" class="com.jacksen.struts2Demo01.UserAction" method="execute">
<result name="success">/success.jsp</result>
<result name="fail">/fail.jsp</result>
</action>
</package>
<!-- Add packages here --></struts>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>Struts2Demo</display-name> <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>index.jsp</welcome-file>
</welcome-file-list></web-app>
唉,真是粗心大意。加上了之后,在地址栏中输入http://localhost/Struts2_Demo01/login.action,就没有错误了。
但是如果在【web.xml】中配置【<welcome-file>】的时候貌似不能写某一个action,我就是在这里边写了login.action,
虽然输入上边那个url正确了,但是如果让eclipse自动弹出网页的时候还是会报错。
所以,把【<welcome-file>】改了就对了。
structs。xml:
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="true" />JSP:
action=" actionname!method.action"就可以直接访问了