我想更新一个简单的web应用程序,它是用struts2,jsp和标准servlet构建的。 我想重定向一个网址到一个特定的行动,但似乎无法让它正常工作。 例如,这是正确的网址是:struts动作和重定向问题
http://localhost:8080/theapp/lookup/search.action
这里是我的web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"><web-app>
<display-name>theapp</display-name>
<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>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
这里是我的struts.xml:
<?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">
在指数
<default-action-ref name="search" />
<action name="search" method="search" class="com.theapp.SearchAction" >
<result>index.jsp</result>
<result name="input" >index.jsp</result>
<result name="error" type="redirect">site_locator_mobile/error.action</result>
</action>
这里的问题是,如果我不指定如上正确的URL,我刚刚得到的index.jsp文件,但没有任何性能。正在处理jsp,因为信息包含在servlet中。
我想是,如果刚刚进入别人什么:
http://localhost:8080/theapp/lookup/
比他们将采取何种措施:
http://localhost:8080/theapp/lookup/search.action
感谢
嗯..不知道如何解决我的上述帖子中的XML,以便它们都在相同的代码块。 – Casey 2010-05-12 21:38:35