index.jsp页面如下:
<div align="center" style="border-style: groove">
<form action="login" id="login" method="post" onsubmit="return isNull();">
<strong>姓 名:</strong>
<input type="text" name="user.name" class="tablestyle" id="user.name" style="width:200px"><br>
<strong>密 码:</strong>
<input type="password" name="user.password" class="tablestyle" id="user.password" style="width:200px"><br>
<input type="submit", name ="login" value="登录" class="onmouseout"
onmouseover="this.className='onmouseover'"
onmouseout="this.className='onmouseout'">
<a href="<%=path %>">找回密码</a>
<a href="<%=path %>/reg.jsp">注册</a>
</form>
</div>
web.xml如下:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>UpLoadPic</servlet-name>
<servlet-class>com.poscard.Util.UpLoadPic</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UpLoadPic</servlet-name>
<url-pattern>/UpLoadPic1</url-pattern>
</servlet-mapping>
<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>
<!-- spring -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/beans.xml
</param-value>
</context-param>
现在的问题是,当我点击注册超链接时,会跳转到reg.jsp。但是后台报错:
[http-8099-1] WARN org.apache.struts2.dispatcher.Dispatcher - Could not find action or result
There is no Action mapped for action name null. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)