
January 30th, 2013, 02:41 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 2
Time spent in forums: 42 m 25 sec
Reputation Power: 0
|
|
|
Rewrite Web url in struts 2
Hi folks,
I got a web application Struts2Example using struts 2 in eclipse. I have index.jsp page corresponding action class and they are running perfectly. My concern is that for the url localhost:9080/Struts2Example/index.jsp I want to change it localhost:9080/project/wpc/index.jsp without changing the web project name Struts2Example and I do not want to use the UrlRewriteFilter as well.
Can anybody help me out?
web.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="(URL address blocked: See forum rules)" xmlns:xsi="(URL address blocked: See forum rules)" xsi:schemaLocation="(URL address blocked: See forum rules) (URL address blocked: See forum rules)">
<display-name>Struts2Example</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>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
struts.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"(URL address blocked: See forum rules)">
<struts>
<constant name="struts.devMode" value="true" />
<package extends="struts-default" name="jaz.struts">
<action name="HelloWorld" class="jazz.struts.HelloWorldAction">
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
|