struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From otisg <>
Subject Can't map HTML form action to Struts action
Date Tue, 24 Dec 2002 05:21:31 GMT

I am having difficulties hooking up an HTML
form action to an action mapping defined in
struts-config.xml.  This is the Struts HEAD
from CVS.  I am using Struts with Velocity.
 I can get .vm templates to load, but can't
get things like HTML form submission action
to map to a Struts action.

My web.xml contains:


    <!-- Map *.vm files to Velocity -->

My struts-config.xml contains:

	<action type    
		name     ="loginF"
		validate ="true"
                path     ="/login"
		scope    ="request"
                input    ="/login.vm">
	    <forward name="success"   path="/home.vm"/>
	    <forward name="failure"  

My HTML form contains this:

<form method="POST" action="/foo/login">

When I submit this form I get a 404 from the
servlet container:

404 Not Found
/foo/login was not found on this server.

I've looked at several configuration
examples, and what I have looks fine, but
unfortunately it is not.  I am using this
with Resin 2.1.6.  One suspicious thing that
I notice in Resin's log after I submit the
HTML form is this:

[2002/12/24 00:05:24] file: init
[2002/12/24 00:05:24]
com.caucho.server.http.DirectoryServlet: init

This looks as if Resin is not mapping my
/foo/action to the action servlet defined in
my web app's web.xml...maybe, not sure.

I have tried mapping /foo/* to
MyVelocityViewServlet in web.xml, but that
resulted in .vm pages being rendered as
text/plain.  That may be fixed by
associating .vm extension with text/html,
but I'm not sure how to do this under Resin
yet.  But I think I have something else
wrong, anyway.

Thank you,

Get your own "800" number
Voicemail, fax, email, and a lot more

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message