You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sam <sa...@tera.teralink.com> on 2004/02/12 05:03:47 UTC
Config issue
Greetings,
I'm a STRUTS newbie and am having a problem I can't seem to solve,
searched everywhere I can think of and haven't found an answer.
I have STRUTS 1.1 running with Tomcat 5.0.18 and am
having a URI context issue. All of my html form actions
are coming out with the wrong URI -- should be "/gannett/login"
but are coming out as "/gannett/gannett/login" duplicating the prefix.
Any ideas out there? Following is my config.
Thanks,
Sam
web.xml snippet:
<web-app>
<display-name>Gannett Web Application</display-name>
<servlet>
<servlet-name>gannett</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>4</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>4</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>gannett</servlet-name>
<url-pattern>/gannett/*</url-pattern>
</servlet-mapping>
Struts-config:
<action-mappings>
<action
path="/login"
input="/login.jsp"
name="loginForm"
scope="request"
type="com.dimeta.security.LoginAction"
validate="false">
<forward name="Success" path="/chooser.jsp" redirect="true"/>
<forward name="Failure" path="/login.jsp" redirect="true"/>
</action>
HTML for login.jsp:
<html:form action="/login" method="post">
</html:form>
HTML source from browser:
<form name="loginForm" method="post" action="/gannett/gannett/login">
</form>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Config issue
Posted by James Mitchell <jm...@apache.org>.
It is possible that this application is NOT the default (or in Tomcat terms
'ROOT' application).
In that case, it is correct...
> <form name="loginForm" method="post" action="/gannett/gannett/login">
(servlet context) ^^^^^^^^
(your path mapping) ^^^^^^^^^^^^^^
If this application was the default, then that would eliminate one the first
"/gannett"s
Hope that helps.
--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
MSN: jmitchell@apache.org
----- Original Message -----
From: "Sam" <sa...@tera.teralink.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, February 11, 2004 11:03 PM
Subject: Config issue
> Greetings,
>
> I'm a STRUTS newbie and am having a problem I can't seem to solve,
> searched everywhere I can think of and haven't found an answer.
>
> I have STRUTS 1.1 running with Tomcat 5.0.18 and am
> having a URI context issue. All of my html form actions
> are coming out with the wrong URI -- should be "/gannett/login"
> but are coming out as "/gannett/gannett/login" duplicating the prefix.
>
> Any ideas out there? Following is my config.
>
> Thanks,
>
> Sam
>
> web.xml snippet:
>
> <web-app>
> <display-name>Gannett Web Application</display-name>
> <servlet>
> <servlet-name>gannett</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>4</param-value>
> </init-param>
> <init-param>
> <param-name>detail</param-name>
> <param-value>4</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>gannett</servlet-name>
> <url-pattern>/gannett/*</url-pattern>
> </servlet-mapping>
>
> Struts-config:
> <action-mappings>
> <action
> path="/login"
> input="/login.jsp"
> name="loginForm"
> scope="request"
> type="com.dimeta.security.LoginAction"
> validate="false">
> <forward name="Success" path="/chooser.jsp" redirect="true"/>
> <forward name="Failure" path="/login.jsp" redirect="true"/>
> </action>
>
> HTML for login.jsp:
> <html:form action="/login" method="post">
> </html:form>
>
> HTML source from browser:
> <form name="loginForm" method="post" action="/gannett/gannett/login">
> </form>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Config issue
Posted by Navjot Singh <na...@net4india.net>.
this can happen only when you have gannett (first )as context name
AND
gannett (second one) as module name.
>-----Original Message-----
>From: news [mailto:news@sea.gmane.org]On Behalf Of Sam
>Sent: Thursday, February 12, 2004 9:34 AM
>To: struts-user@jakarta.apache.org
>Subject: Config issue
>
>
>Greetings,
>
>I'm a STRUTS newbie and am having a problem I can't seem to solve,
>searched everywhere I can think of and haven't found an answer.
>
>I have STRUTS 1.1 running with Tomcat 5.0.18 and am
>having a URI context issue. All of my html form actions
>are coming out with the wrong URI -- should be "/gannett/login"
>but are coming out as "/gannett/gannett/login" duplicating the prefix.
>
>Any ideas out there? Following is my config.
>
>Thanks,
>
>Sam
>
>web.xml snippet:
>
><web-app>
> <display-name>Gannett Web Application</display-name>
> <servlet>
> <servlet-name>gannett</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>4</param-value>
> </init-param>
> <init-param>
> <param-name>detail</param-name>
> <param-value>4</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>gannett</servlet-name>
> <url-pattern>/gannett/*</url-pattern>
> </servlet-mapping>
>
>Struts-config:
> <action-mappings>
> <action
> path="/login"
> input="/login.jsp"
> name="loginForm"
> scope="request"
> type="com.dimeta.security.LoginAction"
> validate="false">
> <forward name="Success" path="/chooser.jsp"
>redirect="true"/>
> <forward name="Failure" path="/login.jsp"
>redirect="true"/>
> </action>
>
>HTML for login.jsp:
><html:form action="/login" method="post">
></html:form>
>
>HTML source from browser:
><form name="loginForm" method="post" action="/gannett/gannett/login">
></form>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org