You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Aaron Evans <aa...@yahoo.ca> on 2005/11/17 15:19:22 UTC

1.3 Struts Validator Plugin Bug

Following the example validator application, I make a simple action config
like so:

<!--  Contact Action -->
		<action path="/contact" forward="/contact.jsp" /> 
		<action path="/contact-submit" 
type="com.mycompany.actions.ContactAction" 
			name="contactForm" scope="request" validate="true" 
input="input-form">
			<forward name="input-form" path="/contact.do" />
			<forward name="success" path="/contacted.jsp" />
		</action>


I have the validator plugin turned on and validating the form. If I submit
it with no form values filled in, then I get the following exception:

java.lang.IllegalArgumentException: Path input-form does not start with 
a "/" character

The reason?  The action's input attribute is set to the value "input-form".  
This simply references the forward named "input-form", just like the example.
But the validator plugin errors out because the "input-form" does not start
with a "/".

Changing the input attribute and forward name to "/input-form" does not 
help because it then tries the literal URI "/input-form" and I then get 
a 404 with:

The requested resource (/input-form) is not available.






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 1.3 Struts Validator Plugin Bug

Posted by Aaron Evans <aa...@yahoo.ca>.
Joe Germuska <Joe <at> Germuska.com> writes:

> 
> By default, Struts expects a path as the value to "input", not a 
> forward name.  You must explicitly configure if you prefer to use the 
> forward name.
> 
> See 
>
http://struts.apache.org/struts-core/userGuide/configuration.html
#controller_config,

> specifically the "inputForward" attribute.
> 

Thanks Joe.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 1.3 Struts Validator Plugin Bug

Posted by Joe Germuska <Jo...@Germuska.com>.
By default, Struts expects a path as the value to "input", not a 
forward name.  You must explicitly configure if you prefer to use the 
forward name.

See 
http://struts.apache.org/struts-core/userGuide/configuration.html#controller_config, 
specifically the "inputForward" attribute.

Joe


At 2:19 PM +0000 11/17/05, Aaron Evans wrote:
>Following the example validator application, I make a simple action config
>like so:
>
><!--  Contact Action -->
>		<action path="/contact" forward="/contact.jsp" />
>		<action path="/contact-submit"
>type="com.mycompany.actions.ContactAction"
>			name="contactForm" scope="request" validate="true"
>input="input-form">
>			<forward name="input-form" path="/contact.do" />
>			<forward name="success" path="/contacted.jsp" />
>		</action>
>
>
>I have the validator plugin turned on and validating the form. If I submit
>it with no form values filled in, then I get the following exception:
>
>java.lang.IllegalArgumentException: Path input-form does not start with
>a "/" character
>
>The reason?  The action's input attribute is set to the value "input-form". 
>This simply references the forward named "input-form", just like the example.
>But the validator plugin errors out because the "input-form" does not start
>with a "/".
>
>Changing the input attribute and forward name to "/input-form" does not
>help because it then tries the literal URI "/input-form" and I then get
>a 404 with:
>
>The requested resource (/input-form) is not available.
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org


-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org