File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

global forward not overwriting url

 
srinivas mandayam
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am using struts 1.1 i am calling login action servlet from my index.jsp and if login fails i am forwarding it back to index.jsp using mapping.findforward("welcome") but the url is not getting overwritten

my struts-config.xml is <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <struts-config> <global-forwards> <forward name="success" path="/html/Forward_To_next.jsp" /> <forward name="welcome" path="/index.jsp" /> </global-forwards> <action-mappings> <!-- Start of Login module related actions --> <action name="logonForm" type="myweb.web.login.LoginAction" input="logon" path="/logon" /> </action-mappings> <!-- Controller Configuration --> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" /> <!-- Plug Ins Configuration --> <!-- Tiles plugin --> <!-- comment following if struts1.0.x --> <plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property value="/WEB-INF/tiles-defs.xml" property="definitions-config" /> <set-property value="0" property="definitions-debug" /> <set-property value="0" property="definitions-parser-details" /> <set-property value="true" property="definitions-parser-validate" /> </plug-in> <!-- end comment if struts1.0.x --> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" property="pathnames" /> </plug-in> </struts-config>

my web.xml is <?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/j2ee/dtds/web-app_2_3.dtd"> <web-app> <!-- Display Name and Description --> <display-name>myWeb</display-name> <description>myWeb</description> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <!-- Standard Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>/do/*</url-pattern> </servlet-mapping> <!-- Welcome File for the application--> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- Struts Tag Library Descriptors --> <taglib> <taglib-uri>/tags/struts-bean</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tags/struts-html</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tags/struts-logic</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tags/struts-nested</taglib-uri> <taglib-location>/WEB-INF/struts-nested.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tags/struts-tiles</taglib-uri> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location> </taglib> </web-app>
the url used is http://localhost:8080/myWeb/index.jsp after i submit from index.jsp the url stays at http://localhost:8080/myWeb/do/logon; it does not get forwarded to the index.jsp i am using jboss3.2.3 and built an ear file with war and jar file can anyone please help me
 
Vicky Mohan
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
********************************************
If you're going to post more than a line or two of your code, wrap it in UBB Code tags (there is a button on the edit screen to assist with this). They preserve your indening which makes the code easier to read. This usually results in more people reading it an helping you.

*********************************************
in your web.xml

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>

i think the URL pattern could be wrong.

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

[ August 25, 2005: Message edited by: Mohen Vijay ]
[ August 25, 2005: Message edited by: Mohen Vijay ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic