You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tricia Ong Cheah Yen <tr...@aretae.com> on 2001/12/27 11:21:32 UTC

How do display a *.do as the URL?

Hi,
	I'm unable to have a url that appears in the client web-browser
address bar
of the sort: http://localhost:8080/admin/showNewsletter.do

but the url that i'm seeing is:
http://localhost:8080//admin/managenewsletters/newsletter_display_defaul
t.jsp


how can i accomplish this?
	<action path="/admin/managenewsletters/showNewsletters"
		type="test.actions.ShowNewslettersAction"
name="newsletterForm" scope="request"
		input="/admin/mainMenu.jsp">
		<forward name="success"
	
path="/admin/managenewsletters/newsletter_display_default.jsp"/>
	</action>

	<!-- Action Servlet Mapping in web.xml -->
	<servlet-mapping>
		<servlet-name>action</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
TIA



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How do display a *.do as the URL?

Posted by Crisalyn Ramos <Cr...@morganstanley.com>.
Tricia,

I assume that admin is your context path? Need not put your context path in your
mapping as it is automatically appended.

This is how your struts-config.xml file should look like:

<struts-config>

<!-- Your form bean definitions here -->

<form-beans>
     <form-bean
          name="newsletterForm"
          type="test.actions.ShowNewslettersActionForm">
     </form-bean>
</form-beans>

<!-- Action Mappings here -->

<action-mappings>

        <action
                path="/showNewsletters"
                type="test.actions.ShowNewslettersAction"
                name="newsletterForm"
                scope="request"
                input="/mainMenu.jsp">
        <forward
                name="success"
            path="/managenewsletters/newsletter_display_default.jsp"/>
       </action>
<action-mappings>
</struts-config>

then call your application like: http://localhost:8080/admin/showNewsletter.do

Hope this one helps.


thanks,
Cris




Tricia Ong Cheah Yen wrote:

> Hi,
>         I'm unable to have a url that appears in the client web-browser
> address bar
> of the sort: http://localhost:8080/admin/showNewsletter.do
>
> but the url that i'm seeing is:
> http://localhost:8080//admin/managenewsletters/newsletter_display_defaul
> t.jsp
>
> how can i accomplish this?
>         <action path="/admin/managenewsletters/showNewsletters"
>                 type="test.actions.ShowNewslettersAction"
> name="newsletterForm" scope="request"
>                 input="/admin/mainMenu.jsp">
>                 <forward name="success"
>
> path="/admin/managenewsletters/newsletter_display_default.jsp"/>
>         </action>
>
>         <!-- Action Servlet Mapping in web.xml -->
>         <servlet-mapping>
>                 <servlet-name>action</servlet-name>
>                 <url-pattern>*.do</url-pattern>
>         </servlet-mapping>
> TIA
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>